From 009d287a7389b9e271db366d245b18d9420e66ec Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 8 Mar 2016 11:07:43 +0000 Subject: [PATCH] [SIGNED-OFF] Bug 15868: Ask for confirmation when deleting a MMT action Content-Type: text/plain; charset="utf-8" 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 --- .../intranet-tmpl/prog/en/js/marc_modification_templates.js | 9 ++++++--- .../prog/en/modules/tools/marc_modification_templates.tt | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/marc_modification_templates.js b/koha-tmpl/intranet-tmpl/prog/en/js/marc_modification_templates.js index 185afa8..9353637 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/marc_modification_templates.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/marc_modification_templates.js @@ -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 +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt index e621de2..1086670 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt @@ -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"); //]]> @@ -162,7 +163,7 @@ "[% 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 - Delete + Delete [% END %] -- 2.1.4