Unified downtime name as scheduled downtime

This commit is contained in:
Luis 2021-05-10 09:06:43 +00:00 committed by Daniel Rodriguez
parent 247343c0b6
commit f25256a74d
15 changed files with 42 additions and 42 deletions

View File

@ -15,14 +15,14 @@ global $config;
check_login();
ui_require_css_file('first_task');
?>
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no planned downtime defined yet.') ]); ?>
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no scheduled downtime defined yet.') ]); ?>
<div class="new_task">
<div class="image_task">
<?php echo html_print_image('images/first_task/icono_grande_visualconsole.png', true, ['title' => __('Planned Downtime')]); ?>
<?php echo html_print_image('images/first_task/icono_grande_visualconsole.png', true, ['title' => __('Scehduled Downtime')]); ?>
</div>
<div class="text_task">
<h3> <?php echo __('Create Planned Downtime'); ?></h3><p id="description_task">
<h3> <?php echo __('Create Scheduled Downtime'); ?></h3><p id="description_task">
<?php
echo __(
"%s contains a scheduled downtime management system.
@ -34,7 +34,7 @@ ui_require_css_file('first_task');
?>
</p>
<form action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" method="post">
<input type="submit" class="button_task" value="<?php echo __('Create Planned Downtime'); ?>" />
<input type="submit" class="button_task" value="<?php echo __('Create Scheduled Downtime'); ?>" />
</form>
</div>
</div>

View File

@ -746,9 +746,9 @@ if ($agents !== false) {
if ($in_planned_downtime) {
ui_print_help_tip(
__('Agent in planned downtime'),
__('Agent in scheduled downtime'),
false,
$config['image']['minireloj_16']
'images/minireloj-16.png'
);
echo '</em>';

View File

@ -64,7 +64,7 @@ $buttons = [
// Header.
ui_print_page_header(
__('Planned Downtime'),
__('Scheduled Downtime'),
'images/gm_monitoring.png',
false,
'',
@ -308,12 +308,12 @@ if ($create_downtime || $update_downtime) {
);
} else {
ui_print_error_message(
__('Each planned downtime must have a different name')
__('Each scheduled downtime must have a different name')
);
}
} else {
ui_print_error_message(
__('Planned downtime must have a name')
__('Scheduled downtime must have a name')
);
}
} else if ($update_downtime) {
@ -345,7 +345,7 @@ if ($create_downtime || $update_downtime) {
$values = [];
if (trim(io_safe_output($name)) == '') {
ui_print_error_message(
__('Planned downtime must have a name')
__('Scheduled downtime must have a name')
);
}
@ -1489,14 +1489,14 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
$(this).css ("width", "180px");
});
// Warning message about the problems caused updating a past planned downtime
// Warning message about the problems caused updating a past scheduled downtime
var type_execution = "<?php echo $type_execution; ?>";
var datetime_from = <?php echo json_encode(strtotime($once_date_from.' '.$once_time_from)); ?>;
var datetime_now = <?php echo json_encode($utimestamp); ?>;
var create = <?php echo json_encode($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("<?php echo __('WARNING: If you edit this planned downtime, the data of future SLA reports may be altered'); ?>")) {
if (!confirm("<?php echo __('WARNING: If you edit this scheduled downtime, the data of future SLA reports may be altered'); ?>")) {
e.preventDefault();
}
});

View File

@ -196,5 +196,5 @@ if (!empty($downtimes)) {
echo chr(13);
}
} else {
echo '<div class="nf">'.__('No planned downtime').'</div>';
echo '<div class="nf">'.__('No scheduled downtime').'</div>';
}

View File

