Bugzilla – Attachment 72439 Details for
Bug 19709
Move template JavaScript to the footer: Labels
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19709 - Move template JavaScript to the footer: Labels
Bug-19709---Move-template-JavaScript-to-the-footer.patch (text/plain), 52.20 KB, created by
Owen Leonard
on 2018-03-05 17:06:37 UTC
(
hide
)
Description:
Bug 19709 - Move template JavaScript to the footer: Labels
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-03-05 17:06:37 UTC
Size:
52.20 KB
patch
obsolete
>From 025f5c2bf4d1656b82c81499b6b062c2a7d47b34 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 15 Nov 2017 17:41:55 +0000 >Subject: [PATCH] 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. > >- Creating and managing layouts >- Creating and managing batches >- Creating and managing templates >- Creating and managing printer profiles >- Creating quick spine labels > >Edit: Fixed footer include error causing blank popup >--- > .../prog/en/modules/labels/label-edit-batch.tt | 302 ++++++++++++--------- > .../prog/en/modules/labels/label-edit-layout.tt | 65 +++-- > .../prog/en/modules/labels/label-edit-profile.tt | 75 ++--- > .../prog/en/modules/labels/label-edit-template.tt | 77 +++--- > .../prog/en/modules/labels/label-home.tt | 8 +- > .../prog/en/modules/labels/label-manage.tt | 158 +++++------ > .../prog/en/modules/labels/label-print.tt | 37 ++- > .../intranet-tmpl/prog/en/modules/labels/result.tt | 94 ++++--- > .../intranet-tmpl/prog/en/modules/labels/search.tt | 12 +- > .../prog/en/modules/labels/spinelabel-home.tt | 6 + > .../prog/en/modules/labels/spinelabel-print.tt | 22 +- > 11 files changed, 471 insertions(+), 385 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >index 417024a..a4fe925 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-batch.tt >@@ -1,12 +1,147 @@ > [% USE ItemTypes %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Label creator › Batches › [% IF batch_id %]Edit ([% batch_id %])[% ELSE %]New[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >- [% INCLUDE 'greybox.inc' %] > <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> >+</head> >+ >+<body id="labels_label-edit-batch" class="tools labels" onload="dofocus();"> >+ [% INCLUDE 'header.inc' %] >+ [% INCLUDE 'cat-search.inc' %] >+ <div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> › >+ <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › >+ <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> › >+ <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Batches</a> › >+ [% IF batch_id %] >+ Edit ([% batch_id %]) >+ [% ELSE %] >+ New >+ [% END %] >+ </div> >+ <div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ [% INCLUDE 'labels-toolbar.inc' %] >+ [% IF ( err ) %] >+ <div class="dialog alert"> >+ <strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details. >+ </div> >+ [% ELSIF ( duplicate_message ) %] >+ <div class="dialog message"> >+ <strong>Duplicate item(s) removed from batch number [% batch_id %]: [% duplicate_count %]</strong> >+ </div> >+ [% END %] >+ >+ <div id="manage-label-batches"> >+ <div class="hint">Current library: [% LoginBranchname %]</div> >+ <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post"> >+ <div> >+ <fieldset class="rows" style="border-bottom: 0px; border: 0px;"> >+ <ol><li id="description"> >+ <input type="hidden" name="op" value="add" /> >+ <input type="hidden" name="batch_id" value="[% batch_id %]" /> >+ <label for="description">Batch description: </label> >+ <input type="text" name="description" value="[% description %]"> >+ <a href="#" id="savedesc" data-batch_id="[% batch_id %]" class="btn btn-default btn-xs">Save description</a> <span id="change-status"></span> >+ </li> >+ <li> >+ <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked /> >+ <label for="barcode_enter">Enter by barcode:</label><br/> >+ <input type="radio" name="number_type" id="itemnum_enter" value="itemnumber" /> >+ <label for="itemnum_enter">Enter by itemnumber:</label> >+ </li> >+ <li> >+ <label for="number_list">Add by barcode(s) or itemnumbers(s): >+ <br /> <span class="hint">One number per line.</span> >+ <br /> <span class="hint">Leave empty to add via item search (itemnumber).</span> >+ </label> >+ <textarea rows="5" id="number_list" name="number_list" tabindex="1" class="focus"></textarea> >+ </li></ol> >+ </fieldset> >+ </div> >+ </form> >+ <div id="batch-manage" class="btn-toolbar"> >+ <a class="btn btn-default btn-sm" id="additems" href="#"><i class="fa fa-plus"></i> Add item(s)</a>[% IF ( table_loop ) %] >+ <a class="btn btn-default btn-sm" id="removeitems" href="#"><i class="fa fa-trash"></i> Remove selected items</a> >+ <a class="btn btn-default btn-sm" id="deletebatch" href="#"><i class="fa fa-minus-square"></i> Delete batch</a> >+ <a class="btn btn-default btn-sm" id="deduplicate" href="#"><i class="fa fa-minus"></i> Remove duplicates</a> >+ <a class="btn btn-default btn-sm" id="exportitems" href="#"><i class="fa fa-share-square-o"></i> Export selected items</a> >+ <a class="btn btn-default btn-sm" id="exportbatch" href="#"><i class="fa fa-share-square-o"></i> Export full batch</a>[% END %] >+ </div> >+ [% IF ( table_loop ) %] >+ <form name="items" class="checkboxed"> >+ <h2>Items in batch number [% batch_id %]</h2> >+ <table id="batcht"> >+ [% FOREACH table_loo IN table_loop %] >+ [% IF ( table_loo.header_fields ) %] >+ <thead> >+ <tr> >+ [% FOREACH header_field IN table_loo.header_fields %] >+ [% SWITCH header_field.field_label -%] >+ [% CASE "Label number" -%] >+ <th>Label number</th> >+ [% CASE "Summary" -%] >+ <th class="anti-the">Summary</th> >+ [% CASE "Item type" %] >+ <th>Item type</th> >+ [% CASE "Barcode" %] >+ <th>Barcode</th> >+ [% CASE "Select" -%] >+ <th>Select</th> >+ [% CASE %] >+ <th>[% header_field.field_label %]</th> >+ [% END -%] >+ [% END %] >+ </tr> >+ </thead> >+ <tbody> >+ [% ELSE %] >+ <tr> >+ [% FOREACH text_field IN table_loo.text_fields %] >+ [% IF ( text_field.select_field ) %] >+ <td> >+ <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id |url %]&label_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a> >+ <a class="btn btn-default btn-xs export" href="#" data-batch-id="[% batch_id %]" data-label-id="[% text_field.field_value |html %]"><i class="fa fa-share-square-o"></i> Export</a> >+ </td> >+ <td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td> >+ [% ELSE %] >+ <td> >+ [% IF ( text_field.field_name == '_item_type_tbl' ) %] >+ [% ItemTypes.GetDescription( text_field.field_value ) %] >+ [% ELSE %] >+ [% text_field.field_value %] >+ [% END %] >+ </td> >+ [% END %] >+ [% END %] >+ </tr> >+ [% END %] >+ [% END %] >+ </tbody> >+ </table> >+ </form> >+ [% ELSE %] >+ <div class="dialog message"> >+ <h4>There are no items in this batch yet</h4> >+ <p>Add items by using the text area above or leave empty to add via item search.</p> >+ </div> >+ [% END %] >+ </div> >+ </div> >+ </div> >+ <div class="yui-b"> >+ [% INCLUDE 'tools-menu.inc' %] >+ </div> >+ </div> >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'greybox.inc' %] > [% INCLUDE 'datatables.inc' %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> > <script type="text/javascript"> >- //<![CDATA[ > function DeleteConfirm() { > var msg = _("Are you sure you want to delete batch %s?").format("[% batch_id %]"); > var answer = confirm(msg); >@@ -43,7 +178,7 @@ > item_msg = item_num.join(", "); > var msg = _("Are you sure you want to remove label number(s): %s from this batch?").format(item_msg); > } else if (document.items.action.checked) { >- alert(_("Deletion of label from a batch with only one label will delete the batch.") + "\n\n" + _("If this is what you want, select the 'Delete batch' option from the toolbar")); >+ alert(_("Deletion of label from a batch with only one label will delete the batch.") + "\n\n" + _("If this is what you want, select the 'Delete batch' option from the toolbar")); > return; // no deletion for single item batch > } > else { >@@ -167,135 +302,36 @@ > var batch_id = $(this).data("batch-id"); > GB_showCenter(_("Export labels"),"/cgi-bin/koha/labels/label-print.pl?batch_id=" + batch_id + "&label_id=" + label_id, 400, 800); > }); >- }); >- //]]> >+ >+ $("#savedesc").click(function(event){ >+ event.preventDefault(); // prevent form submission >+ var newdescription = $(this).siblings('input[name="description"]').val(); >+ var batch_id = $(this).data('batch_id'); >+ var ajaxData = { >+ 'newdescription': newdescription, >+ 'batch_id': batch_id, >+ 'card_element': "batch", >+ 'creator': "label", >+ }; >+ >+ $.ajax({ >+ url: '/cgi-bin/koha/svc/creator_batches', >+ type: 'POST', >+ dataType: 'json', >+ data: ajaxData, >+ }) >+ >+ .done(function(data){ >+ if (data.status == 'success') { >+ $("input[name='description']").text(data.newdesc); >+ $("#change-status").text(_("Saved")); >+ } else { >+ $("#change-status").text(_("Unable to save description")); >+ } >+ }); >+ }); >+ }); > </script> >-</head> >-<body id="labels_label-edit-batch" class="tools labels" onload="dofocus();"> >- [% INCLUDE 'header.inc' %] >- [% INCLUDE 'cat-search.inc' %] >- <div id="breadcrumbs"> >- <a href="/cgi-bin/koha/mainpage.pl">Home</a> › >- <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › >- <a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a> › >- <a href="/cgi-bin/koha/labels/label-manage.pl?label_element=batch">Batches</a> › >- [% IF batch_id %] >- Edit ([% batch_id %]) >- [% ELSE %] >- New >- [% END %] >- </div> >- <div id="doc3" class="yui-t2"> >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >- [% INCLUDE 'labels-toolbar.inc' %] >- [% IF ( err ) %] >- <div class="dialog alert"> >- <strong>WARNING:</strong> An error was encountered and [% errstr %] Please have your system administrator check the error log for details. >- </div> >- [% ELSIF ( duplicate_message ) %] >- <div class="dialog message"> >- <strong>Duplicate item(s) removed from batch number [% batch_id %]: [% duplicate_count %]</strong> >- </div> >- [% END %] >+[% END %] > >- <div id="manage-label-batches"> >- <div class="hint">Current library: [% LoginBranchname %]</div> >- <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post"> >- <div> >- <fieldset class="rows" style="border-bottom: 0px; border: 0px;"> >- <ol><li> >- <input type="hidden" name="op" value="add" /> >- <input type="hidden" name="batch_id" value="[% batch_id %]" /> >- </li> >- <li> >- <input type="radio" name="number_type" id="barcode_enter" value="barcode" checked /> >- <label for="barcode_enter">Enter by barcode:</label><br/> >- <input type="radio" name="number_type" id="itemnum_enter" value="itemnumber" /> >- <label for="itemnum_enter">Enter by itemnumber:</label> >- </li> >- <li> >- <label for="number_list">Add by barcode(s) or itemnumbers(s): >- <br /> <span class="hint">One number per line.</span> >- <br /> <span class="hint">Leave empty to add via item search (itemnumber).</span> >- </label> >- <textarea rows="5" id="number_list" name="number_list" tabindex="1" class="focus"></textarea> >- </li></ol> >- </fieldset> >- </div> >- </form> >- <div id="batch-manage" class="btn-toolbar"> >- <a class="btn btn-default btn-sm" id="additems" href="#"><i class="fa fa-plus"></i> Add item(s)</a>[% IF ( table_loop ) %] >- <a class="btn btn-default btn-sm" id="removeitems" href="#"><i class="fa fa-trash"></i> Remove selected items</a> >- <a class="btn btn-default btn-sm" id="deletebatch" href="#"><i class="fa fa-minus-square"></i> Delete batch</a> >- <a class="btn btn-default btn-sm" id="deduplicate" href="#"><i class="fa fa-minus"></i> Remove duplicates</a> >- <a class="btn btn-default btn-sm" id="exportitems" href="#"><i class="fa fa-share-square-o"></i> Export selected items</a> >- <a class="btn btn-default btn-sm" id="exportbatch" href="#"><i class="fa fa-share-square-o"></i> Export full batch</a>[% END %] >- </div> >- [% IF ( table_loop ) %] >- <form name="items" class="checkboxed"> >- <h2>Items in batch number [% batch_id %]</h2> >- <table id="batcht"> >- [% FOREACH table_loo IN table_loop %] >- [% IF ( table_loo.header_fields ) %] >- <thead> >- <tr> >- [% FOREACH header_field IN table_loo.header_fields %] >- [% SWITCH header_field.field_label -%] >- [% CASE "Label number" -%] >- <th>Label number</th> >- [% CASE "Summary" -%] >- <th class="anti-the">Summary</th> >- [% CASE "Item type" %] >- <th>Item type</th> >- [% CASE "Barcode" %] >- <th>Barcode</th> >- [% CASE "Select" -%] >- <th>Select</th> >- [% CASE %] >- <th>[% header_field.field_label %]</th> >- [% END -%] >- [% END %] >- </tr> >- </thead> >- <tbody> >- [% ELSE %] >- <tr> >- [% FOREACH text_field IN table_loo.text_fields %] >- [% IF ( text_field.select_field ) %] >- <td> >- <a class="btn btn-default btn-xs delete" href="/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&batch_id=[% batch_id |url %]&label_id=[% text_field.field_value |url %]"><i class="fa fa-trash"></i> Delete</a> >- <a class="btn btn-default btn-xs export" href="#" data-batch-id="[% batch_id %]" data-label-id="[% text_field.field_value |html %]"><i class="fa fa-share-square-o"></i> Export</a> >- </td> >- <td><input type="checkbox" name="action" value="[% text_field.field_value %]"></td> >- [% ELSE %] >- <td> >- [% IF ( text_field.field_name == '_item_type_tbl' ) %] >- [% ItemTypes.GetDescription( text_field.field_value ) %] >- [% ELSE %] >- [% text_field.field_value %] >- [% END %] >- </td> >- [% END %] >- [% END %] >- </tr> >- [% END %] >- [% END %] >- </tbody> >- </table> >- </form> >- [% ELSE %] >- <div class="dialog message"> >- <h4>There are no items in this batch yet</h4> >- <p>Add items by using the text area above or leave empty to add via item search.</p> >- </div> >- [% END %] >- </div> >- </div> >- </div> >- <div class="yui-b"> >- [% INCLUDE 'tools-menu.inc' %] >- </div> >- </div> >- [% INCLUDE 'intranet-bottom.inc' %] >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt >index 402ea9e..f5bdd4c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-layout.tt >@@ -7,38 +7,10 @@ > [% CASE 'BAR' %]Barcode > [% END %] > [% END %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Label creator › Layouts › [% IF ( layout_id ) %]Edit ([% layout_id %])[% ELSE %]New[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >- <script type="text/JavaScript"> >- //<![CDATA[ >- $(document).ready(function() { >- $("input[name='layout_choice']").change( function() { layout_method() } ); >- layout_method(); >- $("#font").on("change",function(){ >- checkOblique(); >- }); >- }); >- function layout_method() { >- if( $("input[name='layout_choice']:checked").val() == 'layout_string' ) { >- $('#layout_table').hide(); >- $('#layout_string').show(); >- } else { >- $('#layout_table').show(); >- $('#layout_string').hide(); >- } >- } >- function checkOblique() { >- var font = document.getElementById("font"); >- var selectedfont = font.options[font.selectedIndex].value; >- if ( selectedfont.match("I$") || selectedfont.match("O$") ) { >- document.getElementById("oblique_title").disabled = true; >- } else { >- document.getElementById("oblique_title").disabled = false; >- } >- } >- //]]> >- </script> > </head> > [% BLOCK translate_justification_types %] > [% SWITCH type %] >@@ -47,6 +19,7 @@ > [% CASE 'R' %]Right > [% END %] > [% END %] >+ > <body id="labels_label-edit-layout" class="tools labels"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] >@@ -213,4 +186,36 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >- [% INCLUDE 'intranet-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> >+ <script type="text/JavaScript"> >+ $(document).ready(function() { >+ $("input[name='layout_choice']").change( function() { layout_method() } ); >+ layout_method(); >+ $("#font").on("change",function(){ >+ checkOblique(); >+ }); >+ }); >+ function layout_method() { >+ if( $("input[name='layout_choice']:checked").val() == 'layout_string' ) { >+ $('#layout_table').hide(); >+ $('#layout_string').show(); >+ } else { >+ $('#layout_table').show(); >+ $('#layout_string').hide(); >+ } >+ } >+ function checkOblique() { >+ var font = document.getElementById("font"); >+ var selectedfont = font.options[font.selectedIndex].value; >+ if ( selectedfont.match("I$") || selectedfont.match("O$") ) { >+ document.getElementById("oblique_title").disabled = true; >+ } else { >+ document.getElementById("oblique_title").disabled = false; >+ } >+ } >+ </script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt >index 03d1a50..c542112 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-profile.tt >@@ -1,41 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Label creator › Profiles › [% IF ( profile_id ) %]Edit ([% profile_id %])[% ELSE %]New[% END%]</title> > [% INCLUDE 'doc-head-close.inc' %] >- <script type="text/javascript"> >- //<![CDATA[ >- $(document).ready(function(){ >- var selectedUnit = $("#units option:selected").attr("value"); >- var unitfields = $("#offset_horz,#offset_vert,#creep_horz,#creep_vert"); >- $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>"); >- $("#units").change(function(){ >- $(".unit").html(getUnit($(this).val())); >- }); >- function getUnit(unit){ >- switch(unit){ >- case "POINT": >- var unit = " pt"; >- break; >- case "AGATE": >- var unit = " ag"; >- break; >- case "INCH": >- var unit = " in"; >- break; >- case "MM": >- var unit = " mm"; >- break; >- case "CM": >- var unit = " cm"; >- break; >- default: >- var unit = ""; >- } >- return unit; >- } >- }); >- //]]> >- </script> > </head> >+ > <body id="labels_label-edit-profile" class="tools labels"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] >@@ -146,4 +114,41 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >- [% INCLUDE 'intranet-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> >+ <script type="text/javascript"> >+ $(document).ready(function(){ >+ var selectedUnit = $("#units option:selected").attr("value"); >+ var unitfields = $("#offset_horz,#offset_vert,#creep_horz,#creep_vert"); >+ $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>"); >+ $("#units").change(function(){ >+ $(".unit").html(getUnit($(this).val())); >+ }); >+ function getUnit(unit){ >+ switch(unit){ >+ case "POINT": >+ var unit = " pt"; >+ break; >+ case "AGATE": >+ var unit = " ag"; >+ break; >+ case "INCH": >+ var unit = " in"; >+ break; >+ case "MM": >+ var unit = " mm"; >+ break; >+ case "CM": >+ var unit = " cm"; >+ break; >+ default: >+ var unit = ""; >+ } >+ return unit; >+ } >+ }); >+ </script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt >index e4fc9f9..a350945 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-template.tt >@@ -1,41 +1,9 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Label creator › Templates › [% IF ( template_id ) %]Edit ([% template_id %])[% ELSE %]New[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >- <script type="text/javascript"> >- //<![CDATA[ >- $(document).ready(function(){ >- var selectedUnit = $("#units option:selected").attr("value"); >- var unitfields = $("#page_height,#page_width,#label_width,#label_height,#top_margin,#left_margin,#top_text_margin,#left_text_margin,#col_gap,#row_gap"); >- $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>"); >- $("#units").change(function(){ >- $(".unit").html(getUnit($(this).val())); >- }); >- function getUnit(unit){ >- switch(unit){ >- case "POINT": >- var unit = " pt"; >- break; >- case "AGATE": >- var unit = " ag"; >- break; >- case "INCH": >- var unit = " in"; >- break; >- case "MM": >- var unit = " mm"; >- break; >- case "CM": >- var unit = " cm"; >- break; >- default: >- var unit = ""; >- } >- return unit; >- } >- }); >- //]]> >- </script> > </head> >+ > <body id="labels_label-edit-template" class="tools labels"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] >@@ -182,4 +150,43 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >- [% INCLUDE 'intranet-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> >+ <script type="text/javascript"> >+ //<![CDATA[ >+ $(document).ready(function(){ >+ var selectedUnit = $("#units option:selected").attr("value"); >+ var unitfields = $("#page_height,#page_width,#label_width,#label_height,#top_margin,#left_margin,#top_text_margin,#left_text_margin,#col_gap,#row_gap"); >+ $(unitfields).after("<span class=\"unit\">"+getUnit(selectedUnit)+"</span>"); >+ $("#units").change(function(){ >+ $(".unit").html(getUnit($(this).val())); >+ }); >+ function getUnit(unit){ >+ switch(unit){ >+ case "POINT": >+ var unit = " pt"; >+ break; >+ case "AGATE": >+ var unit = " ag"; >+ break; >+ case "INCH": >+ var unit = " in"; >+ break; >+ case "MM": >+ var unit = " mm"; >+ break; >+ case "CM": >+ var unit = " cm"; >+ break; >+ default: >+ var unit = ""; >+ } >+ return unit; >+ } >+ }); >+ //]]> >+ </script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt >index e3b0109..c539d36 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-home.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Label creator</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -29,4 +30,9 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >- [% INCLUDE 'intranet-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >index 0313959..747371f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-manage.tt >@@ -10,86 +10,13 @@ > [%- CASE 'Batches' -%]Batches > [%- END -%] > [% END %] >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Label creator › [% PROCESS translate_label_element element=label_element_title %]</title> > [% INCLUDE 'doc-head-close.inc' %] >- [% INCLUDE 'greybox.inc' %] >- <script type="text/javascript"> >- //<![CDATA[ >- function Xport() { >- batches= new Array; >- if(document.layouts.action.length > 0) { >- for (var i=0; i < document.layouts.action.length; i++) { >- if (document.layouts.action[i].checked) { >- batches.push("batch_id=" + document.layouts.action[i].value); >- } >- } >- if (batches.length < 1) { >- alert(_("Please select at least one batch to export.")); >- return; // no batch selected >- } >- getstr = batches.join("&"); >- } >- else if (document.layouts.action.checked) { >- getstr = "batch_id="+document.layouts.action.value; >- } >- else { >- alert(_("Please select at least one batch to export.")); >- return; // no batch selected >- } >- return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800); >- }; >- function selected_layout(op) { >- var selected = new Array; >- if (document.layouts.action.length) { >- for (i=0;i<document.layouts.action.length;i++){ >- if (document.layouts.action[i].checked){ >- selected.push(i); >- } >- }; >- if (selected.length == 1) { >- return(document.layouts.action[selected[0]].value); >- } >- else { >- alert(_("Please select only one %s to %s.").format("[% label_element %]", op)); >- return (-1); >- } >- } >- else { >- if (document.layouts.action.checked){ >- return(document.layouts.action.value); >- } >- }; >- alert(_("Please select a %s.").format("[% label_element %]")); >- return (-1); >- }; >- $(document).ready(function(){ >- $("#print").click(function(e){ >- e.preventDefault(); >- Xport(); >- }); >- $(".delete").on("click", function(){ >- return confirmDelete( _("Are you sure you want to delete this?") ); >- }); >- }); >- //]]> >- </script> >- >-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript" id="js"> >- $(document).ready(function() { >- $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sPaginationType": "four_button", >- "aaSorting": [[ 1, "asc" ]], >- "aoColumnDefs": [ >- { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >- ] >- })); >- }); >-</script> >- >+ <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" /> > </head> >+ > <body id="labels_label-manage" class="tools labels"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] >@@ -185,4 +112,81 @@ > [% INCLUDE 'tools-menu.inc' %] > </div> > </div> >- [% INCLUDE 'intranet-bottom.inc' %] >+ >+ [% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu_[% KOHA_VERSION %].js"></script> >+ [% INCLUDE 'greybox.inc' %] >+ <script> >+ function Xport() { >+ batches= new Array; >+ if(document.layouts.action.length > 0) { >+ for (var i=0; i < document.layouts.action.length; i++) { >+ if (document.layouts.action[i].checked) { >+ batches.push("batch_id=" + document.layouts.action[i].value); >+ } >+ } >+ if (batches.length < 1) { >+ alert(_("Please select at least one batch to export.")); >+ return; // no batch selected >+ } >+ getstr = batches.join("&"); >+ } >+ else if (document.layouts.action.checked) { >+ getstr = "batch_id="+document.layouts.action.value; >+ } >+ else { >+ alert(_("Please select at least one batch to export.")); >+ return; // no batch selected >+ } >+ return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?" + getstr, 400, 800); >+ }; >+ function selected_layout(op) { >+ var selected = new Array; >+ if (document.layouts.action.length) { >+ for (i=0;i<document.layouts.action.length;i++){ >+ if (document.layouts.action[i].checked){ >+ selected.push(i); >+ } >+ }; >+ if (selected.length == 1) { >+ return(document.layouts.action[selected[0]].value); >+ } >+ else { >+ alert(_("Please select only one %s to %s.").format("[% label_element %]", op)); >+ return (-1); >+ } >+ } >+ else { >+ if (document.layouts.action.checked){ >+ return(document.layouts.action.value); >+ } >+ }; >+ alert(_("Please select a %s.").format("[% label_element %]")); >+ return (-1); >+ }; >+ $(document).ready(function(){ >+ $("#print").click(function(e){ >+ e.preventDefault(); >+ Xport(); >+ }); >+ $(".delete").on("click", function(){ >+ return confirmDelete( _("Are you sure you want to delete this?") ); >+ }); >+ }); >+ </script> >+ >+ [% INCLUDE 'datatables.inc' %] >+ <script id="js"> >+ $(document).ready(function() { >+ $("#labels-table").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "sPaginationType": "four_button", >+ "aaSorting": [[ 1, "asc" ]], >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ ] >+ })); >+ }); >+ </script> >+ [% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt >index 0bb80b9..4c10884 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-print.tt >@@ -1,18 +1,10 @@ >- [% INCLUDE 'doc-head-open.inc' %] >+<!DOCTYPE html> >+[% IF ( bidi ) %]<html lang="[% lang %]" dir="[% bidi %]">[% ELSE %]<html lang="[% lang %]">[% END %] >+<head> > <title>Koha › Tools › Label creator › Label printing/exporting</title> >- [% INCLUDE 'doc-head-close.inc' popup => 1 %] >- <script type="text/javascript"> >- //<![CDATA[ >- function Done() { >- window.location = "[% referer %]"; >- }; >- $(document).ready(function(){ >- $(".gb-close").on("click",function(){ >- parent.parent.GB_hide(); >- }); >- }); >- //]]> >- </script> >+ <link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> >+ [% INCLUDE intranetstylesheet.inc %] >+ [% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %] > <style type="text/css">#custom-doc {width:47.23em; *width:46.04em; min-width:610px; margin:auto; margin-top:0.4em;}</style> > <style type="text/css">table {border-collapse: separate; border-spacing: 0; border: hidden none;} .header {cursor: auto; background-position: center center; background-repeat: repeat;}</style> > </head> >@@ -107,4 +99,21 @@ > </form> > [% END %] > </div> >+ >+[% IF ( IntranetUserJS ) %] >+ <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min.js"></script> >+ <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min.js"></script> >+ <script type="text/javascript"> >+ [% IntranetUserJS %] >+ function Done() { >+ window.location = "[% referer %]"; >+ }; >+ $(document).ready(function(){ >+ $(".gb-close").on("click",function(){ >+ parent.parent.GB_hide(); >+ }); >+ }); >+ </script> >+[% END %] >+ > [% INCLUDE 'popup-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt >index 9bf4e1a..a2c6df9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt >@@ -1,52 +1,10 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Barcodes and labels › Search results</title> > [% INCLUDE 'doc-head-close.inc' %] > <style type="text/css">#custom-doc { width:46.23em;*width:45.04em;min-width:700px; margin:auto;margin-top: .4em; text-align:left; }</style> >- <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat_[% KOHA_VERSION %].js"></script> >- <script type="text/javascript"> >- //<![CDATA[ >- $(document).ready(function(){ >- $("#toolbar").fixFloat(); >- $("#CheckAll").click(function(e){ >- e.preventDefault(); >- $("input[type='checkbox']").prop("checked",true); >- }); >- $("#CheckNone").click(function(e){ >- e.preventDefault(); >- $("input[type='checkbox']").prop("checked",false); >- }); >- $("#add_items").on("click",function(){ >- add_item('checked',[% batch_id %],'[% type %]'); >- }); >- $(".select_item").on("click",function(e){ >- e.preventDefault(); >- var batch_id = $(this).data("batch-id"); >- var itemnumber = $(this).data("item-number"); >- var type = $(this).data("field-type"); >- add_item(itemnumber, batch_id, type); >- }); >- }); >- function add_item(item_number,batch_id,type_id){ >- var p = window.opener; >- if (item_number == 'checked') { >- items= new Array; >- if(document.resultform.action.length > 0) { >- for (var i=0; i < document.resultform.action.length; i++) { >- if (document.resultform.action[i].checked) { >- p.add_item(document.resultform.action[i].value); >- } >- } >- } else { >- p.add_item(document.resultform.action.value); >- } >- } >- else { >- p.add_item(item_number); >- } >- } >- //]]> >- </script> > </head> >+ > <body id="labels_result" class="tools labels"> > <div id="custom-doc" class="yui-t7"> > <div id="bd"> >@@ -150,4 +108,50 @@ z [% END -%] > <div id="closewindow"><a href="#" class="btn btn-default btn-default close">Close</a></div> > [% END %] > </div> >- [% INCLUDE 'popup-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ <script src="[% interface %]/lib/jquery/plugins/jquery.fixFloat_[% KOHA_VERSION %].js"></script> >+ <script> >+ $(document).ready(function(){ >+ $("#toolbar").fixFloat(); >+ $("#CheckAll").click(function(e){ >+ e.preventDefault(); >+ $("input[type='checkbox']").prop("checked",true); >+ }); >+ $("#CheckNone").click(function(e){ >+ e.preventDefault(); >+ $("input[type='checkbox']").prop("checked",false); >+ }); >+ $("#add_items").on("click",function(){ >+ add_item('checked',[% batch_id %],'[% type %]'); >+ }); >+ $(".select_item").on("click",function(e){ >+ e.preventDefault(); >+ var batch_id = $(this).data("batch-id"); >+ var itemnumber = $(this).data("item-number"); >+ var type = $(this).data("field-type"); >+ add_item(itemnumber, batch_id, type); >+ }); >+ }); >+ function add_item(item_number,batch_id,type_id){ >+ var p = window.opener; >+ if (item_number == 'checked') { >+ items= new Array; >+ if(document.resultform.action.length > 0) { >+ for (var i=0; i < document.resultform.action.length; i++) { >+ if (document.resultform.action[i].checked) { >+ p.add_item(document.resultform.action[i].value); >+ } >+ } >+ } else { >+ p.add_item(document.resultform.action.value); >+ } >+ } >+ else { >+ p.add_item(item_number); >+ } >+ } >+ </script> >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt >index d9d5235..ef8e8fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tt >@@ -1,6 +1,7 @@ >-[% INCLUDE 'doc-head-open.inc' %]<title>Koha › Labels</title> >+[% SET footerjs = 1 %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Labels</title> > [% INCLUDE 'doc-head-close.inc' %] >-[% INCLUDE 'calendar.inc' %] > <style type="text/css">#custom-doc { width:47.23em;*width:46.04em;min-width:610px; margin:auto;margin-top: .4em; text-align:left; }</style> > </head> > <body id="labels_search" class="tools labels"> >@@ -105,4 +106,9 @@ to add to Batch [% batch_id %] > </form> > </div> > </div> >-[% INCLUDE 'popup-bottom.inc' %] >+ >+[% MACRO jsinclude BLOCK %] >+ [% INCLUDE 'calendar.inc' %] >+[% END %] >+ >+[% INCLUDE 'intranet-bottom.inc' popup_window=1 %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt >index e324db5..6e123c0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-home.tt >@@ -1,3 +1,4 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %]<title>Koha › Tools › Quick spine label creator</title> > [% INCLUDE 'doc-head-close.inc' %] > </head> >@@ -30,4 +31,9 @@ > </div> > > </div> >+ >+[% MACRO jsinclude BLOCK %] >+ <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script> >+[% END %] >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt >index 4400bb7..9a6711b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/spinelabel-print.tt >@@ -11,21 +11,11 @@ > } > </style> > [% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %] >-[% IF ( IntranetUserJS ) %] >- <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-2.2.3.min_[% KOHA_VERSION %].js"></script> >- <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min_[% KOHA_VERSION %].js"></script> >- <script type="text/javascript"> >- //<![CDATA[ >- [% IntranetUserJS %] >- //]]> >- </script> >-[% END %] > </head> > [% IF ( BarcodeNotFound ) %] > <body id="labels_spinelabel-print" class="tools labels"> > <p>The barcode [% Barcode |html %] was not found.</p> > <p><a href="spinelabel-home.pl">Return to spine label printer</a></p> >- </body> > [% ELSE %] > [% IF ( autoprint ) %] > <body id="labels_spinelabel-print" class="tools labels" onload="window.print()"> >@@ -38,6 +28,14 @@ > <span id="print_button" class="noprint"> > <button onclick="window.print()">Print this label</button> > </span> >- </body> > [% END %] >-</html> >+ >+[% IF ( IntranetUserJS ) %] >+ <script src="[% interface %]/lib/jquery/jquery-2.2.3.min_[% KOHA_VERSION %].js"></script> >+ <script src="[% interface %]/lib/jquery/jquery-migrate-1.3.0.min_[% KOHA_VERSION %].js"></script> >+ <script> >+ [% IntranetUserJS %] >+ </script> >+[% END %] >+ >+[% INCLUDE 'popup-bottom.inc' %] >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19709
:
69418
|
70432
|
71557
|
72439
|
72625
|
72701
|
73021
|
75155
|
75253
|
76163