Bug 15868: Ask for confirmation when deleting a MMT action

Test plan:
Create marc modification template
Add an action
Delete it
With this patch you must get a confirmation mesg

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
Julian Maurice 2016-04-07 07:43:21 +02:00
parent 887bb8c92f
commit 9fddbc045d
1 changed files with 6 additions and 3 deletions

View File

@ -194,9 +194,12 @@ function clearFormElements(divId) {
}
function confirmDeleteAction() {
return confirm(_("Are you sure you wish to delete this template action?"));
}
function confirmDelete() {
var agree = confirm(_("Are you sure you wish to delete this template?"));
return agree;
return confirm(_("Are you sure you wish to delete this template?"));
}
var modaction_legend_innerhtml;
@ -443,7 +446,7 @@ function setSelectByValue( selectId, value ) {
"[% ActionsLoo.conditional_regex |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]",
"[% ActionsLoo.description |replace('\\\\', '\\\\') |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
);updateAllEvery();'>Edit</a></td>
<td><a href="marc_modification_templates.pl?template_id=[% ActionsLoo.template_id %]&op=delete_action&mmta_id=[% ActionsLoo.mmta_id %]">Delete</a></td>
<td><a href="marc_modification_templates.pl?template_id=[% ActionsLoo.template_id %]&op=delete_action&mmta_id=[% ActionsLoo.mmta_id %]" onclick="return confirmDeleteAction();">Delete</a></td>
</tr>
[% END %]
</table>