Bug 15868: Ask for confirmation when deleting a MMT action
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 8 Mar 2016 11:07:43 +0000 (11:07 +0000)
committerBrendan Gallagher <brendan@bywatersolutions.com>
Tue, 22 Mar 2016 00:15:42 +0000 (00:15 +0000)
Test plan:
Create marc modification template
Add an action
Delete it
With this patch you must get a confirmation mesg

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
koha-tmpl/intranet-tmpl/prog/en/js/marc_modification_templates.js
koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt

index 185afa8..9353637 100644 (file)
@@ -185,9 +185,12 @@ function clearFormElements(divId) {
 
 }
 
+function confirmDeleteAction() {
+    return confirm( MSG_MMT_CONFIRM_DEL_TEMPLATE_ACTION );
+}
+
 function confirmDelete() {
-    var agree = confirm( MSG_MMT_CONFIRM_DEL_TEMPLATE );
-    return agree;
+    return confirm( MSG_MMT_CONFIRM_DEL_TEMPLATE );
 }
 
 var modaction_legend_innerhtml;
@@ -285,4 +288,4 @@ function setSelectByValue( selectId, value ) {
             s.selectedIndex = i;
         }
     }
-}
\ No newline at end of file
+}
index e621de2..1086670 100644 (file)
@@ -11,7 +11,8 @@
     var MSG_MMT_SOURCE_FIELD = _("The source field should be filled.");
     var MSG_MMT_EVERY = _("Every");
     var MSG_MMT_ALL = _("All");
-    var MSG_MMT_CONFIRM_DEL_TEMPLATE= _("Are you sure you wish to delete this template?");
+    var MSG_MMT_CONFIRM_DEL_TEMPLATE = _("Are you sure you wish to delete this template?");
+    var MSG_MMT_CONFIRM_DEL_TEMPLATE_ACTION = _("Are you sure you wish to delete this template action?");
     var MSG_MMT_EDIT_ACTION = _("Edit action %s");
     var MSG_MMT_UPDATE_ACTION = _("Update action");
     //]]>
                                                     "[% 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>