diff --git a/pandora_console/godmode/agentes/planned_downtime.editor.php b/pandora_console/godmode/agentes/planned_downtime.editor.php
index 87c2f75060..d5455f22f4 100755
--- a/pandora_console/godmode/agentes/planned_downtime.editor.php
+++ b/pandora_console/godmode/agentes/planned_downtime.editor.php
@@ -25,6 +25,7 @@ if (! check_acl ($config['id_user'], 0, "AW")) {
return;
}
+$config["past_planned_downtimes"] = isset($config["past_planned_downtimes"]) ? $config["past_planned_downtimes"] : 1;
require_once ('include/functions_users.php');
@@ -51,7 +52,7 @@ $once_time_to = (string) get_parameter ('once_time_to', date(TIME_FORMAT));
$periodically_day_from = (int) get_parameter ('periodically_day_from', 1);
$periodically_day_to = (int) get_parameter ('periodically_day_to', 31);
$periodically_time_from = (string) get_parameter ('periodically_time_from', date(TIME_FORMAT));
-$periodically_time_to = (string) get_parameter ('periodically_time_to', date(TIME_FORMAT));
+$periodically_time_to = (string) get_parameter ('periodically_time_to', date(TIME_FORMAT, time() + SECONDS_1HOUR));
$first_create = (int) get_parameter ('first_create', 0);
@@ -152,12 +153,19 @@ if ($create_downtime || $update_downtime) {
$datetime_to = strtotime ($once_date_to . ' ' . $once_time_to);
$now = strtotime(date(DATE_FORMAT). ' ' . date(TIME_FORMAT));
- if ($datetime_from < $now) {
+ if ($type_execution == 'once' && !$config["past_planned_downtimes"] && $datetime_from < $now) {
ui_print_error_message(__('Not created. Error inserting data. Start time must be higher than the current time' ));
}
- else if ($datetime_from >= $datetime_to) {
- ui_print_error_message(__('Not created. Error inserting data' ).
- ': START >= END');
+ else if ($type_execution == 'once' && $datetime_from >= $datetime_to) {
+ ui_print_error_message(__('Not created. Error inserting data') . ". " .__('The end date must be higher than the start date'));
+ }
+ else if ($type_execution == 'periodically'
+ && (($type_periodicity == 'weekly' && $periodically_time_from >= $periodically_time_to)
+ || ($type_periodicity == 'monthly' && $periodically_day_from == $periodically_day_to && $periodically_time_from >= $periodically_time_to))) {
+ ui_print_error_message(__('Not created. Error inserting data') . ". " .__('The end time must be higher than the start time'));
+ }
+ else if ($type_execution == 'periodically' && $type_periodicity == 'monthly' && $periodically_day_from >= $periodically_day_to) {
+ ui_print_error_message(__('Not created. Error inserting data') . ". " .__('The end day must be higher than the start day'));
}
else {
$sql = '';
@@ -323,35 +331,35 @@ $table->data[3][1] = html_print_select(array('quiet' => __('Quiet'),
'type_downtime', $type_downtime, 'change_type_downtime()', '', 0, true, false, true,
'');
$table->data[4][0] = __('Execution');
-$table->data[4][1] = html_print_select(array('once' => __('once'),
+$table->data[4][1] = html_print_select(array('once' => __('Once'),
'periodically' => __('Periodically')),
'type_execution', $type_execution, 'change_type_execution();', '', 0, true);
$days = array_combine(range(1, 31), range(1, 31));
-$table->data[5][0] = __('Configure the time');
+$table->data[5][0] = __('Configure the time') . " " . ui_print_help_icon ('planned_downtime_time', true);;
$table->data[5][1] = "
" .
__('From:') .
- ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) .
- ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) .
" |
".
html_print_input_text ('once_date_from', $once_date_from, '', 10, 10, true) .
- html_print_input_text ('once_time_from', $once_time_from, '', 9, 9, true) .
+ ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) .
+ html_print_input_text ('once_time_from', $once_time_from, '', 9, 9, true) .
+ ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) .
" |
" .
__('To:') .
- ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) .
- ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) .
" |
".
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) .
+ ui_print_help_tip(__('Date format in Pandora is year/month/day'), true) .
+ html_print_input_text ('once_time_to', $once_time_to, '', 9, 9, true) .
+ ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds'), true) .
" |
@@ -359,8 +367,7 @@ $table->data[5][1] = "
- " . __('Type Periodicity:') . " |
- ".
+ | " . __('Type Periodicity:') . " ".
html_print_select(array(
'weekly' => __('Weekly'),
'monthly' => __('Monthly')),
@@ -407,6 +414,7 @@ $table->data[5][1] = "
html_print_select($days,
'periodically_day_to', $periodically_day_to, '', '', 0, true) .
" |
+ " . ui_print_help_tip(__('The end day must be higher than the start day'), true) . " |
@@ -416,12 +424,16 @@ $table->data[5][1] = "
html_print_input_text (
'periodically_time_from',
$periodically_time_from, '', 7, 7, true) .
+ ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds').
+ ".
".__('The end time must be higher than the start time'), true) .
"
" . __('To hour:') . " |
".
html_print_input_text (
'periodically_time_to',
- $periodically_time_to, '', 7, 7, true) .
+ $periodically_time_to, '', 7, 7, true) .
+ ui_print_help_tip(__('Time format in Pandora is hours(24h):minutes:seconds').
+ ". ".__('The end time must be higher than the start time'), true) .
" |
@@ -511,7 +523,7 @@ if ($id_downtime > 0) {
echo html_print_select (array(), "module[]", '', '', '', 0, false, true, true, '', false, 'width: 180px;');
echo "
";
echo "
";
- html_print_submit_button (__('Add'), '', $disabled_add_button, 'class="sub next"',false);
+ html_print_submit_button (__('Add'), 'add_item', $disabled_add_button, 'class="sub next"',false);
echo "";
echo "";
@@ -969,5 +981,18 @@ ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascri
$("#id_agent").blur (function () {
$(this).css ("width", "180px");
});
+
+ // Warning message about the problems caused updating a past planned downtime
+ var type_execution = "";
+ var datetime_from = ;
+ var datetime_now = ;
+ var create = ;
+ if (!create && (type_execution == 'periodically' || (type_execution == 'once' && datetime_from < datetime_now))) {
+ $("input#submit-updbutton, input#submit-add_item, table#list a").click(function (e) {
+ if (!confirm("")) {
+ e.preventDefault();
+ }
+ });
+ }
});
diff --git a/pandora_console/godmode/agentes/planned_downtime.export_csv.php b/pandora_console/godmode/agentes/planned_downtime.export_csv.php
new file mode 100644
index 0000000000..58a89ac5dd
--- /dev/null
+++ b/pandora_console/godmode/agentes/planned_downtime.export_csv.php
@@ -0,0 +1,249 @@
+= '".strtotime("$date_from 00:00:00")."'))";
+}
+
+if (!empty($date_to)) {
+ $periodically_monthly_w = "type_periodicity = 'monthly' AND (periodically_day_from <= '".date('d', strtotime($date_from))."' AND periodically_time_to >= '".date('d', strtotime($date_to))."')";
+
+ $periodically_weekly_days = array();
+ $date_from_aux = strtotime($date_from);
+ $date_end = strtotime($date_to);
+ $days_number = 0;
+
+ while ($date_from_aux <= $date_end && $days_number < 7) {
+ $weekday_actual = strtolower(date('l', $date_from_aux));
+
+ $periodically_weekly_days[] = "$weekday_actual = 1";
+
+ $date_from_aux = $date_from_aux + SECONDS_1DAY;
+ $days_number++;
+ }
+
+ $periodically_weekly_w = "type_periodicity = 'weekly' AND (".implode(" OR ", $periodically_weekly_days).")";
+
+ $periodically_w = "type_execution = 'periodically' AND (($periodically_monthly_w) OR ($periodically_weekly_w))";
+
+ $once_w = "type_execution = 'once' AND date_to <= '".strtotime("$date_to 23:59:59")."'";
+
+ $where_values .= " AND (($periodically_w) OR ($once_w))";
+}
+
+if (!$show_archived) {
+ $where_values .= " AND (type_execution = 'periodically' OR (type_execution = 'once' AND date_to >= '".time()."'))";
+}
+
+if (!empty($agent_id)) {
+ $where_values .= " AND id IN (SELECT id_downtime FROM tplanned_downtime_agents WHERE id_agent = $agent_id)";
+}
+
+if (!empty($module_id)) {
+ $where_values .= " AND (id IN (SELECT id_downtime
+ FROM tplanned_downtime_modules
+ WHERE id_agent_module = $module_id)
+ OR id IN (SELECT id_downtime
+ FROM tplanned_downtime_agents tpda, tagente_modulo tam
+ WHERE tpda.id_agent = tam.id_agente
+ AND tam.id_agente_modulo = $module_id
+ AND tpda.all_modules = 1))";
+}
+
+$sql = "SELECT *
+ FROM tplanned_downtime
+ WHERE $where_values
+ ORDER BY type_execution DESC, date_from DESC";
+$downtimes = @db_get_all_rows_sql($sql);
+html_debug_print($sql);
+html_debug_print($downtimes);
+if (!empty($downtimes)) {
+ ob_clean();
+ // Show contentype header
+ Header("Content-type: text/csv");
+ header('Content-Disposition: attachment; filename="pandora_planned_downtime_'.date("Y/m/d H:i:s").'.csv"');
+
+ $titles = array();
+ $titles[] = "id";
+ $titles[] = "name";
+ $titles[] = "description";
+ $titles[] = "group";
+ $titles[] = "type";
+ $titles[] = "execution_type";
+ $titles[] = "execution_date";
+ $titles[] = "affected_items";
+
+ echo implode($separator, $titles);
+ echo chr(13);
+
+ foreach ($downtimes as $downtime) {
+ $id = $downtime['id'];
+ $name = io_safe_output($downtime['name']);
+ $description = io_safe_output($downtime['description']);
+ $group = ucfirst(io_safe_output(groups_get_name($downtime['id_group'])));
+ $type = ucfirst(io_safe_output($downtime['type_downtime']));
+ $execution_type = ucfirst(io_safe_output($downtime['type_execution']));
+
+ switch ($downtime['type_execution']) {
+ case 'once':
+ $execution_date = date ("Y-m-d H:i", $downtime['date_from']) .
+ " " . __('to') . " ".
+ date ("Y-m-d H:i", $downtime['date_to']);
+ break;
+ case 'periodically':
+ switch ($downtime['type_periodicity']) {
+ case 'weekly':
+ $execution_date = __('Weekly:');
+ $execution_date .= " ";
+ if ($downtime['monday']) {
+ $execution_date .= __('Mon');
+ $execution_date .= " ";
+ }
+ if ($downtime['tuesday']) {
+ $execution_date .= __('Tue');
+ $execution_date .= " ";
+ }
+ if ($downtime['wednesday']) {
+ $execution_date .= __('Wed');
+ $execution_date .= " ";
+ }
+ if ($downtime['thursday']) {
+ $execution_date .= __('Thu');
+ $execution_date .= " ";
+ }
+ if ($downtime['friday']) {
+ $execution_date .= __('Fri');
+ $execution_date .= " ";
+ }
+ if ($downtime['saturday']) {
+ $execution_date .= __('Sat');
+ $execution_date .= " ";
+ }
+ if ($downtime['sunday']) {
+ $execution_date .= __('Sun');
+ $execution_date .= " ";
+ }
+ $execution_date .= " (" . $downtime['periodically_time_from'];
+ $execution_date .= "-" . $downtime['periodically_time_to'] . ")";
+ break;
+ case 'monthly':
+ $execution_date = __('Monthly:');
+ $execution_date .= __('From day') . " " . $downtime['periodically_day_from'];
+ $execution_date .= "/" . __('To day') . " ";
+ $execution_date .= $downtime['periodically_day_to'];
+ $execution_date .= " (" . $downtime['periodically_time_from'];
+ $execution_date .= "-" . $downtime['periodically_time_to'] . ")";
+ break;
+ }
+ break;
+ }
+ $execution_date = io_safe_output($execution_date);
+
+ $affected_items = array();
+
+ $sql_agents = "SELECT tpda.id_agent AS agent_id, tpda.all_modules AS all_modules, ta.nombre AS agent_name
+ FROM tplanned_downtime_agents tpda, tagente ta
+ WHERE tpda.id_downtime = $id
+ AND tpda.id_agent = ta.id_agente";
+ $downtime_agents = @db_get_all_rows_sql($sql_agents);
+
+ if (!empty($downtime_agents)) {
+ foreach ($downtime_agents as $downtime_agent) {
+ $downtime_items = array();
+ $downtime_items[] = $downtime_agent['agent_name'];
+
+ if (!$downtime_agent['all_modules']) {
+ $agent_id = $downtime_agent['agent_id'];
+ $sql_modules = "SELECT tpdm.id_agent_module AS module_id, tam.nombre AS module_name
+ FROM tplanned_downtime_modules tpdm, tagente_modulo tam
+ WHERE tpdm.id_downtime = $id
+ AND tpdm.id_agent = $agent_id
+ AND tpdm.id_agent_module = tam.id_agente_modulo";
+ $downtime_modules = @db_get_all_rows_sql($sql_modules);
+
+ if (!empty($downtime_modules)) {
+ foreach ($downtime_modules as $downtime_module) {
+ $downtime_items[] = $downtime_module['module_name'];
+ }
+ }
+ }
+ $affected_items[] = "[".implode("|", $downtime_items)."]";
+ }
+ }
+ $affected_items = implode(",", $affected_items);
+
+ $values = array();
+ $values[] = $id;
+ $values[] = $name;
+ $values[] = $description;
+ $values[] = $group;
+ $values[] = $type;
+ $values[] = $execution_type;
+ $values[] = $execution_date;
+ $values[] = $affected_items;
+
+ echo implode($separator, $values);
+ echo chr(13);
+ }
+}
+else {
+ echo '
'.__('No planned downtime').'
';
+}
+?>
\ No newline at end of file
diff --git a/pandora_console/godmode/agentes/planned_downtime.list.php b/pandora_console/godmode/agentes/planned_downtime.list.php
index e14ee776b0..675efc44a6 100755
--- a/pandora_console/godmode/agentes/planned_downtime.list.php
+++ b/pandora_console/godmode/agentes/planned_downtime.list.php
@@ -180,9 +180,95 @@ if ($delete_downtime) {
}
}
-$groups = users_get_groups ();
+// Filter parameters
+$offset = (int) get_parameter('offset');
+$search_text = (string) get_parameter('search_text');
+$date_from = (string) get_parameter('date_from');
+$date_to = (string) get_parameter('date_to');
+$execution_type = (string) get_parameter('execution_type');
+$show_archived = (bool) get_parameter('archived');
+$agent_id = (int) get_parameter('agent_id');
+$agent_name = !empty($agent_id) ? (string) get_parameter('agent_name') : "";
+$module_id = (int) get_parameter('module_name_hidden');
+$module_name = !empty($module_id) ? (string) get_parameter('module_name') : "";
+
+$filter_params = array();
+$filter_params['search_text'] = $search_text;
+$filter_params['date_from'] = $date_from;
+$filter_params['date_to'] = $date_to;
+$filter_params['execution_type'] = $execution_type;
+$filter_params['archived'] = $show_archived;
+$filter_params['agent_id'] = $agent_id;
+$filter_params['agent_name'] = $agent_name;
+$filter_params['module_id'] = $module_id;
+$filter_params['module_name'] = $module_name;
+
+$filter_params_aux = array();
+foreach ($filter_params as $name => $value) {
+ $filter_params_aux[] = is_bool($value) ? $name."=".(int)$value : "$name=$value";
+}
+$filter_params_str = !empty($filter_params_aux) ? implode("&", $filter_params_aux) : "";
+
+// Table filter
+$table = new StdClass();
+$table->class = 'databox';
+$table->width = '99%';
+$table->rowstyle = array();
+$table->rowstyle[0] = "background-color: #f9faf9;";
+$table->rowstyle[1] = "background-color: #f9faf9;";
+$table->rowstyle[2] = "background-color: #f9faf9;";
+$table->data = array();
+
+$row = array();
+
+// Search text
+$row[] = __('Search') . ' ' . html_print_input_text("search_text", $search_text, '', 50, 250, true);
+// 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);
+$row[] = $date_inputs;
+
+$table->data[] = $row;
+
+$row = array();
+
+// Execution type
+$execution_type_fields = array('once' => __('Once'), 'periodically' => __('Periodically'));
+$row[] = __('Execution type') . ' ' . html_print_select($execution_type_fields, 'execution_type', $execution_type, '', __('Any'), '', true, false, false);
+// Show past downtimes
+$row[] = __('Show past downtimes') . ' ' . html_print_checkbox ("archived", 1, $show_archived, true);
+
+$table->data[] = $row;
+
+$row = array();
+
+// Agent
+$params = array();
+$params['show_helptip'] = true;
+$params['input_name'] = 'agent_name';
+$params['value'] = $agent_name;
+$params['return'] = true;
+$params['print_hidden_input_idagent'] = true;
+$params['hidden_input_idagent_name'] = 'agent_id';
+$params['hidden_input_idagent_value'] = $agent_id;
+$agent_input = __('Agent') . ' ' . ui_print_agent_autocomplete_input($params);
+$row[] = $agent_input;
+
+// Module
+$module_input = __('Module') . ' ' . html_print_autocomplete_modules('module_name', $module_name, false, true, '', array(), true);
+$row[] = $module_input;
+
+$row[] = html_print_submit_button('Search', 'search', false, 'class="sub search"', true);
+
+$table->data[] = $row;
+
+echo "
";
// View available downtimes present in database (if any of them)
+$table = new StdClass();
$table->class = 'databox';
//Start Overview of existing planned downtime
$table->width = '98%';
@@ -194,10 +280,10 @@ $table->head[2] = __('Group');
$table->head[3] = __('Type');
$table->head[4] = __('Execution');
$table->head[5] = __('Configuration');
-$table->head[6] = __('Delete');
-$table->head[7] = __('Update');
-$table->head[8] = __('Running');
-$table->head[9] = __('Stop downtime');
+$table->head[6] = __('Running');
+$table->head[7] = __('Stop downtime');
+$table->head[8] = __('Edit');
+$table->head[9] = __('Delete');
$table->align[2] = "center";
//$table->align[5] = "center";
$table->align[6] = "center";
@@ -205,11 +291,85 @@ $table->align[7] = "center";
$table->align[8] = "center";
$table->align[9] = "center";
+$groups = users_get_groups ();
if(!empty($groups)) {
+ $where_values = "1=1";
+
+ $groups_string = implode (",", array_keys ($groups));
+ $where_values .= " AND id_group IN ($groups_string)";
+
+ if (!empty($search_text)) {
+ $where_values .= " AND (name LIKE '%$search_text%' OR description LIKE '%$search_text%')";
+ }
+
+ if (!empty($execution_type)) {
+ $where_values .= " AND type_execution = '$execution_type'";
+ }
+
+ if (!empty($date_from)) {
+ $where_values .= " AND (type_execution = 'periodically' OR (type_execution = 'once' AND date_from >= '".strtotime("$date_from 00:00:00")."'))";
+ }
+
+ if (!empty($date_to)) {
+ $periodically_monthly_w = "type_periodicity = 'monthly'
+ AND ((periodically_day_from <= '".date('d', strtotime($date_from))."' AND periodically_day_to >= '".date('d', strtotime($date_to))."')
+ OR (periodically_day_from > periodically_day_to
+ AND (periodically_day_from <= '".date('d', strtotime($date_from))."' OR periodically_day_to >= '".date('d', strtotime($date_to))."')))";
+
+ $periodically_weekly_days = array();
+ $date_from_aux = strtotime($date_from);
+ $date_end = strtotime($date_to);
+ $days_number = 0;
+
+ while ($date_from_aux <= $date_end && $days_number < 7) {
+ $weekday_actual = strtolower(date('l', $date_from_aux));
+
+ $periodically_weekly_days[] = "$weekday_actual = 1";
+
+ $date_from_aux = $date_from_aux + SECONDS_1DAY;
+ $days_number++;
+ }
+
+ $periodically_weekly_w = "type_periodicity = 'weekly' AND (".implode(" OR ", $periodically_weekly_days).")";
+
+ $periodically_w = "type_execution = 'periodically' AND (($periodically_monthly_w) OR ($periodically_weekly_w))";
+
+ $once_w = "type_execution = 'once' AND date_to <= '".strtotime("$date_to 23:59:59")."'";
+
+ $where_values .= " AND (($periodically_w) OR ($once_w))";
+ }
+
+ if (!$show_archived) {
+ $where_values .= " AND (type_execution = 'periodically' OR (type_execution = 'once' AND date_to >= '".time()."'))";
+ }
+
+ if (!empty($agent_id)) {
+ $where_values .= " AND id IN (SELECT id_downtime FROM tplanned_downtime_agents WHERE id_agent = $agent_id)";
+ }
+
+ if (!empty($module_id)) {
+ $where_values .= " AND (id IN (SELECT id_downtime
+ FROM tplanned_downtime_modules
+ WHERE id_agent_module = $module_id)
+ OR id IN (SELECT id_downtime
+ FROM tplanned_downtime_agents tpda, tagente_modulo tam
+ WHERE tpda.id_agent = tam.id_agente
+ AND tam.id_agente_modulo = $module_id
+ AND tpda.all_modules = 1))";
+ }
+
$sql = "SELECT *
- FROM tplanned_downtime
- WHERE id_group IN (" . implode (",", array_keys ($groups)) . ")";
+ FROM tplanned_downtime
+ WHERE $where_values
+ ORDER BY type_execution DESC, date_from DESC
+ LIMIT ".$config["block_size"]."
+ OFFSET $offset";
+ $sql_count = "SELECT COUNT(id) AS num
+ FROM tplanned_downtime
+ WHERE $where_values";
$downtimes = db_get_all_rows_sql ($sql);
+ $downtimes_number_res = db_get_all_rows_sql($sql_count);
+ $downtimes_number = $downtimes_number_res != false ? $downtimes_number_res[0]['num'] : 0;
}
else {
$downtimes = array();
@@ -219,6 +379,8 @@ if (!$downtimes) {
echo '
'.__('No planned downtime').'
';
}
else {
+ ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
+
foreach ($downtimes as $downtime) {
$data = array();
$total = db_get_sql ("SELECT COUNT(id_agent)
@@ -295,44 +457,71 @@ else {
}
if ($downtime["executed"] == 0) {
- $data[6] = '
' .
- html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete')));
- $data[7] = '' .
- html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '';
- }
- else {
- $data[6]= "N/A";
- $data[7]= "N/A";
-
- }
- if ($downtime["executed"] == 0) {
- $data[8] = html_print_image ("images/pixel_red.png", true,
+ $data[6] = html_print_image ("images/pixel_red.png", true,
array ('width' => 20, 'height' => 20, 'alt' => __('Executed')));
}
else {
- $data[8] = html_print_image ("images/pixel_green.png", true,
+ $data[6] = html_print_image ("images/pixel_green.png", true,
array ('width' => 20, 'height' => 20, 'alt' => __('Not executed')));
}
-
- if (($downtime['type_execution'] == 'once')
- && ($downtime["executed"] == 1)) {
+ if ($downtime['type_execution'] == 'once' && $downtime["executed"] == 1) {
- $data[9] = '
' .
html_print_image("images/cancel.png", true, array("border" => '0', "alt" => __('Stop downtime')));
}
+ else {
+ $data[7] = "";
+ }
+ if ($downtime["executed"] == 0) {
+ $data[8] = '' .
+ html_print_image("images/config.png", true, array("border" => '0', "alt" => __('Update'))) . '';
+ $data[9] = '
' .
+ html_print_image("images/cross.png", true, array("border" => '0', "alt" => __('Delete')));
+ }
+ else {
+ $data[8]= "N/A";
+ $data[9]= "N/A";
+
+ }
array_push ($table->data, $data);
}
html_print_table ($table);
}
echo '';
+
+
+ui_require_jquery_file("ui.datepicker-" . get_user_language(), "include/javascript/i18n/");
+
+?>
+
\ No newline at end of file
diff --git a/pandora_console/godmode/setup/setup_general.php b/pandora_console/godmode/setup/setup_general.php
index e6582fd756..5cf05f2cf5 100644
--- a/pandora_console/godmode/setup/setup_general.php
+++ b/pandora_console/godmode/setup/setup_general.php
@@ -263,6 +263,12 @@ $table->data['tutorial_mode'][1] =
html_print_select($modes_tutorial, 'tutorial_mode',
$config["tutorial_mode"], '', '', 0, true);
+$config["past_planned_downtimes"] = isset($config["past_planned_downtimes"]) ? $config["past_planned_downtimes"] : 1;
+$table->data[33][0] = __('Allow create planned downtimes in the past') .
+ ui_print_help_tip(__('The planned downtimes created in the past will affect the SLA reports'), true);
+$table->data[33][1] = __('Yes').' '.html_print_radio_button ('past_planned_downtimes', 1, '', $config["past_planned_downtimes"], true).' ';
+$table->data[33][1] .= __('No').' '.html_print_radio_button ('past_planned_downtimes', 0, '', $config["past_planned_downtimes"], true);
+
echo '