@ -44,7 +44,7 @@ if ($migrate_malformed) {
if ($migration_result['status'] == false) {
ui_print_error_message(
__('An error occurred while migrating the malformed planned downtimes').'. '.__('Please run the migration again or contact with the administrator')
__('An error occurred while migrating the malformed scheduled downtimes').'. '.__('Please run the migration again or contact with the administrator')
);
echo '<br>';
}
@ -80,7 +80,7 @@ if ($stop_downtime) {
$result = planned_downtimes_stop($downtime);
if ($result === false) {
ui_print_error_message(__('An error occurred stopping the planned downtime'));
ui_print_error_message(__('An error occurred stopping the scheduled downtime'));
} else {
echo $result['message'];
}
@ -103,7 +103,7 @@ if ($delete_downtime) {
// The downtime shouldn't be running!!
if ($downtime['executed']) {
ui_print_error_message(__('This planned downtime is running'));
ui_print_error_message(__('This scheduled downtime is running'));
} else {
$result = db_process_sql_delete('tplanned_downtime', ['id' => $id_downtime]);
@ -362,7 +362,7 @@ else if (!$downtimes) {
echo '</form>';
// Info message.
echo '<div class="nf">'.__('No planned downtime').'</div>';
echo '<div class="nf">'.__('No scheduled downtime').'</div>';
echo '<div class="action-buttons w100p" >';
@ -572,13 +572,13 @@ $(document).ready (function () {
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
$("a#delete_downtime").click(function (e) {
if (!confirm("<?php echo __('WARNING: If you delete this planned downtime, it will not be taken into account in future SLA reports'); ?>")) {
if (!confirm("<?php echo __('WARNING: If you delete this scheduled downtime, it will not be taken into account in future SLA reports'); ?>")) {
e.preventDefault();
}
});
if (<?php echo json_encode($malformed_downtimes_exist); ?> && <?php echo json_encode($migrate_malformed == false); ?>) {
if (confirm("<?php echo __('WARNING: There are malformed planned downtimes').'.\n'.__('Do you want to migrate automatically the malformed items?'); ?>")) {
if (confirm("<?php echo __('WARNING: There are malformed scheduled downtimes').'.\n'.__('Do you want to migrate automatically the malformed items?'); ?>")) {
window.location.href = "index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.list&migrate_malformed=1";
}
}

View File

@ -420,7 +420,7 @@ $table->data[$i++][1] = html_print_select(
$config['past_planned_downtimes'] = isset(
$config['past_planned_downtimes']
) ? $config['past_planned_downtimes'] : 1;
$table->data[$i][0] = __('Allow create planned downtimes in the past');
$table->data[$i][0] = __('Allow create scheduled downtimes in the past');
$table->data[$i++][1] = html_print_checkbox_switch(
'past_planned_downtimes',
1,

View File

@ -94,7 +94,7 @@ is not working on the metaconsole and there is no time to fix it -->
var mr_available_header = "<?php echo __('There are db changes'); ?>\n";
var text1_mr_file = "<?php echo __('There are new database changes available to apply. Do you want to start the DB update process?'); ?>\n";
var text2_mr_file = "<?php echo __('We recommend launching '); ?>\n";
var text3_mr_file = "<?php echo __('planned downtime'); ?>\n";
var text3_mr_file = "<?php echo __('Scheduled downtime'); ?>\n";
var language = "<?php echo $config['language']; ?>";
var docsUrl = (language === "es")

View File

@ -6481,7 +6481,7 @@ function api_set_stop_downtime($id, $thrash1, $other, $thrash3)
$data = db_get_row_sql($sql);
if ($data['type_execution'] == 'periodically' && $data['executed'] == 1) {
returnError('error_stop_downtime', __('Error stopping downtime. Periodical and running planned downtime cannot be stopped.'));
returnError('error_stop_downtime', __('Error stopping downtime. Periodical and running scheduled downtime cannot be stopped.'));
return;
}
@ -6967,7 +6967,7 @@ function api_set_planned_downtimes_additem($id, $thrash1, $other, $thrash3)
}
if (empty($agents)) {
returnError('No agents to create planned downtime items');
returnError('No agents to create scheduled downtime items');
} else {
if (!empty($returned['bad_modules'])) {
$bad_modules = __("and this modules are doesn't exists or not applicable a this agents: ").implode(', ', $returned['bad_modules']);

View File

@ -307,7 +307,7 @@ function config_update_config()
}
if (!config_update_value('past_planned_downtimes', get_parameter('past_planned_downtimes'))) {
$error_update[] = __('Allow create planned downtimes in the past');
$error_update[] = __('Allow create scheduled downtimes in the past');
}
if (!config_update_value('limit_parameters_massive', get_parameter('limit_parameters_massive'))) {

View File

@ -95,12 +95,12 @@ function planned_downtimes_update($values, $downtime_id=0, $check_dates=true)
$name_exists = (bool) db_get_value('id', 'tplanned_downtime', 'name', $values['name']);
if ($name_exists) {
$result['message'] = ui_print_error_message(__('Each planned downtime must have a different name'), '', true);
$result['message'] = ui_print_error_message(__('Each scheduled downtime must have a different name'), '', true);
return $result;
}
} else {
$result['message'] = ui_print_error_message(__('Planned downtime must have a name'), '', true);
$result['message'] = ui_print_error_message(__('Scheduled downtime must have a name'), '', true);
return $result;
}
@ -811,13 +811,13 @@ function planned_downtimes_created($values)
} else {
return [
'return' => false,
'message' => __('Each planned downtime must have a different name'),
'message' => __('Each scheduled downtime must have a different name'),
];
}
} else {
return [
'return' => false,
'message' => __('Planned downtime must have a name'),
'message' => __('Scheduled downtime must have a name'),
];
}
@ -904,16 +904,16 @@ function delete_planned_downtimes($filter)
$downtime_execute = db_get_row_filter('tplanned_downtime', ['id' => $filter['id_downtime']], 'execute');
if ($downtime_execute) {
$return = __("This planned downtime are executed now. Can't delete in this moment.");
$return = __("This scheduled downtime are executed now. Can't delete in this moment.");
} else {
$delete = db_process_sql_delete(
'tplanned_downtime',
['id' => $filter['id_downtime']]
);
if ($delete) {
$return = __('Deleted this planned downtime successfully.');
$return = __('Deleted this scheduled downtime successfully.');
} else {
$return = __('Problems for deleted this planned downtime.');
$return = __('Problems for deleted this scheduled downtime.');
}
}

View File

@ -849,7 +849,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
$table1->size[10] = '2%';
$table1->data[0][10] = '<img src ="'.$src.'images/square_light_gray.png">';
$table1->size[11] = '15%';
$table1->data[0][11] = '<span>'.__('Planned Downtime').'</span>';
$table1->data[0][11] = '<span>'.__('Scheduled Downtime').'</span>';
if ($pdf === 0) {
$table->colspan['legend']['cell'] = 2;
@ -4074,7 +4074,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$table2->size[10] = '2%';
$table2->data[0][10] = '<img src ="'.$src.$hack_metaconsole.'images/square_light_gray.png">';
$table2->size[11] = '15%';
$table2->data[0][11] = '<span>'.__('Planned Downtime').'</span>';
$table2->data[0][11] = '<span>'.__('Scheduled Downtime').'</span>';
}
if ($pdf !== 0) {
@ -5602,8 +5602,8 @@ function reporting_html_planned_downtimes_table($planned_downtimes)
$table = new StdClass();
$table->width = '99%';
$table->title = __('This SLA has been affected by the following planned downtimes').ui_print_help_tip(
__('If the duration of the planned downtime is less than 5 minutes it will not be represented in the graph'),
$table->title = __('This SLA has been affected by the following scheduled downtimes').ui_print_help_tip(
__('If the duration of the scheduled downtime is less than 5 minutes it will not be represented in the graph'),
true
);
$table->head = [];
@ -5641,7 +5641,7 @@ function reporting_html_planned_downtimes_table($planned_downtimes)
if ($downtime_malformed) {
$info_malformed = ui_print_error_message(
__('This item is affected by a malformed planned downtime').'. '.__('Go to the planned downtimes section to solve this').'.',
__('This item is affected by a malformed scheduled downtime').'. '.__('Go to the scheduled downtimes section to solve this').'.',
'',
true
);

View File

@ -1428,7 +1428,7 @@ function update_manager_check_online_free_packages($is_ajax=true)
var mr_available_header = "<?php echo __('There are db changes'); ?>\n";
var text1_mr_file = "<?php echo __('There are new database changes available to apply. Do you want to start the DB update process?'); ?>\n";
var text2_mr_file = "<?php echo __('We recommend launching '); ?>\n";
var text3_mr_file = "<?php echo __('planned downtime'); ?>\n";
var text3_mr_file = "<?php echo __('Scheduled downtime'); ?>\n";
var language = "<?php echo $config['language']; ?>";
var docsUrl = (language === "es")

View File

@ -808,9 +808,9 @@ foreach ($agents as $agent) {
if ($in_planned_downtime) {
$data[0] .= ui_print_help_tip(
__('Agent in planned downtime'),
__('Agent in scheduled downtime'),
true,
$config['image']['minireloj_16']
'images/minireloj-16.png'
);
$data[0] .= '</em>';
}

View File

@ -137,7 +137,7 @@ if ($agent['disabled']) {
if ($in_planned_downtime && !$agent['disabled'] && !$agent['quiet']) {
$agent_name .= '<em>&nbsp;'.ui_print_help_tip(
__('Agent in planned downtime'),
__('Agent in scheduled downtime'),
true,
'images/minireloj-16.png'
).'</em>';
@ -145,7 +145,7 @@ if ($in_planned_downtime && !$agent['disabled'] && !$agent['quiet']) {
|| ($in_planned_downtime && !$agent['quiet'])
) {
$agent_name .= '&nbsp;'.ui_print_help_tip(
__('Agent in planned downtime'),
__('Agent in scheduled downtime'),
true,
'images/minireloj-16.png'
).'</em>';

View File

@ -95,7 +95,7 @@ if (!$agents || !$searchAgents) {
);
if ($in_planned_downtime) {
$cellName .= '<em>'.ui_print_help_tip(__('Agent in planned downtime'), true, 'images/minireloj-16.png');
$cellName .= '<em>'.ui_print_help_tip(__('Agent in scheduled downtime'), true, 'images/minireloj-16.png');
$cellName .= '</em>';
}