From 2fd6130a150291dea66d6ba20031bbccfe363f3e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 6 Nov 2020 18:55:19 +0000 Subject: [PATCH] Bug 26960: Move batch item modification template JavaScript to the footer This patch modifies the batch item modification template so that the JavaScript is in the footer, conforming with best practices. The items form can contain [% Asset.css("css/addbiblio.css") | $raw %] [% Asset.css("css/humanmsg.css") | $raw %] -[% INCLUDE 'select2.inc' %] @@ -327,7 +275,6 @@ [% ELSE %] ... [% END %] - [% mv.javascript | $raw %] [% ELSIF ( mv.type == 'text' ) %] [% ELSIF ( mv.type == 'hidden' ) %] @@ -411,4 +358,73 @@ [% END #/IF show %] + + [% MACRO jsinclude BLOCK %] + [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] + [% Asset.js("js/background-job-progressbar.js") | $raw %] + [% Asset.js("js/cataloging.js") | $raw %] + [% INCLUDE 'datatables.inc' %] + [% Asset.js("js/pages/batchMod.js") | $raw %] + [% INCLUDE 'select2.inc' %] + + [% IF ( show ) %] + [%- # Loop over fields which may have plugin JavaScript -%] + [%- UNLESS (too_many_items_process) -%] + [%- FOREACH ite IN item -%] + [% SET mv = ite.marc_value %] + [%- IF ( mv.type == 'text2' ) -%] + + [% mv.javascript | $raw %] + [%- END -%] + [%- END -%] + [%- END -%] + [%- END -%] + [% END %] + [% INCLUDE 'intranet-bottom.inc' %] -- 2.11.0