diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt index f86cad491b..ae80e0946b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt @@ -269,8 +269,11 @@ [% ELSIF view == 'errors' %] [% FOR error IN errors %] [% IF error == 'no_template_defined' %] -
- No MARC modification template is defined. You have to create at least one template for using this tool. +
+

No MARC modification template is defined. You have to create at least one template in order to use this tool.

+ [% IF ( CAN_user_tools_marc_modification_templates ) %] + Create a new MARC modification template + [% END %]
[% END %] [% END %] 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 53e80a5d88..01c1bfc44f 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 @@ -70,7 +70,7 @@
New template [% IF ( template_id != '' ) %] - New action + New action Delete template [% END %]
@@ -208,7 +208,10 @@
[% ELSE %] -

There are no defined actions for this template.

+
+

There are no defined actions for this template.

+

New action

+
[% END # /IF ActionsLoop %]
@@ -307,7 +310,10 @@ [% ELSE %]

MARC modification templates

-

There are no defined templates. Please create a template first.

+
+

There are no defined templates. Please create a template first.

+ Create a new template +
[% END # /IF TemplatesLoop %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js index e513fbe896..847f88c009 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js +++ b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js @@ -68,9 +68,10 @@ $(document).ready(function() { updateAllEvery(); }); - $("#new_action").on("click",function(e){ + $(".new_action").on("click",function(e){ e.preventDefault(); cancelEditAction(); + $("#no_defined_actions").hide(); $("#add_action").show(); $("#action").focus(); }); @@ -350,6 +351,11 @@ function cancelEditAction() { document.getElementById('modaction_legend').innerHTML = window.modaction_legend_innerhtml; document.getElementById('action_submit').value = window.action_submit_value; + + if( $("#template_actions").length < 1 ){ + $("#no_defined_actions").show(); + } + $("#add_action").hide(); }