#12695 wip removing warnings

This commit is contained in:
Jonathan 2024-02-12 17:59:27 +01:00
parent d590961e69
commit 0dcced8b53
25 changed files with 155 additions and 49 deletions

View File

@ -229,7 +229,7 @@ function users_extension_main_god($god=true)
$data = [];
$data[0] = '<a href="index.php?sec=gusuarios&amp;sec2=godmode/users/configure_user&amp;id='.$row['id_user'].'">'.$row['id_user'].'</a>';
$data[1] = $last_login_data['ip_origin'];
$data[1] = $last_login_data['ip_origen'];
$data[2] = date($config['date_format'], $last_login_data['utimestamp']);
$data[3] = date($config['date_format'], $row['last_connect']);
array_push($table->data, $data);

View File

@ -221,6 +221,9 @@ $search = trim(get_parameter('search', ''));
$graphs = custom_graphs_get_user($config['id_user'], false, true, $access);
$offset = (int) get_parameter('offset');
$table_aux = new stdClass();
if (isset($strict_user) === false) {
$strict_user = false;
}
$table_aux->width = '100%';
if (is_metaconsole() === true) {
@ -273,7 +276,11 @@ if (is_metaconsole() === true) {
html_print_input_text('search', $search, '', 30, '', true)
);
$searchForm .= '<form action="index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group='.$id_group.'&pure='.$pure.'"method="post">';
if (isset($pure) === false) {
$pure = '';
}
$searchForm = '<form action="index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group='.$id_group.'&pure='.$pure.'"method="post">';
$searchForm .= html_print_table($table_aux, true);
$searchForm .= html_print_div(

View File

@ -130,6 +130,14 @@ if ($action === 'new') {
$backgroundPreviewImages[] = html_print_image('', true, ['id' => 'imagen', 'class' => 'invisible']);
if (isset($formAction) === false) {
$formAction = 'POST';
}
if (isset($formHidden) === false) {
$formHidden = '';
}
// Form.
echo '<form id="back" class="max_floating_element_size" method="POST" action="'.$formAction.'" enctype="multipart/form-data">';
echo $formHidden;

View File

@ -285,7 +285,11 @@ switch ($activeTab) {
}
// If the background is changed the size is reseted
$background_now = $visualConsole['background'];
if (isset($visualConsole['background']) === true) {
$background_now = $visualConsole['background'];
} else {
$background_now = '';
}
$values['width'] = $width;
$values['height'] = $height;

View File

@ -66,7 +66,8 @@ class Applications extends Wizard
int $page=0,
string $msg='Default message. Not set.',
string $icon='images/wizard/applications.png',
string $label='Applications'
string $label='Applications',
string $class_style='',
) {
$this->setBreadcrum([]);

View File

@ -66,7 +66,8 @@ class Custom extends Wizard
int $page=0,
string $msg='Default message. Not set.',
string $icon='/images/wizard/Custom_apps@svg.svg',
string $label='Custom'
string $label='Custom',
string $class_style='',
) {
$this->setBreadcrum([]);

View File

@ -629,7 +629,7 @@ class DiscoveryTaskList extends HTML
// Updated at.
$table->headstyle[8] .= 'min-width: 50px; width: 150px;';
// Operations.
$table->headstyle[9] .= 'min-width: 150px; width: 250px;';
$table->headstyle[9] = 'min-width: 150px; width: 250px;';
if (check_acl($config['id_user'], 0, 'AW')) {
$table->head[0] = __('Force');
@ -1135,6 +1135,10 @@ class DiscoveryTaskList extends HTML
array_push($table->data, $data);
}
if (isset($server_name) === false) {
$server_name = '';
}
if (empty($table->data)) {
$content = '<div class="nf">'.__('Server').' '.$server_name.' '.__('has no discovery tasks assigned').'</div>';
$return = false;

View File

@ -58,6 +58,10 @@ if (check_login()) {
if ($check_csv_button) {
if (check_acl($config['id_user'], 0, 'PM')) {
if (isset($permission) === false) {
$permission = '';
}
echo json_encode($permission);
return;
} else {

View File

@ -1059,6 +1059,10 @@ class Diagnostics extends Wizard
$tFragmentationStatus = 1;
}
if (isset($config['thousand_separator']) === false) {
$config['thousand_separator'] = '';
}
$result = [
'error' => false,
'data' => [

View File

@ -186,9 +186,11 @@ class ExtensionsDiscovery extends Wizard
private function loadConfig()
{
$row = db_get_row('tdiscovery_apps', 'short_name', $this->mode);
$this->id = $row['id_app'];
$this->name = $row['name'];
$this->description = $row['description'];
if ($row !== false) {
$this->id = $row['id_app'];
$this->name = $row['name'];
$this->description = $row['description'];
}
}

View File

@ -208,6 +208,10 @@ class HTML
$i = 0;
foreach ($urls as $url) {
if (isset($url['selected']) === false) {
$url['selected'] = 0;
}
if ($url['selected'] == 1) {
$class = 'selected';
} else {

View File

@ -199,6 +199,10 @@ class SnmpConsole extends HTML
).'</a>';
$list['active'] = true;
if (isset($screen) === false) {
$screen = '';
}
// Header.
ui_print_standard_header(
__('SNMP Console'),

View File

@ -289,6 +289,10 @@ function agent_counters_custom_fields($filters)
}
}
if (isset($groups_and) === false) {
$groups_and = '';
}
// Filter by status module.
$empty_agents_count = "UNION ALL
SELECT ta.id_agente,
@ -616,6 +620,10 @@ function agent_counters_custom_fields($filters)
$result_meta = [];
$data = [];
if (isset($and_module_search) === false) {
$and_module_search = '';
}
$query = sprintf(
"SELECT tcd.description AS name_data,
SUM(IF($agent_state_total, 1, 0)) AS a_agents,
@ -677,6 +685,11 @@ function agent_counters_custom_fields($filters)
$result_meta[] = db_get_all_rows_sql($query);
if (isset($server_data) === false) {
$server_data = [];
$server_data['id'] = '';
}
$query_data = sprintf(
"SELECT
tcd.description,

View File

@ -7415,8 +7415,9 @@ function html_print_select_date_range(
$output .= '</div>';
$output .= '<div id="'.$name.'_range" class="inline_flex" '.$display_range.'>';
$table = new stdClass();
$table->data = [];
$table->class = 'table-adv-filter';
$table->data[0][0] .= '<div><div><div><span class="font-title-font">'.__('From').':</span></div>';
$table->data[0][0] = '<div><div><div><span class="font-title-font">'.__('From').':</span></div>';
$table->data[0][0] .= html_print_input_text('date_init', $date_init, '', 12, 10, true).' ';
$table->data[0][0] .= html_print_input_text('time_init', $time_init, '', 10, 7, true).' ';
$table->data[0][0] .= '</div>';

View File

@ -788,22 +788,24 @@ function inventory_get_datatable(
$rows = db_get_all_rows_sql($sql);
if ($order_by_agent === false) {
$modules = [];
foreach ($rows as $row) {
if ($row['utimestamp'] !== $row['last_update']) {
$row['timestamp'] = $row['last_update_timestamp'];
}
$data_rows = explode(PHP_EOL, $row['data_inventory']);
foreach ($data_rows as $data_key => $data_value) {
if (empty($inventory_search_string) !== true) {
$search_check = strpos(str_replace('&#x20;', ' ', $data_value), $inventory_search_string);
} else {
$search_check = true;
if ($rows !== false) {
foreach ($rows as $row) {
if ($row['utimestamp'] !== $row['last_update']) {
$row['timestamp'] = $row['last_update_timestamp'];
}
if (empty($data_value) === false && $search_check !== false) {
$row['data'] = $data_value;
$modules[$row['name']][$row['name_agent'].'-'.$data_key.'-'.$data_value] = $row;
$data_rows = explode(PHP_EOL, $row['data_inventory']);
foreach ($data_rows as $data_key => $data_value) {
if (empty($inventory_search_string) !== true) {
$search_check = strpos(str_replace('&#x20;', ' ', $data_value), $inventory_search_string);
} else {
$search_check = true;
}
if (empty($data_value) === false && $search_check !== false) {
$row['data'] = $data_value;
$modules[$row['name']][$row['name_agent'].'-'.$data_key.'-'.$data_value] = $row;
}
}
}
}

View File

@ -741,7 +741,7 @@ function snmp_browser_print_container(
)
);
$table->data[0][1] .= html_print_label_input_block(
$table->data[0][1] = html_print_label_input_block(
__('Port'),
html_print_input(
[

View File

@ -711,7 +711,9 @@ switch ($tab) {
]
);
echo $result_txt;
if (isset($result_txt) === true) {
echo $result_txt;
}
$table = new stdClass();
$table->width = '100%';

View File

@ -779,7 +779,7 @@ $(document).ready (function () {
});
var filters = '<?php echo json_encode($filters); ?>';
var indexed_descriptions = '<?php echo json_encode($indexed_descriptions); ?>';
var indexed_descriptions = '<?php echo json_encode((isset($indexed_descriptions) === true) ? $indexed_descriptions : ''); ?>';
var processing = '<?php echo $processing; ?>';
table_datatables(filters, indexed_descriptions, processing);

View File

@ -1995,7 +1995,7 @@ $data = html_print_checkbox_switch(
true
);
$in_sec_group .= $data;
$in_sec_group = $data;
$in_sec_group .= '<label class="vert-align-bottom">';
$in_sec_group .= __('Search in secondary groups');
$in_sec_group .= ui_print_help_tip(
@ -2133,6 +2133,10 @@ $in .= '</div>';
$inputs[] = $in;
// User private filter.
if (isset($private_filter_event) === false) {
$private_filter_event = '';
}
$inputs[] = html_print_input_hidden('private_filter_event', $private_filter_event, true);
// Trick view in table.
$inputs[] = '<div class="w100p pdd_t_15px"></div>';
@ -2774,12 +2778,13 @@ try {
$form_id = 'events_form';
$show_hide_filters = '';
if ((int) $_GET['pure'] === 1) {
$show_hide_filters = 'invisible';
if (isset($_GET['pure']) === true) {
if ((int) $_GET['pure'] === 1) {
$show_hide_filters = 'invisible';
}
}
// Print graphs
// Print graphs.
$graph_background = '';
if ($config['style'] === 'pandora') {
$graph_background = ' background-color: #fff;';
@ -3038,6 +3043,14 @@ echo '<div id="load-modal-filter" style="display:none"></div>';
echo '<div id="save-modal-filter" style="display:none"></div>';
$autorefresh_draw = false;
if (isset($_GET['refr']) === false) {
$_GET['refr'] = 0;
}
if (isset($config['refr']) === false) {
$config['refr'] = $_GET['refr'];
}
if ($_GET['refr'] || (bool) ($do_refresh ?? false) === true) {
$autorefresh_draw = true;
}

View File

@ -207,8 +207,10 @@ $output = '<div id="tabs-sound-modal">';
];
$eventsounds = db_get_all_rows_sql('SELECT * FROM tevent_sound WHERE active = 1');
foreach ($eventsounds as $key => $row) {
$sounds[$row['sound']] = $row['name'];
if ($eventsounds !== false) {
foreach ($eventsounds as $key => $row) {
$sounds[$row['sound']] = $row['name'];
}
}
$inputs[] = [

View File

@ -181,6 +181,10 @@ if (is_ajax() === true) {
$id_agent = (int) get_parameter('id_agent', 0);
$id_group = (int) get_parameter('id_group', 0);
if (isset($filter['value']) === false) {
$filter['value'] = '';
}
$params = [
'search' => $filter['value'],
'start' => $start,
@ -275,23 +279,25 @@ if (is_ajax() === true) {
$custom_fields_names = '';
$custom_fields_values = '';
foreach ($field_result as $field) {
$field_name = str_replace(' ', '&nbsp;', io_safe_output($field['name']));
$custom_fields_names .= '<span class="right" style="height: 1.3em !important">'.$field_name.'</span>';
if ($field_result !== false) {
foreach ($field_result as $field) {
$field_name = str_replace(' ', '&nbsp;', io_safe_output($field['name']));
$custom_fields_names .= '<span class="right" style="height: 1.3em !important">'.$field_name.'</span>';
$description = $field['description'];
$password_length = strlen(io_safe_output($field['description']));
$asterisks = '';
$description = $field['description'];
$password_length = strlen(io_safe_output($field['description']));
$asterisks = '';
if ((int) $field['is_password_type'] === 1) {
for ($i = 0; $i < $password_length; $i++) {
$asterisks .= '&#9679;';
if ((int) $field['is_password_type'] === 1) {
for ($i = 0; $i < $password_length; $i++) {
$asterisks .= '&#9679;';
}
$description = $asterisks;
}
$description = $asterisks;
$custom_fields_values .= '<span class="left" style="height: 1.3em !important">'.$description.'</span>';
}
$custom_fields_values .= '<span class="left" style="height: 1.3em !important">'.$description.'</span>';
}
$tmp->description = $agent['comentarios'];
@ -546,6 +552,10 @@ $table->size[2] = '33%';
$table->class = 'filter-table-adv';
$table->data = [];
if (isset($filteringFunction) === false) {
$filteringFunction = '';
}
if ($is_metaconsole === true) {
// Node select.
$nodes = [];
@ -739,7 +749,7 @@ $table->data[1][1] = html_print_label_input_block(
// Date filter. In Metaconsole has not reason for show.
if (is_metaconsole() === false) {
$table->data[1][2] .= html_print_label_input_block(
$table->data[1][2] = html_print_label_input_block(
__('Date').':<br>',
html_print_select_date_range(
'utimestamp',
@ -1388,7 +1398,7 @@ ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript
// Change chevron for node icon.
let toggle = document.querySelectorAll('.toggle-inventory-nodo');
let src = '<?php echo $nodo_image_url; ?>';
let src = '<?php echo (isset($nodo_image_url) === false) ? '' : $nodo_image_url; ?>';
toggle.forEach(img => {
img.parentElement.parentElement.style = 'cursor: pointer; border: 0';

View File

@ -245,6 +245,10 @@ if (empty($messages) === true) {
$data[1] = $dest_user;
} else {
if (isset($message['sender']) === false) {
$message['sender'] = 0;
}
$orig_user = get_user_fullname($message['sender']);
if (!$orig_user) {
$orig_user = $message['sender'];
@ -265,7 +269,7 @@ if (empty($messages) === true) {
$contentSubject = '<strong>'.$contentSubject.'</strong>';
}
$data[2] .= html_print_anchor(
$data[2] = html_print_anchor(
[
'href' => $pathSubject,
'content' => $contentSubject,

View File

@ -670,6 +670,10 @@ $data[0] .= html_print_select(
'width:'.$filter_id_width.';'
);
if (isset($config['user']) === false) {
$config['user'] = false;
}
$user_groups = users_get_groups($config['user'], 'RW');
$data[1] = __('Group');
$data[1] .= html_print_select(

View File

@ -76,6 +76,10 @@ if ($config['pure']) {
$type = get_parameter('moduletype', false);
$page = get_parameter('page', false);
if (isset($moduletype) === false) {
$moduletype = 0;
}
if (empty($page) && $type !== 'networkserver' && $moduletype !== 2) {
// Header.
ui_print_standard_header(

View File

@ -170,6 +170,10 @@ if ($writeDashboards === 1) {
true
);
if (isset($output) === false) {
$output = '<div>';
}
$output .= '</div>';
echo $output;
@ -178,6 +182,10 @@ if ($writeDashboards === 1) {
echo '<div id="modal-update-dashboard" class="invisible"></div>';
}
if (isset($tablePagination) === false) {
$tablePagination = '';
}
html_print_action_buttons(
$input_button,
[