Bug 19623

Summary: Move template JavaScript to the footer: Cataloging
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, josef.moravec, katrin.fischer, nick, simon.pouchol, testopia
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25354
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 19608    
Bug Blocks: 17858    
Attachments: Bug 19623 - Move template JavaScript to the footer: Cataloging
Bug 19623 - Move template JavaScript to the footer: Cataloging
Bug 19623: (Follow-up) Correct footer include in pop-up windows
Bug 19623 - Move template JavaScript to the footer: Cataloging
Bug 19623: (Follow-up) Correct footer include in pop-up windows
Bug 19623: (QA follow-up) Add missing footerjs variable in merge.tt

Description Owen Leonard 2017-11-14 18:21:34 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 some cataloging templates: addbooks.tt, linkitem.tt, merge.tt, z3950_auth_search.tt, z3950_search.tt
Comment 1 Owen Leonard 2017-11-14 19:37:46 UTC Comment hidden (obsolete)
Comment 2 Claire Gravely 2017-11-15 15:27:47 UTC
Created attachment 69163 [details] [review]
Bug 19623 - Move template JavaScript to the footer: Cataloging

This patch modifies some staff client cataloging templates so that
JavaScript is included in the footer instead of the header.

Several cataloging templates are excluded because they require
significant structural changes: addbiblio.tt, additem.tt, and editor.tt

To test, apply the patch and test the JavaScript-driven features of the
modified templates: All button controls, DataTables functionality, tabs,
etc.

Note that z350_auth_search.tt is tested by performing a Z39.50 search
from the Authorities module.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Comment 3 Katrin Fischer 2017-12-21 23:13:50 UTC
With this patch applied, the Z39.50 search window remains empty. 
Owen, can you please check? Tested on kohadevbox with the sample data.
Comment 4 Owen Leonard 2017-12-22 13:42:52 UTC
Created attachment 70118 [details] [review]
Bug 19623: (Follow-up) Correct footer include in pop-up windows

This patch corrects the footer include in two templates for Z39.50
pop-up windows. popup-bottom.inc shouldn't be used because it doesn't
have the JavaScript embed code in it.

To test, perform a Z39.50 search from both the MARC bibliographic editor
and the MARC authority editor. In both cases the Z39.50 popup window
should work correctly.
Comment 5 Josef Moravec 2017-12-23 07:53:23 UTC
Created attachment 70144 [details] [review]
Bug 19623 - Move template JavaScript to the footer: Cataloging

This patch modifies some staff client cataloging templates so that
JavaScript is included in the footer instead of the header.

Several cataloging templates are excluded because they require
significant structural changes: addbiblio.tt, additem.tt, and editor.tt

To test, apply the patch and test the JavaScript-driven features of the
modified templates: All button controls, DataTables functionality, tabs,
etc.

Note that z350_auth_search.tt is tested by performing a Z39.50 search
from the Authorities module.

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 6 Josef Moravec 2017-12-23 07:53:30 UTC
Created attachment 70145 [details] [review]
Bug 19623: (Follow-up) Correct footer include in pop-up windows

This patch corrects the footer include in two templates for Z39.50
pop-up windows. popup-bottom.inc shouldn't be used because it doesn't
have the JavaScript embed code in it.

To test, perform a Z39.50 search from both the MARC bibliographic editor
and the MARC authority editor. In both cases the Z39.50 popup window
should work correctly.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 7 Josef Moravec 2017-12-23 07:53:36 UTC
Created attachment 70146 [details] [review]
Bug 19623: (QA follow-up) Add missing footerjs variable in merge.tt

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 8 Jonathan Druart 2017-12-26 15:53:46 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 9 Nick Clemens 2018-01-16 12:17:33 UTC
Enhancement, skipping for 17.11.x.
Awesome work everybody!