Bug 19709

Summary: Move template JavaScript to the footer: Labels
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: claire_gravely, dominic.pichette, jonathan.druart, katrin.fischer, martin.renvoize, nick, olivier.roure, simon.pouchol, testopia
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 19647, 20193    
Bug Blocks: 17858, 20641, 21050    
Attachments: Bug 19709 - Move template JavaScript to the footer: Labels
Bug 19709 - Move template JavaScript to the footer: Labels
Bug 19709 - Move template JavaScript to the footer: Labels
Bug 19709 - Move template JavaScript to the footer: Labels
Bug 19709 - Move template JavaScript to the footer: Labels
Bug 19709 (follow-up) Add KOHA_VERSION variables to js includes
Bug 19709 (follow-up) Add missing Greybox library files
Bug 19709: Move template JavaScript to the footer: Labels
Bug 19709: Move template JavaScript to the footer: Labels
Bug 19709: Move template JavaScript to the footer: Labels

Description Owen Leonard 2017-11-28 16:08:05 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 label creator templates.
Comment 1 Owen Leonard 2017-11-28 18:02:21 UTC Comment hidden (obsolete)
Comment 2 Claire Gravely 2017-12-07 10:10:18 UTC Comment hidden (obsolete)
Comment 3 Claire Gravely 2017-12-07 14:46:14 UTC
When creating/managing batches I had the following issues:

- clicking 'add items' without entering any barcodes opens an empty frame
- When exporting items or a batch, the 'cancel' link in the first frame doesn't work
- After exporting, the 'done' button doesn't work


The other parts seemed to be ok!
Comment 4 Owen Leonard 2018-01-11 17:12:49 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2018-01-11 17:13:35 UTC
(In reply to Claire Gravely from comment #3)
> - clicking 'add items' without entering any barcodes opens an empty frame

My updated patch fixes this.

> - When exporting items or a batch, the 'cancel' link in the first frame
> doesn't work
> - After exporting, the 'done' button doesn't work

I can't reproduce these problems. Can you please try again and let me know if it's still happening?
Comment 6 Claire Gravely 2018-02-09 09:22:44 UTC
(In reply to Owen Leonard from comment #5)
> (In reply to Claire Gravely from comment #3)
> > - clicking 'add items' without entering any barcodes opens an empty frame
> 
> My updated patch fixes this.

This is now working


> 
> > - When exporting items or a batch, the 'cancel' link in the first frame
> > doesn't work
> > - After exporting, the 'done' button doesn't work
> 
> I can't reproduce these problems. Can you please try again and let me know
> if it's still happening?


yep. I still have these issues. These are my steps
- From 'Manage' I go to 'Label Batches'
- select one of the batches and click 'Export selected'
- Click the Cancel link in the frame ... and nothing happens. 

- Clicking 'Export' on the same page takes me to the options to download the Batch.
- The 'Done' button in this frame does nothing. Whether I have downloaded something or not. It can be closed using the 'Close' link in the top right corner.

Both the 'Cancel' link and 'Done' button work on Master branch.
Comment 7 Owen Leonard 2018-02-12 16:26:36 UTC
I'm going to put this back to "needs signoff" in hopes that getting some more testers might shed some light on why it works fine for me but not Claire.
Comment 8 Owen Leonard 2018-02-13 15:56:33 UTC Comment hidden (obsolete)
Comment 9 Owen Leonard 2018-03-05 17:06:37 UTC Comment hidden (obsolete)
Comment 10 Claire Gravely 2018-03-12 08:29:02 UTC Comment hidden (obsolete)
Comment 11 Owen Leonard 2018-03-12 14:51:54 UTC Comment hidden (obsolete)
Comment 12 Olivier 2018-03-15 11:16:42 UTC
I reproduce the same problems with same steps.
As Claire said :
"- From 'Manage' I go to 'Label Batches'
- select one of the batches and click 'Export selected'
- Click the Cancel link in the frame ... and nothing happens. 

- Clicking 'Export' on the same page takes me to the options to download the Batch.
- The 'Done' button in this frame does nothing. Whether I have downloaded something or not. It can be closed using the 'Close' link in the top right corner. "
Comment 13 Owen Leonard 2018-03-16 11:15:01 UTC Comment hidden (obsolete)
Comment 14 Olivier 2018-03-16 11:44:03 UTC
Same result the 'Cancel' link do nothing.
Am I missing something ?
I use a Sandbox with unimarc.
My test :
I created a new batch with only one item.
Then I test following the test plan.
Comment 15 Owen Leonard 2018-05-08 13:52:26 UTC Comment hidden (obsolete)
Comment 16 Claire Gravely 2018-05-11 06:42:46 UTC
Created attachment 75253 [details] [review]
Bug 19709: Move template JavaScript to the footer: Labels

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

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.

This patch also modifies the templates to use the Bootstrap grid instead
of YUI, and removes obsolete "text/javascript" attributes from
<script> tags and "text/css" attributes from <style> tags in the
modified templates.

To test, apply the patch and test the following interactions:

- Creating and managing layouts
- Creating and managing batches
- Creating and managing templates
- Creating and managing printer profiles
- Creating quick spine labels

Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Comment 17 Owen Leonard 2018-05-11 12:17:04 UTC
*** Bug 19959 has been marked as a duplicate of this bug. ***
Comment 18 Jonathan Druart 2018-06-18 21:05:06 UTC
Created attachment 76163 [details] [review]
Bug 19709: Move template JavaScript to the footer: Labels

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

To test, apply the patch and test the JavaScript-driven features of
each modified template: All button controls, DataTables functionality,
form validation, etc.

This patch also modifies the templates to use the Bootstrap grid instead
of YUI, and removes obsolete "text/javascript" attributes from
<script> tags and "text/css" attributes from <style> tags in the
modified templates.

To test, apply the patch and test the following interactions:

- Creating and managing layouts
- Creating and managing batches
- Creating and managing templates
- Creating and managing printer profiles
- Creating quick spine labels

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 19 Nick Clemens 2018-07-06 14:47:19 UTC
Awesome work all!

Pushed to master for 18.11
Comment 20 Martin Renvoize 2018-07-10 08:25:32 UTC
Enhancement, not backporting to 18.05.x series.