Bug 15868: Ask for confirmation when deleting a MMT action
authorJulian Maurice <julian.maurice@biblibre.com>
Thu, 7 Apr 2016 05:43:21 +0000 (07:43 +0200)
committerFrédéric Demians <f.demians@tamil.fr>
Wed, 27 Apr 2016 14:30:33 +0000 (16:30 +0200)
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>
(cherry picked from commit 9fddbc045da2dc25389e924262bd8f6e2bc99bfd)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>

koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt

index 5659021..5b90274 100644 (file)
@@ -188,9 +188,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;
@@ -436,7 +439,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>