Fixed: No confirm on delete permanently (footer button), saved histories

This commit is contained in:
Aysam Guerler
2013-03-15 14:32:30 -04:00
parent 3aa6a5fdaa
commit 3dd22cf745
3 changed files with 28 additions and 2 deletions
+24
View File
@@ -541,4 +541,28 @@ function check_all_items() {
}
}
init_grid_elements();
}
// confirmation/submission of operation request
function submit_operation(selected_button, confirmation_text)
{
// verify in any item is selected
var number_of_checked_ids = $('input[name="id"]:checked').length;
if (!number_of_checked_ids > 0)
return false;
// show confirmation box
if (confirmation_text != 'None' && confirmation_text != '')
if(!confirm(confirmation_text))
return false;
// set up hidden field to parse the command/operation to controller
$('#operation').val(selected_button.value);
// submit form
selected_button.form.submit();
// return
return true;
}
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -459,12 +459,14 @@
## Grid operations for multiple items.
%if show_item_checkboxes:
<tr>
## place holder for multiple operation commands
<input type="hidden" id="operation" name="operation" value="">
<td></td>
<td colspan="100">
For <span class="grid-selected-count"></span> selected ${items_plural}:
%for operation in grid.operations:
%if operation.allow_multiple:
<input type="submit" name="operation" value="${operation.label}" class="action-button">
<input type="button" value="${operation.label}" class="action-button" onclick="submit_operation(this, '${operation.confirm}')">
%endif
%endfor
</td>