Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round
This commit is contained in:
commit
b6aa5fc11e
|
@ -15,7 +15,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -29,8 +29,6 @@
|
|||
|
||||
global $config;
|
||||
|
||||
|
||||
|
||||
check_login();
|
||||
|
||||
$agent_d = check_acl($config['id_user'], 0, 'AD');
|
||||
|
@ -54,23 +52,33 @@ require_once $config['homedir'].'/include/functions_cron.php';
|
|||
// Buttons.
|
||||
$buttons = [
|
||||
'text' => "<a href='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list'>".html_print_image(
|
||||
'images/list.png',
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('List'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
__('Scheduled Downtime'),
|
||||
'images/gm_monitoring.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Tools'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Scheduled Downtime'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
// Recursion group filter.
|
||||
|
@ -813,227 +821,7 @@ if (users_can_manage_group_all('AW') === true || $disabled) {
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table = new StdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
25,
|
||||
40,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
);
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
).'</div>';
|
||||
$table->data[2][0] = __('Description');
|
||||
$table->data[2][1] = html_print_textarea(
|
||||
'description',
|
||||
3,
|
||||
35,
|
||||
$description,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[3][0] = __('Type').ui_print_help_tip(
|
||||
__('Quiet: Modules will not generate events or fire alerts.').'<br>'.__('Disable Agents: Disables the selected agents.').'<br>'.__('Disable Alerts: Disable alerts for the selected agents.'),
|
||||
true
|
||||
);
|
||||
$table->data[3][1] = html_print_select(
|
||||
[
|
||||
'quiet' => __('Quiet'),
|
||||
'disable_agents' => __('Disabled Agents'),
|
||||
'disable_agent_modules' => __('Disable Modules'),
|
||||
'disable_agents_alerts' => __('Disabled only Alerts'),
|
||||
],
|
||||
'type_downtime',
|
||||
$type_downtime,
|
||||
'change_type_downtime()',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
);
|
||||
$table->data[4][0] = __('Execution');
|
||||
$table->data[4][1] = html_print_select(
|
||||
[
|
||||
'once' => __('Once'),
|
||||
'periodically' => __('Periodically'),
|
||||
'cron' => __('Cron from/to'),
|
||||
],
|
||||
'type_execution',
|
||||
$type_execution,
|
||||
'change_type_execution();',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
);
|
||||
|
||||
$days = array_combine(range(1, 31), range(1, 31));
|
||||
$table->data[5][0] = __('Configure the time').' ';
|
||||
;
|
||||
$table->data[5][1] = "
|
||||
<div id='once_time' style='display: none;'>
|
||||
<table>
|
||||
<tr>
|
||||
<td>".__('From:').'</td>
|
||||
<td>'.html_print_input_text('once_date_from', $once_date_from, '', 10, 10, true, $disabled_in_execution).html_print_input_text('once_time_from', $once_time_from, '', 9, 9, true, $disabled_in_execution).'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.__('To:').'</td>
|
||||
<td>'.html_print_input_text('once_date_to', $once_date_to, '', 10, 10, true).html_print_input_text('once_time_to', $once_time_to, '', 9, 9, true)."</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id='periodically_time' style='display: none;'>
|
||||
<table>
|
||||
<tr><td>".ui_get_using_system_timezone_warning().'</td></tr>
|
||||
<tr>
|
||||
<td>'.__('Type Periodicity:').' '.html_print_select(
|
||||
[
|
||||
'weekly' => __('Weekly'),
|
||||
'monthly' => __('Monthly'),
|
||||
],
|
||||
'type_periodicity',
|
||||
$type_periodicity,
|
||||
'change_type_periodicity();',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
)."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<table id='weekly_item' style='display: none;'>
|
||||
<tr>
|
||||
<td>".__('Mon').html_print_checkbox('monday', 1, $monday, true, $disabled_in_execution).'</td>
|
||||
<td>'.__('Tue').html_print_checkbox('tuesday', 1, $tuesday, true, $disabled_in_execution).'</td>
|
||||
<td>'.__('Wed').html_print_checkbox('wednesday', 1, $wednesday, true, $disabled_in_execution).'</td>
|
||||
<td>'.__('Thu').html_print_checkbox('thursday', 1, $thursday, true, $disabled_in_execution).'</td>
|
||||
<td>'.__('Fri').html_print_checkbox('friday', 1, $friday, true, $disabled_in_execution).'</td>
|
||||
<td>'.__('Sat').html_print_checkbox('saturday', 1, $saturday, true, $disabled_in_execution).'</td>
|
||||
<td>'.__('Sun').html_print_checkbox('sunday', 1, $sunday, true, $disabled_in_execution)."</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id='monthly_item' style='display: none;'>
|
||||
<tr>
|
||||
<td>".__('From day:').'</td>
|
||||
<td>'.html_print_select(
|
||||
$days,
|
||||
'periodically_day_from',
|
||||
$periodically_day_from,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
).'</td>
|
||||
<td>'.__('To day:').'</td>
|
||||
<td>'.html_print_select(
|
||||
$days,
|
||||
'periodically_day_to',
|
||||
$periodically_day_to,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
).'</td>
|
||||
<td>'.ui_print_help_tip(__('The end day must be higher than the start day'), true).'</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
<td>'.__('From hour:').'</td>
|
||||
<td>'.html_print_input_text(
|
||||
'periodically_time_from',
|
||||
$periodically_time_from,
|
||||
'',
|
||||
7,
|
||||
7,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
).ui_print_help_tip(
|
||||
__('The end time must be higher than the start time'),
|
||||
true
|
||||
).'</td>
|
||||
<td>'.__('To hour:').'</td>
|
||||
<td>'.html_print_input_text(
|
||||
'periodically_time_to',
|
||||
$periodically_time_to,
|
||||
'',
|
||||
7,
|
||||
7,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
).ui_print_help_tip(
|
||||
__('The end time must be higher than the start time'),
|
||||
true
|
||||
).'</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="cron_time" style="display: none;">
|
||||
<table class="w100p">
|
||||
<tr>
|
||||
<td>'.__('Cron from:').'</td>
|
||||
<td>'.html_print_extended_select_for_cron($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, false, false, true, 'from').'</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>'.__('Cron to:').'</td>
|
||||
<td>'.html_print_extended_select_for_cron($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, false, true, true, 'to').'</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>';
|
||||
|
||||
if ($id_downtime > 0) {
|
||||
echo "<form method=post action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
|
||||
} else {
|
||||
echo '<form method="POST" action="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor">';
|
||||
}
|
||||
|
||||
// Editor form.
|
||||
html_print_table($table);
|
||||
|
||||
echo "<td valign=top style='width:300px;padding-left:20px;'>";
|
||||
|
||||
$filter_group = (int) get_parameter('filter_group', 0);
|
||||
|
||||
|
@ -1074,105 +862,467 @@ if (empty($agents) || $disabled_in_execution) {
|
|||
$disabled_add_button = true;
|
||||
}
|
||||
|
||||
// Show available agents to include into downtime
|
||||
|
||||
$table = new StdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->id = 'principal_table_scheduled';
|
||||
$table->width = '100%';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
$table->size[0] = '25%';
|
||||
|
||||
$table->data[0][0] = __('Group filter');
|
||||
$table->data[0][1] = html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
$return_all_group,
|
||||
'filter_group',
|
||||
$filter_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'min-width:180px;margin-right:15px;'
|
||||
);
|
||||
$table->data[0][2] = __('Recursion').'  '.html_print_checkbox('recursion', 1, $recursion, true, false, '');
|
||||
|
||||
$table->data[1][0] = __('Available agents');
|
||||
$table->data[1][1] = html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, true, true, true, '', false, 'min-width: 250px;width: 70%;');
|
||||
|
||||
|
||||
$table->rowid[2] = 'available_modules_selection_mode';
|
||||
|
||||
$table->data[2][1] = html_print_select(
|
||||
$table->data['first_title'][] = html_print_div(
|
||||
[
|
||||
'common' => __('Show common modules'),
|
||||
'all' => __('Show all modules'),
|
||||
'class' => 'section_table_title',
|
||||
'content' => __('Editor'),
|
||||
],
|
||||
'modules_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'min-width:180px;'
|
||||
true
|
||||
);
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
25,
|
||||
40,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowid[3] = 'available_modules';
|
||||
$table->data[3][0] = __('Available modules:').ui_print_help_tip(
|
||||
__('Only for type Quiet for downtimes.'),
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Description'),
|
||||
html_print_textarea(
|
||||
'description',
|
||||
3,
|
||||
35,
|
||||
$description,
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
[
|
||||
'quiet' => __('Quiet'),
|
||||
'disable_agents' => __('Disabled Agents'),
|
||||
'disable_agent_modules' => __('Disable Modules'),
|
||||
'disable_agents_alerts' => __('Disabled only Alerts'),
|
||||
],
|
||||
'type_downtime',
|
||||
$type_downtime,
|
||||
'change_type_downtime()',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
).ui_print_input_placeholder(
|
||||
__('Quiet: Modules will not generate events or fire alerts.').'<br>'.__('Disable Agents: Disables the selected agents.').'<br>'.__('Disable Alerts: Disable alerts for the selected agents.'),
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][] = html_print_label_input_block(
|
||||
__('Execution'),
|
||||
html_print_select(
|
||||
[
|
||||
'once' => __('Once'),
|
||||
'periodically' => __('Periodically'),
|
||||
'cron' => __('Cron from/to'),
|
||||
],
|
||||
'type_execution',
|
||||
$type_execution,
|
||||
'change_type_execution();',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
)
|
||||
);
|
||||
|
||||
$timeInputs = [];
|
||||
|
||||
$timeInputs[] = html_print_div(
|
||||
[
|
||||
'id' => 'once_time',
|
||||
'style' => 'display: none',
|
||||
'content' => html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_input_text(
|
||||
'once_date_from',
|
||||
$once_date_from,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
).html_print_input_text(
|
||||
'once_time_from',
|
||||
$once_time_from,
|
||||
'',
|
||||
9,
|
||||
9,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
).'<span class="margin-lr-10 result_info_text">'.__(
|
||||
'To'
|
||||
).'</span>'.html_print_input_text(
|
||||
'once_date_to',
|
||||
$once_date_to,
|
||||
'',
|
||||
10,
|
||||
10,
|
||||
true
|
||||
).html_print_input_text(
|
||||
'once_time_to',
|
||||
$once_time_to,
|
||||
'',
|
||||
9,
|
||||
9,
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[3][1] = html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'min-width: 250px;width: 70%;'
|
||||
$timeInputs[] = html_print_div(
|
||||
[
|
||||
'id' => 'periodically_time',
|
||||
'style' => 'display: none',
|
||||
'content' => html_print_div(
|
||||
[
|
||||
'class' => 'filter-table-adv-manual w50p',
|
||||
'content' => html_print_label_input_block(
|
||||
__('Type Periodicity'),
|
||||
html_print_select(
|
||||
[
|
||||
'weekly' => __('Weekly'),
|
||||
'monthly' => __('Monthly'),
|
||||
],
|
||||
'type_periodicity',
|
||||
$type_periodicity,
|
||||
'change_type_periodicity();',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
)
|
||||
),
|
||||
],
|
||||
true
|
||||
).html_print_div(
|
||||
[
|
||||
'id' => 'weekly_item',
|
||||
'class' => '',
|
||||
'content' => '<ul class="flex-row-center mrgn_top_15px mrgn_btn_15px">
|
||||
<li class="flex">'.__('Mon').html_print_checkbox('monday', 1, $monday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
|
||||
<li class="flex">'.__('Tue').html_print_checkbox('tuesday', 1, $tuesday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
|
||||
<li class="flex">'.__('Wed').html_print_checkbox('wednesday', 1, $wednesday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
|
||||
<li class="flex">'.__('Thu').html_print_checkbox('thursday', 1, $thursday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
|
||||
<li class="flex">'.__('Fri').html_print_checkbox('friday', 1, $friday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
|
||||
<li class="flex">'.__('Sat').html_print_checkbox('saturday', 1, $saturday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
|
||||
<li class="flex">'.__('Sun').html_print_checkbox('sunday', 1, $sunday, true, $disabled_in_execution, '', false, ['label_style' => 'margin: 0 5px;' ]).'</li>
|
||||
</ul>',
|
||||
],
|
||||
true
|
||||
).html_print_div(
|
||||
[
|
||||
'id' => 'monthly_item',
|
||||
'style' => 'margin-top: 12px;',
|
||||
'class' => 'filter-table-adv-manual flex-row-start w50p',
|
||||
'content' => html_print_label_input_block(
|
||||
__('From day'),
|
||||
html_print_select(
|
||||
$days,
|
||||
'periodically_day_from',
|
||||
$periodically_day_from,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
),
|
||||
[ 'div_style' => 'flex: 50; margin-right: 5px;' ]
|
||||
).html_print_label_input_block(
|
||||
__('To day'),
|
||||
html_print_select(
|
||||
$days,
|
||||
'periodically_day_to',
|
||||
$periodically_day_to,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
$disabled_in_execution
|
||||
).ui_print_input_placeholder(
|
||||
__('The end day must be higher than the start day'),
|
||||
true
|
||||
),
|
||||
[ 'div_style' => 'flex: 50; margin-left: 5px;' ]
|
||||
),
|
||||
],
|
||||
true
|
||||
).html_print_div(
|
||||
[
|
||||
'class' => 'filter-table-adv-manual flex-row-start w50p',
|
||||
'content' => html_print_label_input_block(
|
||||
__('From hour'),
|
||||
html_print_input_text(
|
||||
'periodically_time_from',
|
||||
$periodically_time_from,
|
||||
'',
|
||||
7,
|
||||
7,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
).ui_print_input_placeholder(
|
||||
__('The start time must be lower than the end time'),
|
||||
true
|
||||
),
|
||||
[ 'div_style' => 'flex: 50; margin-right: 5px;' ]
|
||||
).html_print_label_input_block(
|
||||
__('To hour'),
|
||||
html_print_input_text(
|
||||
'periodically_time_to',
|
||||
$periodically_time_to,
|
||||
'',
|
||||
7,
|
||||
7,
|
||||
true,
|
||||
$disabled_in_execution
|
||||
).ui_print_input_placeholder(
|
||||
__('The end time must be higher than the start time'),
|
||||
true
|
||||
),
|
||||
[ 'div_style' => 'flex: 50; margin-left: 5px;' ]
|
||||
),
|
||||
],
|
||||
true
|
||||
).ui_get_using_system_timezone_warning(),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$timeInputs[] = html_print_div(
|
||||
[
|
||||
'id' => 'cron_time',
|
||||
'style' => 'display: none',
|
||||
'content' => html_print_label_input_block(
|
||||
__('Cron from'),
|
||||
html_print_extended_select_for_cron($hour_from, $minute_from, $mday_from, $month_from, $wday_from, true, false, false, true, 'from')
|
||||
).html_print_label_input_block(
|
||||
__('Cron to'),
|
||||
html_print_extended_select_for_cron($hour_to, $minute_to, $mday_to, $month_to, $wday_to, true, false, true, true, 'to')
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->colspan[3][0] = 2;
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Configure the time'),
|
||||
implode('', $timeInputs)
|
||||
);
|
||||
|
||||
$table->data[4][] = html_print_div(
|
||||
[
|
||||
'class' => 'section_table_title',
|
||||
'content' => __('Filtering'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[5][] = html_print_label_input_block(
|
||||
__('Group filter'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
$return_all_group,
|
||||
'filter_group',
|
||||
$filter_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'min-width:180px;margin-right:15px;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[5][] = html_print_label_input_block(
|
||||
__('Recursion'),
|
||||
html_print_checkbox_switch(
|
||||
'recursion',
|
||||
1,
|
||||
$recursion,
|
||||
true,
|
||||
false,
|
||||
''
|
||||
)
|
||||
);
|
||||
|
||||
$table->colspan[6][0] = 2;
|
||||
$availableModules = html_print_label_input_block(
|
||||
__('Available agents'),
|
||||
html_print_select(
|
||||
$agents,
|
||||
'id_agents[]',
|
||||
-1,
|
||||
'',
|
||||
__('Any'),
|
||||
-2,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'min-width: 250px;width: 70%;'
|
||||
),
|
||||
[
|
||||
'div_class' => 'flex-column',
|
||||
'div_style' => 'flex: 33',
|
||||
]
|
||||
);
|
||||
|
||||
$availableModules .= html_print_label_input_block(
|
||||
__('Selection mode'),
|
||||
html_print_select(
|
||||
[
|
||||
'common' => __('Show common modules'),
|
||||
'all' => __('Show all modules'),
|
||||
],
|
||||
'modules_selection_mode',
|
||||
'common',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'min-width:180px;'
|
||||
),
|
||||
[
|
||||
'div_class' => 'available_modules_selection_mode flex-column',
|
||||
'div_style' => 'flex: 33',
|
||||
]
|
||||
);
|
||||
|
||||
$availableModules .= html_print_label_input_block(
|
||||
__('Available modules'),
|
||||
html_print_select(
|
||||
[],
|
||||
'module[]',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'min-width: 250px;width: 70%;'
|
||||
).ui_print_input_placeholder(
|
||||
__('Only for type Quiet for downtimes.'),
|
||||
true
|
||||
),
|
||||
[
|
||||
'div_class' => 'available_modules flex-column',
|
||||
'div_style' => 'flex: 33',
|
||||
]
|
||||
);
|
||||
|
||||
$table->data[6][0] = html_print_div(
|
||||
[
|
||||
'style' => 'flex-direction: row;align-items: flex-start;',
|
||||
'content' => $availableModules,
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Print agent table.
|
||||
if ($id_downtime > 0) {
|
||||
echo "<form method=post action='index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&insert_downtime_agent=1&id_downtime=$id_downtime'>";
|
||||
} else {
|
||||
echo '<form method="POST" action="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor">';
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
echo '<br /><br /><br />';
|
||||
|
||||
$buttons = '';
|
||||
html_print_input_hidden('id_agent', $id_agent);
|
||||
echo '<div class="action-buttons w100p" >';
|
||||
|
||||
if ($id_downtime > 0) {
|
||||
html_print_input_hidden('update_downtime', 1);
|
||||
html_print_input_hidden('id_downtime', $id_downtime);
|
||||
html_print_submit_button(
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Update'),
|
||||
'updbutton',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
['icon' => 'update'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
html_print_input_hidden('create_downtime', 1);
|
||||
html_print_submit_button(
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Add'),
|
||||
'crtbutton',
|
||||
false,
|
||||
'class="sub wand"'
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
html_print_action_buttons(
|
||||
$buttons
|
||||
);
|
||||
|
||||
html_print_input_hidden('all_common_modules', '');
|
||||
echo '</form>';
|
||||
|
||||
|
@ -1208,11 +1358,17 @@ if (empty($downtimes_agents)) {
|
|||
$table->head[2] = __('OS');
|
||||
$table->head[3] = __('Last contact');
|
||||
$table->head['count_modules'] = __('Modules');
|
||||
$table->align = [];
|
||||
$table->align[0] = 'center';
|
||||
$table->align[1] = 'center';
|
||||
$table->align[2] = 'center';
|
||||
$table->align[3] = 'center';
|
||||
$table->align[4] = 'center';
|
||||
|
||||
if (!$running) {
|
||||
$table->head[5] = __('Actions');
|
||||
$table->align[5] = 'center';
|
||||
$table->size[5] = '5%';
|
||||
$table->align[5] = 'right';
|
||||
$table->size[5] = '10%';
|
||||
}
|
||||
|
||||
foreach ($downtimes_agents as $downtime_agent) {
|
||||
|
@ -1232,7 +1388,13 @@ if (empty($downtimes_agents)) {
|
|||
WHERE id_grupo = '.$downtime_agent['id_grupo']
|
||||
);
|
||||
|
||||
$data[2] = ui_print_os_icon($downtime_agent['id_os'], true, true);
|
||||
$data[2] = html_print_div(
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'content' => ui_print_os_icon($downtime_agent['id_os'], false, true),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$data[3] = $downtime_agent['ultimo_contacto'];
|
||||
|
||||
|
@ -1251,10 +1413,10 @@ if (empty($downtimes_agents)) {
|
|||
if (!$running) {
|
||||
$data[5] = '';
|
||||
if ($type_downtime !== 'disable_agents') {
|
||||
$data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image('images/config.png', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter']).'</a>';
|
||||
$data[5] = '<a href="javascript:show_editor_module('.$downtime_agent['id_agente'].');">'.html_print_image('images/edit.svg', true, ['alt' => __('Edit'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
}
|
||||
|
||||
$data[5] .= '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/cross.png', true, ['border' => '0', 'alt' => __('Delete'), 'class' => 'invert_filter']).'</a>';
|
||||
$data[5] .= '<a href="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor&id_agent='.$downtime_agent['id_agente'].'&delete_downtime_agent=1&id_downtime_agent='.$downtime_agent['id'].'&id_downtime='.$id_downtime.'">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
}
|
||||
|
||||
$table->data['agent_'.$downtime_agent['id_agente']] = $data;
|
||||
|
@ -1263,17 +1425,7 @@ if (empty($downtimes_agents)) {
|
|||
html_print_table($table);
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'loading';
|
||||
$table->width = '100%';
|
||||
$table->colspan['loading'][0] = '6';
|
||||
$table->style[0] = 'text-align: center;';
|
||||
$table->data = [];
|
||||
$table->data['loading'] = [];
|
||||
$table->data['loading'][0] = html_print_image('images/spinner.gif', true);
|
||||
echo "<div class='invisible'>";
|
||||
html_print_table($table);
|
||||
echo '</div>';
|
||||
ui_print_spinner('Loading');
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'editor';
|
||||
|
@ -1577,13 +1729,13 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
|
|||
switch ($("#type_downtime").val()) {
|
||||
case 'disable_agents_alerts':
|
||||
case 'disable_agents':
|
||||
$("#available_modules").hide();
|
||||
$("#available_modules_selection_mode").hide();
|
||||
$(".available_modules").hide();
|
||||
$(".available_modules_selection_mode").hide();
|
||||
break;
|
||||
case 'quiet':
|
||||
case 'disable_agent_modules':
|
||||
$("#available_modules_selection_mode").show();
|
||||
$("#available_modules").show();
|
||||
$(".available_modules_selection_mode").show();
|
||||
$(".available_modules").show();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -89,7 +89,7 @@ if (is_ajax() === true) {
|
|||
[
|
||||
'id' => 'agent_modules_affected_planned_downtime',
|
||||
'class' => 'info_table',
|
||||
'style' => 'width: 100%',
|
||||
'style' => 'width: 99%',
|
||||
'columns' => $columns,
|
||||
'column_names' => $column_names,
|
||||
'ajax_url' => 'godmode/agentes/planned_downtime.list',
|
||||
|
@ -103,6 +103,7 @@ if (is_ajax() === true) {
|
|||
],
|
||||
'search_button_class' => 'sub filter float-right',
|
||||
'form' => [
|
||||
'class' => 'filter-table-adv',
|
||||
'inputs' => [
|
||||
[
|
||||
'label' => __('Agents'),
|
||||
|
@ -207,13 +208,23 @@ if ($migrate_malformed === true) {
|
|||
}
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
__('Scheduled Downtime'),
|
||||
'images/gm_monitoring.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
''
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Tools'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Scheduled Downtime'),
|
||||
],
|
||||
],
|
||||
);
|
||||
|
||||
$id_downtime = (int) get_parameter('id_downtime', 0);
|
||||
|
@ -308,34 +319,8 @@ $filter_params['module_name'] = $module_name;
|
|||
|
||||
$filter_params_str = http_build_query($filter_params);
|
||||
|
||||
// Table filter.
|
||||
$table_form = new StdClass();
|
||||
$table_form->class = 'databox filters';
|
||||
$table_form->width = '100%';
|
||||
$table_form->rowstyle = [];
|
||||
$table_form->cellstyle[0] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1][2] = 'display: flex; align-items: center;';
|
||||
$table_form->cellstyle[2] = ['width: 100px;'];
|
||||
$table_form->cellstyle[3] = ['text-align: right;'];
|
||||
$table_form->colspan[3][0] = 3;
|
||||
$table_form->data = [];
|
||||
|
||||
$row = [];
|
||||
|
||||
// Search text.
|
||||
$row[] = __('Search');
|
||||
|
||||
$row[] = html_print_input_text(
|
||||
'search_text',
|
||||
$search_text,
|
||||
'',
|
||||
50,
|
||||
250,
|
||||
true
|
||||
);
|
||||
// Dates.
|
||||
$date_inputs = __('From').' '.html_print_input_text(
|
||||
// From/To inputs.
|
||||
$date_inputs = html_print_input_text(
|
||||
'date_from',
|
||||
$date_from,
|
||||
'',
|
||||
|
@ -343,8 +328,8 @@ $date_inputs = __('From').' '.html_print_input_text(
|
|||
10,
|
||||
true
|
||||
);
|
||||
$date_inputs .= ' ';
|
||||
$date_inputs .= __('To').' '.html_print_input_text(
|
||||
$date_inputs .= ' '.__('To').' ';
|
||||
$date_inputs .= html_print_input_text(
|
||||
'date_to',
|
||||
$date_to,
|
||||
'',
|
||||
|
@ -352,11 +337,6 @@ $date_inputs .= __('To').' '.html_print_input_text(
|
|||
10,
|
||||
true
|
||||
);
|
||||
$row[] = $date_inputs;
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
|
||||
// Execution type.
|
||||
$execution_type_fields = [
|
||||
|
@ -364,29 +344,6 @@ $execution_type_fields = [
|
|||
'periodically' => __('Periodically'),
|
||||
'cron' => __('Cron'),
|
||||
];
|
||||
$row[] = __('Execution type');
|
||||
$row[] = html_print_select(
|
||||
$execution_type_fields,
|
||||
'execution_type',
|
||||
$execution_type,
|
||||
'',
|
||||
__('Any'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
// Show past downtimes.
|
||||
$row[] = __('Show past downtimes').' '.html_print_switch(
|
||||
[
|
||||
'name' => 'archived',
|
||||
'value' => $show_archived,
|
||||
]
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
|
||||
// Agent.
|
||||
$params = [];
|
||||
|
@ -397,36 +354,89 @@ $params['return'] = true;
|
|||
$params['print_hidden_input_idagent'] = true;
|
||||
$params['hidden_input_idagent_name'] = 'agent_id';
|
||||
$params['hidden_input_idagent_value'] = $agent_id;
|
||||
$row[] = __('Agent');
|
||||
$row[] = ui_print_agent_autocomplete_input($params);
|
||||
|
||||
// Module.
|
||||
$row[] = __('Module').' '.html_print_autocomplete_modules(
|
||||
'module_name',
|
||||
$module_name,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
[],
|
||||
true
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
|
||||
$row = [];
|
||||
|
||||
$row[] = html_print_submit_button(
|
||||
// Table filter.
|
||||
$table_form = new stdClass();
|
||||
$table_form->class = 'filter-table-adv';
|
||||
$table_form->id = 'filter_scheduled_downtime';
|
||||
$table_form->width = '100%';
|
||||
$table_form->rowstyle = [];
|
||||
$table_form->cellstyle[0] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1] = ['width: 100px;'];
|
||||
$table_form->cellstyle[1][2] = 'display: flex; align-items: center;';
|
||||
$table_form->cellstyle[2] = ['width: 100px;'];
|
||||
$table_form->cellstyle[3] = ['text-align: right;'];
|
||||
$table_form->data = [];
|
||||
// Search text.
|
||||
$table_form->data[0][] = html_print_label_input_block(
|
||||
__('Search'),
|
||||
'search',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
html_print_input_text(
|
||||
'search_text',
|
||||
$search_text,
|
||||
'',
|
||||
50,
|
||||
250,
|
||||
true
|
||||
)
|
||||
);
|
||||
// From / To.
|
||||
$table_form->data[0][] = html_print_label_input_block(
|
||||
__('Between dates'),
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'flex-content-left',
|
||||
'content' => $date_inputs,
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
// Show past downtimes.
|
||||
$table_form->data[0][] = html_print_label_input_block(
|
||||
__('Show past downtimes'),
|
||||
html_print_switch(
|
||||
[
|
||||
'name' => 'archived',
|
||||
'value' => $show_archived,
|
||||
]
|
||||
)
|
||||
);
|
||||
// Execution type.
|
||||
$table_form->data[1][] = html_print_label_input_block(
|
||||
__('Execution type'),
|
||||
html_print_select(
|
||||
$execution_type_fields,
|
||||
'execution_type',
|
||||
$execution_type,
|
||||
'',
|
||||
__('Any'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
$table_form->data[1][] = html_print_label_input_block(
|
||||
__('Agent'),
|
||||
ui_print_agent_autocomplete_input($params)
|
||||
);
|
||||
|
||||
$table_form->data[1][] = html_print_label_input_block(
|
||||
__('Module'),
|
||||
html_print_autocomplete_modules(
|
||||
'module_name',
|
||||
$module_name,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
[],
|
||||
true,
|
||||
0,
|
||||
30,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table_form->data[] = $row;
|
||||
// End of table filter.
|
||||
// Useful to know if the user has done a form filtering.
|
||||
$filter_performed = false;
|
||||
|
@ -629,41 +639,86 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
// No downtimes cause the user performed a search.
|
||||
// Filter form.
|
||||
echo '<form method="post" action="'.$url_list.'">';
|
||||
html_print_table($table_form);
|
||||
$outputTable = html_print_table($table_form, true);
|
||||
$outputTable .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons-right-forced',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'search',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
ui_toggle(
|
||||
$outputTable,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
__('Filters'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
echo '</form>';
|
||||
|
||||
// Info message.
|
||||
echo '<div class="nf">'.__('No scheduled downtime').'</div>';
|
||||
ui_print_info_message(__('No scheduled downtime'));
|
||||
|
||||
// Create button.
|
||||
if ($write_permisson === true) {
|
||||
echo '<form method="post" class="display_in" action="'.$url_editor.'">';
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Create'),
|
||||
'create',
|
||||
false,
|
||||
['icon' => 'next'],
|
||||
true
|
||||
),
|
||||
]
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'create',
|
||||
false,
|
||||
['icon' => 'next'],
|
||||
true
|
||||
)
|
||||
);
|
||||
echo '</form>';
|
||||
}
|
||||
} else {
|
||||
// Has downtimes.
|
||||
echo '<form method="post" action="'.$url_list.'">';
|
||||
html_print_table($table_form);
|
||||
$outputTable = html_print_table($table_form, true);
|
||||
$outputTable .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons-right-forced',
|
||||
'content' => html_print_submit_button(
|
||||
__('Search'),
|
||||
'search',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
ui_toggle(
|
||||
$outputTable,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
__('Filters'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
echo '</form>';
|
||||
|
||||
ui_pagination(
|
||||
$downtimes_number,
|
||||
$url_list.'&'.$filter_params_str,
|
||||
$offset
|
||||
);
|
||||
|
||||
// User groups with AR, AD or AW permission.
|
||||
$groupsAD = users_get_groups($config['id_user'], $access);
|
||||
$groupsAD = array_keys($groupsAD);
|
||||
|
@ -762,17 +817,17 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
$settings = [
|
||||
'url' => ui_get_full_url('ajax.php', false, false, false),
|
||||
'loadingText' => __('Loading, this operation might take several minutes...'),
|
||||
'title' => __('Agents / Modules affected'),
|
||||
'title' => __('Elements affected'),
|
||||
'id' => $downtime['id'],
|
||||
];
|
||||
|
||||
$data['agents_modules'] = '<a href="#" onclick=\'dialogAgentModulesAffected('.json_encode($settings).')\'>';
|
||||
$data['agents_modules'] .= html_print_image(
|
||||
'images/search_big.png',
|
||||
'images/details.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Agents and modules affected'),
|
||||
'style' => 'width:22px; height: 22px;',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data['agents_modules'] .= '</a>';
|
||||
|
@ -789,15 +844,21 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
$url_list_params = $url_list.'&stop_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str;
|
||||
$data['stop'] = '<a href="'.$url_list_params.'">';
|
||||
$data['stop'] .= html_print_image(
|
||||
'images/cancel.png',
|
||||
'images/fail@svg.svg',
|
||||
true,
|
||||
['title' => __('Stop downtime')]
|
||||
[
|
||||
'title' => __('Stop downtime'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$data['stop'] = html_print_image(
|
||||
'images/cancel.png',
|
||||
'images/fail@svg.svg',
|
||||
true,
|
||||
['title' => __('Stop downtime')]
|
||||
[
|
||||
'title' => __('Stop downtime'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -812,11 +873,11 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
// Copy.
|
||||
$data['copy'] = '<a href="'.$url_editor.'&downtime_copy=1&id_downtime='.$downtime['id'].'">';
|
||||
$data['copy'] .= html_print_image(
|
||||
'images/copy.png',
|
||||
'images/copy.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Copy'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data['copy'] .= '</a>';
|
||||
|
@ -824,11 +885,11 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
// Edit.
|
||||
$data['edit'] = '<a href="'.$url_editor.'&edit_downtime=1&id_downtime='.$downtime['id'].'">';
|
||||
$data['edit'] .= html_print_image(
|
||||
'images/config.png',
|
||||
'images/configuration@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Update'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data['edit'] .= '</a>';
|
||||
|
@ -837,11 +898,11 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
$url_delete = $url_list.'&delete_downtime=1&id_downtime='.$downtime['id'].'&'.$filter_params_str;
|
||||
$data['delete'] = '<a id="delete_downtime" href="'.$url_delete.'">';
|
||||
$data['delete'] .= html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data['delete'] .= '</a>';
|
||||
|
@ -858,22 +919,22 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
// Copy.
|
||||
$data['copy'] = '<a href="'.$url_editor.'&downtime_copy=1&id_downtime='.$downtime['id'].'">';
|
||||
$data['copy'] .= html_print_image(
|
||||
'images/copy.png',
|
||||
'images/copy.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Copy'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data['copy'] .= '</a>';
|
||||
// Edit.
|
||||
$data['edit'] = '<a href="'.$url_editor.'&edit_downtime=1&id_downtime='.$downtime['id'].'">';
|
||||
$data['edit'] .= html_print_image(
|
||||
'images/config.png',
|
||||
'images/configuration@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Update'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data['edit'] .= '</a>';
|
||||
|
@ -910,44 +971,47 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
}
|
||||
|
||||
html_print_table($table);
|
||||
ui_pagination(
|
||||
$tablePagination = ui_pagination(
|
||||
$downtimes_number,
|
||||
$url_list.'&'.$filter_params_str,
|
||||
$offset,
|
||||
0,
|
||||
false,
|
||||
'offset',
|
||||
true,
|
||||
'pagination-bottom'
|
||||
'offset',
|
||||
false
|
||||
);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
||||
// CSV export button.
|
||||
echo '<div class="display_in">';
|
||||
html_print_button(
|
||||
__('Export to CSV'),
|
||||
'csv_export',
|
||||
false,
|
||||
'blockResubmit($(this)); location.href=\'godmode/agentes/planned_downtime.export_csv.php?'.$filter_params_str.'\'',
|
||||
'class="sub next"'
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
$actionsButtons = '';
|
||||
// Create button.
|
||||
if ($write_permisson === true) {
|
||||
echo ' ';
|
||||
echo '<form method="post" action="'.$url_editor.'" class="display_in" >';
|
||||
html_print_submit_button(
|
||||
$actionsButtons .= '<form method="post" action="'.$url_editor.'" class="display_in" >';
|
||||
$actionsButtons .= html_print_submit_button(
|
||||
__('Create'),
|
||||
'create',
|
||||
false,
|
||||
'class="sub next"'
|
||||
['icon' => 'next'],
|
||||
true
|
||||
);
|
||||
echo '</form>';
|
||||
$actionsButtons .= '</form>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
// CSV export button.
|
||||
$actionsButtons .= html_print_button(
|
||||
__('Export to CSV'),
|
||||
'csv_export',
|
||||
false,
|
||||
'blockResubmit($(this)); location.href="godmode/agentes/planned_downtime.export_csv.php?'.$filter_params_str.'"',
|
||||
[
|
||||
'icon' => 'load',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
$actionsButtons,
|
||||
[ 'right_content' => $tablePagination ]
|
||||
);
|
||||
}
|
||||
|
||||
ui_require_jquery_file(
|
||||
|
|
|
@ -135,18 +135,15 @@ if ($load_filter_modal) {
|
|||
$table->width = '100%';
|
||||
$table->cellspacing = 4;
|
||||
$table->cellpadding = 4;
|
||||
$table->class = 'databox';
|
||||
$table->class = 'databox no_border';
|
||||
if (is_metaconsole()) {
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters no_border';
|
||||
}
|
||||
|
||||
$table->styleTable = 'font-weight: bold; color: #555; text-align:left;';
|
||||
$filter_id_width = '200px';
|
||||
if (is_metaconsole()) {
|
||||
$filter_id_width = '150px';
|
||||
}
|
||||
$filter_id_width = 'w100p';
|
||||
|
||||
$data = [];
|
||||
$table->rowid[3] = 'update_filter_row1';
|
||||
|
@ -165,11 +162,17 @@ if ($load_filter_modal) {
|
|||
false,
|
||||
'margin-left:5px; width:'.$filter_id_width.';'
|
||||
);
|
||||
|
||||
$table->rowclass[] = 'display-grid';
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Load filter'),
|
||||
'load_filter',
|
||||
false,
|
||||
'class="sub upd" onclick="load_filter_values()"',
|
||||
[
|
||||
'class' => 'mini w25p',
|
||||
'style' => 'margin-left: 73%',
|
||||
'onclick' => 'load_filter_values();',
|
||||
],
|
||||
true
|
||||
);
|
||||
$data[1] .= html_print_input_hidden('load_filter', 1, true);
|
||||
|
@ -186,7 +189,7 @@ function show_filter() {
|
|||
draggable: true,
|
||||
modal: false,
|
||||
closeOnEscape: true,
|
||||
width: 450
|
||||
width: 500
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -238,7 +241,7 @@ $(document).ready (function() {
|
|||
|
||||
|
||||
if ($save_filter_modal) {
|
||||
echo '<div id="save-filter-select" style="width:350px;">';
|
||||
echo '<div id="save-filter-select" style="width:600px;">';
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'EW') === 1 || check_acl($config['id_user'], 0, 'EM') === 1) {
|
||||
echo '<div id="info_box"></div>';
|
||||
|
@ -247,9 +250,9 @@ if ($save_filter_modal) {
|
|||
$table->width = '100%';
|
||||
$table->cellspacing = 4;
|
||||
$table->cellpadding = 4;
|
||||
$table->class = 'databox';
|
||||
$table->class = 'databox no_border';
|
||||
if (is_metaconsole()) {
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters no_border';
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
}
|
||||
|
@ -289,7 +292,11 @@ if ($save_filter_modal) {
|
|||
__('Save filter'),
|
||||
'save_filter',
|
||||
false,
|
||||
'class="sub wand" onclick="save_new_filter();"',
|
||||
[
|
||||
'class' => 'mini w25p',
|
||||
'style' => 'margin-left: 56%',
|
||||
'onclick' => 'save_new_filter();',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -317,11 +324,16 @@ if ($save_filter_modal) {
|
|||
0,
|
||||
true
|
||||
);
|
||||
$table->rowclass[] = 'display-grid';
|
||||
$data[1] = html_print_submit_button(
|
||||
__('Update filter'),
|
||||
'update_filter',
|
||||
false,
|
||||
'class="sub upd" onclick="save_update_filter();"',
|
||||
[
|
||||
'class' => 'mini w25p',
|
||||
'style' => 'margin-left: 56%',
|
||||
'onclick' => 'save_update_filter();',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -359,7 +371,8 @@ function show_save_filter() {
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: false,
|
||||
closeOnEscape: true
|
||||
closeOnEscape: true,
|
||||
width: 380
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -437,7 +437,7 @@ class AuditLog extends HTML
|
|||
$('#audit_logs').css('width','95% !important');
|
||||
});
|
||||
|
||||
$('#save-filter').click(function() {
|
||||
$('#button-save-filter').click(function() {
|
||||
if ($('#save-filter-select').length) {
|
||||
$('#save-filter-select').dialog({
|
||||
width: "20%",
|
||||
|
@ -495,7 +495,7 @@ class AuditLog extends HTML
|
|||
});
|
||||
|
||||
/* Filter management */
|
||||
$('#load-filter').click(function (){
|
||||
$('#button-load-filter').click(function (){
|
||||
if($('#load-filter-select').length) {
|
||||
$('#load-filter-select').dialog({width: "20%",
|
||||
maxWidth: "25%",
|
||||
|
|
|
@ -2330,84 +2330,114 @@ function html_print_extended_select_for_cron($hour='*', $minute='*', $mday='*',
|
|||
$adv_mode_name = '_'.$adv_mode_name;
|
||||
}
|
||||
|
||||
$table->data[0][0] = html_print_extended_select_for_downtime_cron(
|
||||
'cron_hour'.$adv_mode_name,
|
||||
$hours,
|
||||
$hour,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [0-23], [0-23]-[0-23], *, or step value (example: */3, 10/5)'
|
||||
$table->data[1][0] = html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_extended_select_for_downtime_cron(
|
||||
'cron_hour'.$adv_mode_name,
|
||||
$hours,
|
||||
$hour,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [0-23], [0-23]-[0-23], *, or step value (example: */3, 10/5)'
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][1] = html_print_extended_select_for_downtime_cron(
|
||||
'cron_minute'.$adv_mode_name,
|
||||
$minutes,
|
||||
$minute,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [0-59], [0-59]-[0-59], *, or step value (example: */5, 10/1)'
|
||||
$table->data[1][1] = html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_extended_select_for_downtime_cron(
|
||||
'cron_minute'.$adv_mode_name,
|
||||
$minutes,
|
||||
$minute,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [0-59], [0-59]-[0-59], *, or step value (example: */5, 10/1)'
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][2] = html_print_extended_select_for_downtime_cron(
|
||||
'cron_mday'.$adv_mode_name,
|
||||
$mdays,
|
||||
$mday,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [1-31], [1-31]-[1-31], *, or step value (example: */5, 7/2)'
|
||||
$table->data[1][2] = html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_extended_select_for_downtime_cron(
|
||||
'cron_mday'.$adv_mode_name,
|
||||
$mdays,
|
||||
$mday,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [1-31], [1-31]-[1-31], *, or step value (example: */5, 7/2)'
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][3] = html_print_extended_select_for_downtime_cron(
|
||||
'cron_month'.$adv_mode_name,
|
||||
$months,
|
||||
$month,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [1-12], [1-12]-[1-12], *, or step value (example: */3, 9/1)'
|
||||
$table->data[1][3] = html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_extended_select_for_downtime_cron(
|
||||
'cron_month'.$adv_mode_name,
|
||||
$months,
|
||||
$month,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [1-12], [1-12]-[1-12], *, or step value (example: */3, 9/1)'
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[1][4] = html_print_extended_select_for_downtime_cron(
|
||||
'cron_wday'.$adv_mode_name,
|
||||
$wdays,
|
||||
$wday,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [0-6], [0-6]-[0-6], *, or step value (example: */2, 3/1)'
|
||||
$table->data[1][4] = html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_extended_select_for_downtime_cron(
|
||||
'cron_wday'.$adv_mode_name,
|
||||
$wdays,
|
||||
$wday,
|
||||
'',
|
||||
__('Any'),
|
||||
'*',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'Valid values: [0-6], [0-6]-[0-6], *, or step value (example: */2, 3/1)'
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -4186,7 +4216,7 @@ function html_print_switch_radio_button(array $switches, array $attributes=[], b
|
|||
* @param string $checked Set the button to be marked (optional, unmarked by default).
|
||||
* @param boolean $disabled Disable the button (optional, button enabled by default).
|
||||
* @param string $script Script to execute when onClick event is triggered (optional).
|
||||
* @param string $attributes Optional HTML attributes. It's a free string which will be inserted into the HTML tag, use it carefully (optional).
|
||||
* @param mixed $attributes Optional HTML attributes. It's a free string which will be inserted into the HTML tag, use it carefully (optional).
|
||||
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
|
||||
* @param string $id Custom id.
|
||||
* @param string $customAttributes Custom Attribute for customized checkbox.
|
||||
|
@ -4217,6 +4247,7 @@ function html_print_checkbox_extended(
|
|||
|
||||
$inputClass = 'custom_checkbox_input';
|
||||
$labelClass = 'custom_checkbox';
|
||||
$labelStyle = ' ';
|
||||
|
||||
if (is_array($attributes) === true) {
|
||||
$tmpAttributes = [];
|
||||
|
@ -4230,6 +4261,10 @@ function html_print_checkbox_extended(
|
|||
$labelClass .= ' '.$value;
|
||||
break;
|
||||
|
||||
case 'label_style':
|
||||
$labelStyle .= 'style="'.$value.'"';
|
||||
break;
|
||||
|
||||
default:
|
||||
$tmpAttributes[] = $key.'="'.$value.'"';
|
||||
break;
|
||||
|
@ -4241,7 +4276,7 @@ function html_print_checkbox_extended(
|
|||
|
||||
$id_aux = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : ''));
|
||||
|
||||
$output = '<label class="'.$labelClass.'">';
|
||||
$output = '<label class="'.$labelClass.'"'.$labelStyle.'>';
|
||||
$output .= '<input class="'.$inputClass.'" name="'.$name.'" type="checkbox" value="'.$value.'" '.($checked ? 'checked="checked"' : '');
|
||||
$output .= (empty($id) === true) ? ' id="checkbox-'.$id_aux.'"' : ' id="'.$id.'"';
|
||||
$output .= (empty($script) === false) ? ' onclick="'.$script.'"' : '';
|
||||
|
@ -6629,34 +6664,32 @@ function html_print_extended_select_for_downtime_cron(
|
|||
$disabled,
|
||||
'font-size: xx-small;'.$select_style
|
||||
);
|
||||
echo ' <a href="javascript:">'.html_print_image(
|
||||
echo ' <a style="margin: 7px" href="javascript:">'.html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
|
||||
'alt' => __('Custom'),
|
||||
'title' => __('Custom'),
|
||||
'style' => 'width: 18px;',
|
||||
// 'style' => 'margin: 7px;',
|
||||
]
|
||||
).'</a>';
|
||||
echo '</div>';
|
||||
|
||||
$help_tooltip = ($text_help !== '') ? ui_print_help_tip(__($text_help), true) : '';
|
||||
|
||||
echo '<div id="'.$uniq_name.'_manual" class="w100p inline_line">';
|
||||
html_print_input_text($uniq_name.'_text', $selected, '', 20);
|
||||
|
||||
html_print_input_text($uniq_name.'_text', $selected, '', 20, 20, false, false, false, '', 'w100p');
|
||||
html_print_input_hidden($name, $selected, false, $uniq_name);
|
||||
echo ' <a href="javascript:">'.$help_tooltip.' '.html_print_image(
|
||||
echo ' <a href="javascript:">'.html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'class' => $uniq_name.'_toggler main_menu_icon invert_filter',
|
||||
'alt' => __('List'),
|
||||
'title' => __('List'),
|
||||
'style' => 'width: 18px;',
|
||||
'style' => 'margin: 7px;',
|
||||
]
|
||||
).'</a>';
|
||||
echo ($text_help !== '') ? ui_print_help_tip(__($text_help), true, '', false, 'margin: 13px 0 0 5px;') : '';
|
||||
echo '</div>';
|
||||
|
||||
$select_init_func = (is_numeric($selected) === true || $selected === '*') ? 'post_process_select_init' : 'post_process_select_init_inv';
|
||||
|
@ -6666,7 +6699,7 @@ function html_print_extended_select_for_downtime_cron(
|
|||
".$select_init_func."('$uniq_name','$selected');
|
||||
post_process_select_events_unit('$uniq_name','$selected');
|
||||
});
|
||||
|
||||
|
||||
</script>";
|
||||
|
||||
$returnString = ob_get_clean();
|
||||
|
|
|
@ -2508,6 +2508,10 @@ function ui_print_help_tip(
|
|||
$style='',
|
||||
$blink=false
|
||||
) {
|
||||
if (empty($img) === true) {
|
||||
$img = 'images/info@svg.svg';
|
||||
}
|
||||
|
||||
$output = '<a href="javascript:" class="tip" style="'.$style.'" >';
|
||||
$output .= html_print_image(
|
||||
$img,
|
||||
|
|
|
@ -86,6 +86,43 @@
|
|||
font-weight: 900;
|
||||
}
|
||||
|
||||
/*
|
||||
@font-face {
|
||||
font-family: "lato-italic";
|
||||
src: url("../fonts/Lato-Italic.woff") format("woff");
|
||||
font-weight: 400;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "lato";
|
||||
src: url("../fonts/Lato-LightItalic.woff") format("woff");
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "lato";
|
||||
src: url("../fonts/Lato-ThinItalic.woff") format("woff");
|
||||
font-weight: 100;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "lato";
|
||||
src: url("../fonts/Lato-BoldItalic.woff") format("woff");
|
||||
font-weight: 700;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "lato";
|
||||
src: url("../fonts/Lato-BlackItalic.woff") format("woff");
|
||||
font-weight: 900;
|
||||
font-style: italic;
|
||||
}
|
||||
*/
|
||||
|
||||
@font-face {
|
||||
font-family: "source-code";
|
||||
src: url("../fonts/SourceCodePro.woff") format("woff");
|
||||
|
@ -11550,3 +11587,12 @@ ul.tag-editor {
|
|||
.max-width-100p {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Datatables overrides */
|
||||
.ui-dialog .ui-dialog-titlebar-close {
|
||||
right: 1em !important;
|
||||
}
|
||||
|
||||
.ui-dialog .ui-dialog-titlebar {
|
||||
display: block !important;
|
||||
}
|
||||
|
|
|
@ -530,6 +530,7 @@ table.filter-table-adv td {
|
|||
vertical-align: top;
|
||||
}
|
||||
|
||||
div.filter-table-adv-manual > div,
|
||||
table.filter-table-adv td > div {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
@ -537,6 +538,7 @@ table.filter-table-adv td > div {
|
|||
align-items: normal;
|
||||
}
|
||||
|
||||
div.filter-table-adv-manual > div label,
|
||||
table.filter-table-adv td > div label {
|
||||
color: #161628;
|
||||
font-size: 13px;
|
||||
|
@ -648,10 +650,6 @@ td#save_filter_form-1-0 > b {
|
|||
line-height: 16px;
|
||||
}
|
||||
|
||||
tr#save_filter_row1 {
|
||||
display: flex !important;
|
||||
}
|
||||
|
||||
td#save_filter_form-0-0,
|
||||
td#save_filter_form-0-1,
|
||||
td#save_filter_form-1-0 > input#text-id_name,
|
||||
|
|
Loading…
Reference in New Issue