Merge branch 'ent-11087-15509-no-se-puede-editar-elementos-en-paradas-planificadas-el-boton-no-funciona' into 'develop'

Ent 11087 15509 no se puede editar elementos en paradas planificadas el boton no funciona

See merge request artica/pandorafms!5849
This commit is contained in:
Diego Muñoz-Reja 2023-05-18 11:57:57 +00:00
commit 3e3faaf922
1 changed files with 8 additions and 10 deletions

View File

@ -1430,10 +1430,10 @@ ui_print_spinner('Loading');
$table = new stdClass(); $table = new stdClass();
$table->id = 'editor'; $table->id = 'editor';
$table->width = '100%'; $table->width = '100%';
$table->colspan['module'][1] = '5'; $table->colspan['module'][1] = '6';
$table->data = []; $table->data = [];
$table->data['module'] = []; $table->data['module'] = [];
$table->data['module'][0] = ''; // $table->data['module'][0] = '';
$table->data['module'][1] = '<h4>'.__('Modules').'</h4>'; $table->data['module'][1] = '<h4>'.__('Modules').'</h4>';
// List of modules, empty, it is populated by javascript. // List of modules, empty, it is populated by javascript.
@ -1457,7 +1457,7 @@ $table->data['module'][1] = "
[ [
'border' => '0', 'border' => '0',
'alt' => __('Delete'), 'alt' => __('Delete'),
'class' => 'invert_filter', 'class' => 'main_menu_icon invert_filter',
] ]
).'</a>'."</td> ).'</a>'."</td>
</tr> </tr>
@ -1779,7 +1779,6 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
//Avoid freak states. //Avoid freak states.
if (action_in_progress) if (action_in_progress)
return; return;
//Check if the row editor module exists //Check if the row editor module exists
if ($('#loading_' + id_agent).length > 0) { if ($('#loading_' + id_agent).length > 0) {
//The row exists //The row exists
@ -1789,7 +1788,6 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
if ($('#module_editor_' + id_agent).length == 0) { if ($('#module_editor_' + id_agent).length == 0) {
$("#list-agent_" + id_agent).after( $("#list-agent_" + id_agent).after(
$("#loading-loading").clone().attr('id', 'loading_' + id_agent)); $("#loading-loading").clone().attr('id', 'loading_' + id_agent));
jQuery.post ('ajax.php', jQuery.post ('ajax.php',
{"page": "include/ajax/planned_downtime.ajax", {"page": "include/ajax/planned_downtime.ajax",
"get_modules_downtime": 1, "get_modules_downtime": 1,
@ -1799,15 +1797,15 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
function (data) { function (data) {
if (data['correct']) { if (data['correct']) {
//Check if the row editor module exists //Check if the row editor module exists
if ($('#loading_' + id_agent).length > 0) { if ($('#list-agent_' + id_agent).length > 0) {
//The row exists //The row exists
$('#loading_' + id_agent).remove(); //$('#loading_' + id_agent).remove();
$("#list-agent_" + id_agent).after( $("#list-agent_" + id_agent).after(
$("#editor-module").clone() $("#editor-module").clone()
.attr('id', 'module_editor_' + id_agent) .attr('id', 'module_editor_' + id_agent)
.hide()); .hide());
fill_row_editor(id_agent, data); fill_row_editor(id_agent, data);
} }
} }
@ -2039,7 +2037,7 @@ function insert_downtime_agent($id_downtime, $user_groups_ad)
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 scheduled 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();