Bug 15843

Summary: Move MARC subfields structure JavaScript into separate file
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: brendan, hector.hecaxmmx, julian.maurice
Version: Main   
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:
Circulation function:
Attachments: Bug 15843 - Move MARC subfields structure JavaScript into separate file
[SIGNED-OFF]Bug 15843: Move MARC subfields structure JavaScript into separate file
Bug 15843: Move MARC subfields structure JavaScript into separate file

Description Owen Leonard 2016-02-17 14:31:09 UTC
Coding guideline JS1 (https://wiki.koha-community.org/wiki/Coding_Guidelines#JS1:_Embedding_JavaScript_blocks_in_templates) says "Whenever possible JavaScript should be placed in a separate file."

The JavaScript embedded in admin/marc_subfields_structure.tt is not dependent on template processing, so it can be safely moved to a separate file.
Comment 1 Owen Leonard 2016-02-17 14:41:21 UTC Comment hidden (obsolete)
Comment 2 Héctor Eduardo Castro Avalos 2016-02-17 16:04:57 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2016-02-18 11:36:58 UTC
Created attachment 48209 [details] [review]
Bug 15843: Move MARC subfields structure JavaScript into separate file

The JavaScript embedded in the MARC subfields structure template is not
dependent on template processing and can safely be moved to a separate
file. This patch does so. Removed in the process is some lines which
were commented out.

To test, apply the patch and go to Administration -> MARC framworks.

 - Click 'MARC structure' for a framework you can edit.
 - Click 'subfields' for a tag you can edit.
 - Click 'Edit' for a subfield you can edit.
 - Confirm that tabs and accordian sections work correctly.
 - Make changes under Advanced constraints -> Visibility and confirm
   that they are saved correctly.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as advertised

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Brendan Gallagher 2016-02-24 01:44:23 UTC
pushed to master - Should be in the May 2016 release.  Thanks!