mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-06 21:44:53 +02:00
Avoid double validation, avoid redraw
This commit is contained in:
parent
ecc2fef8f6
commit
d12773cfd0
@ -669,7 +669,7 @@ function show_event_response_command_dialog(id, response, total_checked) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function update_event(table, id_evento, type) {
|
function update_event(table, id_evento, type, redraw) {
|
||||||
var inputs = $("#events_form :input");
|
var inputs = $("#events_form :input");
|
||||||
var values = {};
|
var values = {};
|
||||||
inputs.each(function() {
|
inputs.each(function() {
|
||||||
@ -688,20 +688,22 @@ function update_event(table, id_evento, type) {
|
|||||||
filter: values
|
filter: values
|
||||||
},
|
},
|
||||||
success: function() {
|
success: function() {
|
||||||
table.draw().page(0);
|
if (redraw) {
|
||||||
|
table.draw().page(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function validate_event(table, id_evento) {
|
function validate_event(table, id_evento) {
|
||||||
return update_event(table, id_evento, { validate_event: 1 });
|
return update_event(table, id_evento, { validate_event: 1 }, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function in_process_event(table, id_evento) {
|
function in_process_event(table, id_evento) {
|
||||||
return update_event(table, id_evento, { in_process_event: 1 });
|
return update_event(table, id_evento, { in_process_event: 1 }, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
function delete_event(table, id_evento, row) {
|
function delete_event(table, id_evento) {
|
||||||
$(row)
|
$(row)
|
||||||
.closest("tr")
|
.closest("tr")
|
||||||
.remove();
|
.remove();
|
||||||
|
@ -1428,7 +1428,7 @@ function process_datatables_item(item) {
|
|||||||
item.options += ')" ><?php echo html_print_image('images/eye.png', true, ['title' => __('Show more')]); ?></a>';
|
item.options += ')" ><?php echo html_print_image('images/eye.png', true, ['title' => __('Show more')]); ?></a>';
|
||||||
|
|
||||||
// Validate.
|
// Validate.
|
||||||
item.options += '<a href="javascript:" onclick="validate_event(dt_<?php echo $table_id; ?>,';
|
item.options += '<a href="javascript:" onclick="$(this).hide(); validate_event(dt_<?php echo $table_id; ?>,';
|
||||||
if (item.max_id_evento) {
|
if (item.max_id_evento) {
|
||||||
item.options += item.max_id_evento+')" >';
|
item.options += item.max_id_evento+')" >';
|
||||||
item.options += '<?php echo html_print_image('images/tick.png', true, ['title' => __('Validate events')]); ?></a>';
|
item.options += '<?php echo html_print_image('images/tick.png', true, ['title' => __('Validate events')]); ?></a>';
|
||||||
@ -1438,7 +1438,7 @@ function process_datatables_item(item) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// In process.
|
// In process.
|
||||||
item.options += '<a href="javascript:" onclick="in_process_event(dt_<?php echo $table_id; ?>,';
|
item.options += '<a href="javascript:" onclick="$(this).hide(); in_process_event(dt_<?php echo $table_id; ?>,';
|
||||||
if (item.max_id_evento) {
|
if (item.max_id_evento) {
|
||||||
item.options += item.max_id_evento+')" >';
|
item.options += item.max_id_evento+')" >';
|
||||||
} else {
|
} else {
|
||||||
@ -1447,7 +1447,7 @@ function process_datatables_item(item) {
|
|||||||
item.options += '<?php echo html_print_image('images/hourglass.png', true, ['title' => __('Change to in progress status')]); ?></a>';
|
item.options += '<?php echo html_print_image('images/hourglass.png', true, ['title' => __('Change to in progress status')]); ?></a>';
|
||||||
|
|
||||||
// Delete.
|
// Delete.
|
||||||
item.options += '<a href="javascript:" onclick="delete_event(dt_<?php echo $table_id; ?>,';
|
item.options += '<a href="javascript:" onclick="$(this).hide(); delete_event(dt_<?php echo $table_id; ?>,';
|
||||||
if (item.max_id_evento) {
|
if (item.max_id_evento) {
|
||||||
item.options += item.max_id_evento+', this)" >';
|
item.options += item.max_id_evento+', this)" >';
|
||||||
item.options += '<?php echo html_print_image('images/cross.png', true, ['title' => __('Delete events')]); ?></a>';
|
item.options += '<?php echo html_print_image('images/cross.png', true, ['title' => __('Delete events')]); ?></a>';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user