add confirm dialog on meta and node recursive

This commit is contained in:
marcos 2020-06-04 13:50:36 +02:00
parent 4904718c41
commit 67d5a28346
1 changed files with 140 additions and 105 deletions

View File

@ -712,8 +712,7 @@ function update_event(table, id_evento, type, event_rep, row) {
values[this.name] = $(this).val();
});
var t1 = new Date();
console.log("al ajax directo");
// Update events matching current filters and id_evento selected.
$.ajax({
async: true,
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) {
var button = document.getElementById("val-" + id_evento);
@ -791,14 +791,16 @@ function delete_event(table, id_evento, event_rep, row) {
processed += 1;
return;
}
button.children[0];
button.children[0].src = "images/spinner.gif";
var message =
"<h4 style = 'text-align: center; color: black;' > Are you sure?</h4> ";
confirmDialog({
title: "ATTENTION",
message:
"<h4 style='text-align: center;padding-top: 20px;'>Are you sure?</h4>",
message: message,
cancel: "Cancel",
ok: "Ok",
onAccept: function() {
// Continue execution.
button.children[0];
button.children[0].src = "images/spinner.gif";
return update_event(
@ -808,12 +810,38 @@ function delete_event(table, id_evento, event_rep, row) {
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].src = "images/spinner.gif";
return update_event(table, id_evento, { delete_event: 1 }, event_rep, row);
}
// Imported from old files.
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;
$("#max_custom_event_resp_msg").hide();
$("#max_custom_selected").hide();
@ -907,8 +935,9 @@ function execute_event_response(event_list_btn) {
});
break;
case "delete_selected":
console.log($(this));
$(".chk_val:checked").each(function() {
delete_event(
execute_delete_event_reponse(
dt_events,
$(this).val(),
$(this).attr("event_rep"),
@ -918,6 +947,12 @@ function execute_event_response(event_list_btn) {
break;
}
}
},
onDeny: function() {
processed += 1;
return;
}
});
}
function check_massive_response_event(