Bug 26960 - Move batch item modification template JavaScript to the footer
Summary: Move batch item modification template JavaScript to the footer
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 26959
Blocks:
  Show dependency treegraph
 
Reported: 2020-11-06 18:36 UTC by Owen Leonard
Modified: 2022-06-06 20:25 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Circulation function:


Attachments
Bug 26960: Move batch item modification template JavaScript to the footer (8.30 KB, patch)
2020-11-06 20:02 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26960: Move batch item modification template JavaScript to the footer (8.30 KB, patch)
2021-02-03 15:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26960: Move batch item modification template JavaScript to the footer (8.35 KB, patch)
2021-02-25 00:59 UTC, David Nind
Details | Diff | Splinter Review
Bug 26960: Move batch item modification template JavaScript to the footer (8.41 KB, patch)
2021-02-28 17:28 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2020-11-06 18:36:53 UTC
In order to conform to best practices for performance, staff client template JavaScript should be in the footer instead of the header.

This patch will do so for the batch item modification template.
Comment 1 Owen Leonard 2020-11-06 20:02:55 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2021-02-03 15:03:37 UTC
Created attachment 116266 [details] [review]
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 <script> tags injected by cataloging plugins.
These are moved from the body of the page into the footer be repeating
the template loop that previously output the script tag.

To test, apply the patch and test the process of submitting items for
batch modification.

After submitting a batch of items, test the "Edit items" form.
Confirm that JavaScript-dependent interactions work correctly:

 - Select2-styled dropdowns
 - RegEx checkboxes
 - Datepicker
 - Plugins like:
   - dateaccessioned.pl on 952d
   - stocknumberam123.pl on 952i
   - callnumber.pl on 952o
Comment 3 David Nind 2021-02-25 00:59:34 UTC
Created attachment 117285 [details] [review]
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 <script> tags injected by cataloging plugins.
These are moved from the body of the page into the footer be repeating
the template loop that previously output the script tag.

To test, apply the patch and test the process of submitting items for
batch modification.

After submitting a batch of items, test the "Edit items" form.
Confirm that JavaScript-dependent interactions work correctly:

 - Select2-styled dropdowns
 - RegEx checkboxes
 - Datepicker
 - Plugins like:
   - dateaccessioned.pl on 952d
   - stocknumberam123.pl on 952i
   - callnumber.pl on 952o

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 Katrin Fischer 2021-02-28 17:28:07 UTC
Created attachment 117417 [details] [review]
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 <script> tags injected by cataloging plugins.
These are moved from the body of the page into the footer be repeating
the template loop that previously output the script tag.

To test, apply the patch and test the process of submitting items for
batch modification.

After submitting a batch of items, test the "Edit items" form.
Confirm that JavaScript-dependent interactions work correctly:

 - Select2-styled dropdowns
 - RegEx checkboxes
 - Datepicker
 - Plugins like:
   - dateaccessioned.pl on 952d
   - stocknumberam123.pl on 952i
   - callnumber.pl on 952o

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2021-02-28 17:29:18 UTC
This works well in my tests. 

There is only one small glitch: with and without the patch the pull down for the Yes/No for local holds priority is too short to fit the text. Not relevant for this patch.
Comment 6 Jonathan Druart 2021-03-04 16:25:22 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 7 Fridolin Somers 2021-03-08 15:39:09 UTC
Enhancement not pushed to 20.11.x