';
@@ -700,11 +866,11 @@ if ($id_downtime > 0) {
$filter_group = (int) get_parameter('filter_group', 0);
- // User AD groups to str for the filter
+ // User AD groups to str for the filter.
$id_groups_str = implode(',', $user_groups_ad);
if (empty($id_groups_str)) {
- // Restrictive filter on error. This will filter all the downtimes
+ // Restrictive filter on error. This will filter all the downtimes.
$id_groups_str = '-1';
}
@@ -752,7 +918,7 @@ if ($id_downtime > 0) {
$agent_ids = extract_column($agents, 'id_agente');
$agent_names = extract_column($agents, 'alias');
- // item[] = ;
+
$agents = array_combine($agent_ids, $agent_names);
if ($agents === false) {
$agents = [];
@@ -763,7 +929,6 @@ if ($id_downtime > 0) {
$disabled_add_button = true;
}
-
echo "
';
- // Start Overview of existing planned downtime
+ // Start Overview of existing planned downtime.
echo '
'.__('Agents planned for this downtime').':
';
- // User the $id_groups_str built before
+ // User the $id_groups_str built before.
$sql = sprintf(
'SELECT ta.nombre, tpda.id,
ta.id_os, ta.id_agente, ta.id_grupo,
@@ -860,13 +1047,18 @@ if ($id_downtime > 0) {
foreach ($downtimes_agents as $downtime_agent) {
$data = [];
- $alias = db_get_value('alias', 'tagente', 'id_agente', $downtime_agent['id_agente']);
+ $alias = db_get_value(
+ 'alias',
+ 'tagente',
+ 'id_agente',
+ $downtime_agent['id_agente']
+ );
$data[0] = $alias;
$data[1] = db_get_sql(
'SELECT nombre
- FROM tgrupo
- WHERE id_grupo = '.$downtime_agent['id_grupo']
+ FROM tgrupo
+ WHERE id_grupo = '.$downtime_agent['id_grupo']
);
$data[2] = ui_print_os_icon($downtime_agent['id_os'], true, true);
@@ -887,7 +1079,9 @@ if ($id_downtime > 0) {
if (!$running) {
$data[5] = '';
- if ($type_downtime != 'disable_agents_alerts' && $type_downtime != 'disable_agents') {
+ if ($type_downtime != 'disable_agents_alerts'
+ && $type_downtime != 'disable_agents'
+ ) {
$data[5] = ''.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete')]).'';
}
diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php
index a9529248b0..961ea1f7d0 100755
--- a/pandora_console/godmode/agentes/planned_downtime.list.php
+++ b/pandora_console/godmode/agentes/planned_downtime.list.php
@@ -50,7 +50,7 @@ if ($migrate_malformed) {
}
}
-// Header
+// Header.
ui_print_page_header(
__('Planned Downtime'),
'images/gm_monitoring.png',
@@ -115,7 +115,7 @@ if ($delete_downtime) {
}
}
-// Filter parameters
+// Filter parameters.
$offset = (int) get_parameter('offset');
$filter_params = [];
@@ -131,7 +131,7 @@ $module_name = $filter_params['module_name'] = (string) (!empty($module_
$filter_params_str = http_build_query($filter_params);
-// Table filter
+// Table filter.
$table_form = new StdClass();
$table_form->class = 'databox filters';
$table_form->width = '100%';
@@ -143,9 +143,9 @@ $table_form->data = [];
$row = [];
-// Search text
+// Search text.
$row[] = __('Search').' '.html_print_input_text('search_text', $search_text, '', 50, 250, true);
-// Dates
+// Dates.
$date_inputs = __('From').' '.html_print_input_text('date_from', $date_from, '', 10, 10, true);
$date_inputs .= ' ';
$date_inputs .= __('To').' '.html_print_input_text('date_to', $date_to, '', 10, 10, true);
@@ -155,20 +155,20 @@ $table_form->data[] = $row;
$row = [];
-// Execution type
+// Execution type.
$execution_type_fields = [
'once' => __('Once'),
'periodically' => __('Periodically'),
];
$row[] = __('Execution type').' '.html_print_select($execution_type_fields, 'execution_type', $execution_type, '', __('Any'), '', true, false, false);
-// Show past downtimes
+// Show past downtimes.
$row[] = __('Show past downtimes').' '.html_print_checkbox('archived', 1, $show_archived, true);
$table_form->data[] = $row;
$row = [];
-// Agent
+// Agent.
$params = [];
$params['show_helptip'] = true;
$params['input_name'] = 'agent_name';
@@ -180,14 +180,14 @@ $params['hidden_input_idagent_value'] = $agent_id;
$agent_input = __('Agent').' '.ui_print_agent_autocomplete_input($params);
$row[] = $agent_input;
-// Module
+// Module.
$row[] = __('Module').' '.html_print_autocomplete_modules('module_name', $module_name, false, true, '', [], true);
$row[] = html_print_submit_button(__('Search'), 'search', false, 'class="sub search"', true);
$table_form->data[] = $row;
-// End of table filter
-// Useful to know if the user has done a form filtering
+// End of table filter.
+// Useful to know if the user has done a form filtering.
$filter_performed = false;
$groups = users_get_groups(false, $access);
@@ -197,7 +197,7 @@ if (!empty($groups)) {
$groups_string = implode(',', array_keys($groups));
$where_values .= " AND id_group IN ($groups_string)";
- // WARNING: add $filter_performed = true; to any future filter
+ // WARNING: add $filter_performed = true; to any future filter.
if (!empty($search_text)) {
$filter_performed = true;
@@ -272,7 +272,7 @@ if (!empty($groups)) {
AND tpda.all_modules = 1))";
}
- // Columns of the table tplanned_downtime
+ // Columns of the table tplanned_downtime.
$columns = [
'id',
'name',
@@ -353,23 +353,23 @@ if (!empty($groups)) {
$downtimes = [];
}
-// No downtimes cause the user has not anyone
+// No downtimes cause the user has not anyone.
if (!$downtimes && !$filter_performed) {
include_once $config['homedir'].'/general/firts_task/planned_downtime.php';
}
-// No downtimes cause the user performed a search
+// No downtimes cause the user performed a search.
else if (!$downtimes) {
- // Filter form
+ // Filter form.
echo "';
- // Info message
+ // Info message.
echo '
'.__('Please note that you have your agent setup to do not add new modules coming from the data XML.').' '.__('That means if you have a local plugin or add manually new modules to the configuration file, you won\'t have it in your agent, unless you first create manually in the interface (with the exact name and type as coming in the XML file).').' '.__('You should use the "normal" mode (non learn) only when you don\'t intend to add more modules to the agent.').ui_print_help_icon('module_definition', true, '', 'images/help.png').'
'.'
'.'
',
+ 'intro' => '
'.__('Please note that you have your agent setup to do not add new modules coming from the data XML.').' '.__('That means if you have a local plugin or add manually new modules to the configuration file, you won\'t have it in your agent, unless you first create manually in the interface (with the exact name and type as coming in the XML file).').' '.__('You should use the "normal" mode (non learn) only when you don\'t intend to add more modules to the agent.').'