Merge branch 'ent-7096-unificar-nombres-downtimes' into 'develop'

Unified downtime name as scheduled downtime

See merge request artica/pandorafms!4001
This commit is contained in:
Daniel Rodriguez 2021-05-10 09:06:43 +00:00
commit 6faefa4afa
15 changed files with 42 additions and 42 deletions

View File

@ -15,14 +15,14 @@ global $config;
check_login(); check_login();
ui_require_css_file('first_task'); 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="new_task">
<div class="image_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>
<div class="text_task"> <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 <?php
echo __( echo __(
"%s contains a scheduled downtime management system. "%s contains a scheduled downtime management system.
@ -34,7 +34,7 @@ ui_require_css_file('first_task');
?> ?>
</p> </p>
<form action="index.php?sec=extensions&amp;sec2=godmode/agentes/planned_downtime.editor" method="post"> <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> </form>
</div> </div>
</div> </div>

View File

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

View File

@ -64,7 +64,7 @@ $buttons = [
// Header. // Header.
ui_print_page_header( ui_print_page_header(
__('Planned Downtime'), __('Scheduled Downtime'),
'images/gm_monitoring.png', 'images/gm_monitoring.png',
false, false,
'', '',
@ -308,12 +308,12 @@ if ($create_downtime || $update_downtime) {
); );
} else { } else {
ui_print_error_message( ui_print_error_message(
__('Each planned downtime must have a different name') __('Each scheduled downtime must have a different name')
); );
} }
} else { } else {
ui_print_error_message( ui_print_error_message(
__('Planned downtime must have a name') __('Scheduled downtime must have a name')
); );
} }
} else if ($update_downtime) { } else if ($update_downtime) {
@ -345,7 +345,7 @@ if ($create_downtime || $update_downtime) {
$values = []; $values = [];
if (trim(io_safe_output($name)) == '') { if (trim(io_safe_output($name)) == '') {
ui_print_error_message( 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"); $(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 type_execution = "<?php echo $type_execution; ?>";
var datetime_from = <?php echo json_encode(strtotime($once_date_from.' '.$once_time_from)); ?>; var datetime_from = <?php echo json_encode(strtotime($once_date_from.' '.$once_time_from)); ?>;
var datetime_now = <?php echo json_encode($utimestamp); ?>; var datetime_now = <?php echo json_encode($utimestamp); ?>;
var create = <?php echo json_encode($create); ?>; var create = <?php echo json_encode($create); ?>;
if (!create && (type_execution == 'periodically' || (type_execution == 'once' && datetime_from < datetime_now))) { 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) { $("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(); e.preventDefault();
} }
}); });

View File

@ -196,5 +196,5 @@ if (!empty($downtimes)) {
echo chr(13); echo chr(13);
} }
} else { } 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) { if ($migration_result['status'] == false) {
ui_print_error_message( 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>'; echo '<br>';
} }
@ -80,7 +80,7 @@ if ($stop_downtime) {
$result = planned_downtimes_stop($downtime); $result = planned_downtimes_stop($downtime);
if ($result === false) { 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 { } else {
echo $result['message']; echo $result['message'];
} }
@ -103,7 +103,7 @@ if ($delete_downtime) {
// The downtime shouldn't be running!! // The downtime shouldn't be running!!
if ($downtime['executed']) { if ($downtime['executed']) {
ui_print_error_message(__('This planned downtime is running')); ui_print_error_message(__('This scheduled downtime is running'));
} else { } else {
$result = db_process_sql_delete('tplanned_downtime', ['id' => $id_downtime]); $result = db_process_sql_delete('tplanned_downtime', ['id' => $id_downtime]);
@ -362,7 +362,7 @@ else if (!$downtimes) {
echo '</form>'; echo '</form>';
// Info message. // Info message.
echo '<div class="nf">'.__('No planned downtime').'</div>'; echo '<div class="nf">'.__('No scheduled downtime').'</div>';
echo '<div class="action-buttons w100p" >'; echo '<div class="action-buttons w100p" >';
@ -572,13 +572,13 @@ $(document).ready (function () {
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]); $.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
$("a#delete_downtime").click(function (e) { $("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(); e.preventDefault();
} }
}); });
if (<?php echo json_encode($malformed_downtimes_exist); ?> && <?php echo json_encode($migrate_malformed == false); ?>) { 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"; 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'] = isset(
$config['past_planned_downtimes'] $config['past_planned_downtimes']
) ? $config['past_planned_downtimes'] : 1; ) ? $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( $table->data[$i++][1] = html_print_checkbox_switch(
'past_planned_downtimes', 'past_planned_downtimes',
1, 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 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 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 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 language = "<?php echo $config['language']; ?>";
var docsUrl = (language === "es") var docsUrl = (language === "es")

View File

@ -6717,7 +6717,7 @@ function api_set_stop_downtime($id, $thrash1, $other, $thrash3)
$data = db_get_row_sql($sql); $data = db_get_row_sql($sql);
if ($data['type_execution'] == 'periodically' && $data['executed'] == 1) { 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; return;
} }
@ -7203,7 +7203,7 @@ function api_set_planned_downtimes_additem($id, $thrash1, $other, $thrash3)
} }
if (empty($agents)) { if (empty($agents)) {
returnError('No agents to create planned downtime items'); returnError('No agents to create scheduled downtime items');
} else { } else {
if (!empty($returned['bad_modules'])) { if (!empty($returned['bad_modules'])) {
$bad_modules = __("and this modules are doesn't exists or not applicable a this agents: ").implode(', ', $returned['bad_modules']); $bad_modules = __("and this modules are doesn't exists or not applicable a this agents: ").implode(', ', $returned['bad_modules']);

View File

@ -319,7 +319,7 @@ function config_update_config()
} }
if (!config_update_value('past_planned_downtimes', get_parameter('past_planned_downtimes'))) { 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'))) { 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']); $name_exists = (bool) db_get_value('id', 'tplanned_downtime', 'name', $values['name']);
if ($name_exists) { 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; return $result;
} }
} else { } 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; return $result;
} }
@ -811,13 +811,13 @@ function planned_downtimes_created($values)
} else { } else {
return [ return [
'return' => false, 'return' => false,
'message' => __('Each planned downtime must have a different name'), 'message' => __('Each scheduled downtime must have a different name'),
]; ];
} }
} else { } else {
return [ return [
'return' => false, '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'); $downtime_execute = db_get_row_filter('tplanned_downtime', ['id' => $filter['id_downtime']], 'execute');
if ($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 { } else {
$delete = db_process_sql_delete( $delete = db_process_sql_delete(
'tplanned_downtime', 'tplanned_downtime',
['id' => $filter['id_downtime']] ['id' => $filter['id_downtime']]
); );
if ($delete) { if ($delete) {
$return = __('Deleted this planned downtime successfully.'); $return = __('Deleted this scheduled downtime successfully.');
} else { } else {
$return = __('Problems for deleted this planned downtime.'); $return = __('Problems for deleted this scheduled downtime.');
} }
} }

View File

@ -856,7 +856,7 @@ function reporting_html_SLA($table, $item, $mini, $pdf=0)
$table1->size[10] = '2%'; $table1->size[10] = '2%';
$table1->data[0][10] = '<img src ="'.$src.'images/square_light_gray.png">'; $table1->data[0][10] = '<img src ="'.$src.'images/square_light_gray.png">';
$table1->size[11] = '15%'; $table1->size[11] = '15%';
$table1->data[0][11] = '<span>'.__('Planned Downtime').'</span>'; $table1->data[0][11] = '<span>'.__('Scheduled Downtime').'</span>';
if ($pdf === 0) { if ($pdf === 0) {
$table->colspan['legend']['cell'] = 2; $table->colspan['legend']['cell'] = 2;
@ -4081,7 +4081,7 @@ function reporting_html_availability_graph($table, $item, $pdf=0)
$table2->size[10] = '2%'; $table2->size[10] = '2%';
$table2->data[0][10] = '<img src ="'.$src.$hack_metaconsole.'images/square_light_gray.png">'; $table2->data[0][10] = '<img src ="'.$src.$hack_metaconsole.'images/square_light_gray.png">';
$table2->size[11] = '15%'; $table2->size[11] = '15%';
$table2->data[0][11] = '<span>'.__('Planned Downtime').'</span>'; $table2->data[0][11] = '<span>'.__('Scheduled Downtime').'</span>';
} }
if ($pdf !== 0) { if ($pdf !== 0) {
@ -5609,8 +5609,8 @@ function reporting_html_planned_downtimes_table($planned_downtimes)
$table = new StdClass(); $table = new StdClass();
$table->width = '99%'; $table->width = '99%';
$table->title = __('This SLA has been affected by the following planned downtimes').ui_print_help_tip( $table->title = __('This SLA has been affected by the following scheduled 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'), __('If the duration of the scheduled downtime is less than 5 minutes it will not be represented in the graph'),
true true
); );
$table->head = []; $table->head = [];
@ -5648,7 +5648,7 @@ function reporting_html_planned_downtimes_table($planned_downtimes)
if ($downtime_malformed) { if ($downtime_malformed) {
$info_malformed = ui_print_error_message( $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 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 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 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 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 language = "<?php echo $config['language']; ?>";
var docsUrl = (language === "es") var docsUrl = (language === "es")

View File

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

View File

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

View File

@ -95,7 +95,7 @@ if (!$agents || !$searchAgents) {
); );
if ($in_planned_downtime) { 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>'; $cellName .= '</em>';
} }