Merge branch 'ent-5769-borrado-de-eventos-no-pide-confirmacion' into 'develop'

Ent 5769 borrado de eventos no pide confirmacion

See merge request artica/pandorafms!3271
This commit is contained in:
Daniel Rodriguez 2020-07-14 11:04:03 +02:00
commit 76828ba745
1 changed files with 146 additions and 98 deletions

View File

@ -713,7 +713,6 @@ function update_event(table, id_evento, type, event_rep, row) {
}); });
var t1 = new Date(); var t1 = new Date();
// Update events matching current filters and id_evento selected.
$.ajax({ $.ajax({
async: true, async: true,
type: "POST", type: "POST",
@ -751,6 +750,7 @@ function update_event(table, id_evento, type, event_rep, row) {
} }
}); });
} }
// Update events matching current filters and id_evento selected.
function validate_event(table, id_evento, event_rep, row) { function validate_event(table, id_evento, event_rep, row) {
var button = document.getElementById("val-" + id_evento); var button = document.getElementById("val-" + id_evento);
@ -791,7 +791,39 @@ function delete_event(table, id_evento, event_rep, row) {
processed += 1; processed += 1;
return; return;
} }
var message =
"<h4 style = 'text-align: center; color: black;' > Are you sure?</h4> ";
confirmDialog({
title: "ATTENTION",
message: message,
cancel: "Cancel",
ok: "Ok",
onAccept: function() {
button.children[0];
button.children[0].src = "images/spinner.gif";
return update_event(
table,
id_evento,
{ delete_event: 1 },
event_rep,
row
);
},
onDeny: function() {
button.children[0];
button.children[0].src = "images/cross.png";
return;
}
});
}
function execute_delete_event_reponse(table, id_evento, event_rep, row) {
var button = document.getElementById("del-" + id_evento);
if (!button) {
// Button does not exist. Ignore.
processed += 1;
return;
}
button.children[0]; button.children[0];
button.children[0].src = "images/spinner.gif"; button.children[0].src = "images/spinner.gif";
return update_event(table, id_evento, { delete_event: 1 }, event_rep, row); return update_event(table, id_evento, { delete_event: 1 }, event_rep, row);
@ -799,6 +831,15 @@ function delete_event(table, id_evento, event_rep, row) {
// Imported from old files. // Imported from old files.
function execute_event_response(event_list_btn) { function execute_event_response(event_list_btn) {
var message =
"<h4 style = 'text-align: center; color: black;' > Are you sure?</h4> ";
confirmDialog({
title: "ATTENTION",
message: message,
cancel: "Cancel",
ok: "Ok",
onAccept: function() {
// Continue execution.
processed = 0; processed = 0;
$("#max_custom_event_resp_msg").hide(); $("#max_custom_event_resp_msg").hide();
$("#max_custom_selected").hide(); $("#max_custom_selected").hide();
@ -892,8 +933,9 @@ function execute_event_response(event_list_btn) {
}); });
break; break;
case "delete_selected": case "delete_selected":
console.log($(this));
$(".chk_val:checked").each(function() { $(".chk_val:checked").each(function() {
delete_event( execute_delete_event_reponse(
dt_events, dt_events,
$(this).val(), $(this).val(),
$(this).attr("event_rep"), $(this).attr("event_rep"),
@ -903,6 +945,12 @@ function execute_event_response(event_list_btn) {
break; break;
} }
} }
},
onDeny: function() {
processed += 1;
return;
}
});
} }
function check_massive_response_event( function check_massive_response_event(