Bugzilla – Attachment 97643 Details for
Bug 7468
Add label to batch by barcode range
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7468: (follow-up) fix label-edit-range template
Bug-7468-follow-up-fix-label-edit-range-template.patch (text/plain), 9.11 KB, created by
Katrin Fischer
on 2020-01-20 21:35:36 UTC
(
hide
)
Description:
Bug 7468: (follow-up) fix label-edit-range template
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-01-20 21:35:36 UTC
Size:
9.11 KB
patch
obsolete
>From ac6c650a8f07d58a4689d544e3a47db49045070f Mon Sep 17 00:00:00 2001 >From: Maryse Simard <maryse.simard@inlibro.com> >Date: Wed, 17 Jul 2019 09:41:09 -0400 >Subject: [PATCH] Bug 7468: (follow-up) fix label-edit-range template > >Edit the labels/label-edit-range.tt template to follow current >standards : > - Use footer javascript > - Use bootstrap grid > - Use jQuery Validation plugin for validation > >Also fixes breadcrumbs to be more specific. > >To test: >Make sure the page looks correct and still works as expected. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > .../prog/en/modules/labels/label-edit-range.tt | 168 ++++++++++----------- > 1 file changed, 77 insertions(+), 91 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt >index a48ced2758..4a5bc5a7e4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/label-edit-range.tt >@@ -1,11 +1,57 @@ >+[% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] >- <title>Koha › Tools › Label creator</title> >+ <title>Koha › Tools › Label creator › Barcode range</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'greybox.inc' %] >- [% IF ( bidi ) %] >- <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/right-to-left.css" /> >- [% END %] >- <script type="text/javascript"> >+</head> >+<body id="labels_label-home" class="tools labels"> >+ [% 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> › >+ Barcode range >+ </div> >+ >+ <div class="main container-fluid"> >+ <div class="row"> >+ <div class="col-sm-10 col-sm-push-2"> >+ <main> >+ [% INCLUDE 'labels-toolbar.inc' %] >+ <h2>Print barcode range</h2> >+ <form name="add_by_number" action="/cgi-bin/koha/labels/label-edit-batch.pl" method="post"> >+ <input type="hidden" name="op" value="add" /> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="from-input">From:</label> >+ <input type="number" name="from" id="from-input" value="0" style="text-align: right;"/> >+ </li> >+ <li> >+ <label for="to-input">To:</label> >+ <input type="number" name="to" id="to-input" value="0" style="text-align: right;"/> >+ </li> >+ </ol> >+ </fieldset> >+ <fieldset class="action"> >+ <button type="button" class="btn btn-default" id="print">Print range</button> >+ </fieldset> >+ </form> >+ </main> >+ </div> <!-- /.col-sm-10.col-sm-push-2 --> >+ >+ <div class="col-sm-2 col-sm-pull-10"> >+ <aside> >+ [% INCLUDE 'tools-menu.inc' %] >+ </aside> >+ </div> <!-- /.col-sm-2.col-sm-pull-10 --> >+ </div> <!-- /.row --> >+ </div> <!-- /.main.container-fluid --> >+ >+[% MACRO jsinclude BLOCK %] >+ [% Asset.js("js/tools-menu.js") | $raw %] >+ <script> > function Xport() { > var str = ""; > str += "from=" + parseInt(document.getElementById("from-input").value) + "&"; >@@ -13,93 +59,33 @@ > return GB_showCenter('Export labels', "/cgi-bin/koha/labels/label-print.pl?" + str, 400, 800); > } > >- function validate() { >- var error = false; >- var from_input = document.getElementById("from-input").value; >- var to_input = document.getElementById("to-input").value; >- >- if (isNaN(parseInt(from_input)))Â { >- document.getElementById("from-error").innerHTML = " *Must be a positive integer"; >- error = true; >- } else if (parseInt(from_input) < 1) { >- document.getElementById("from-error").innerHTML = " *Cannot be smaller than 1"; >- error = true; >- } else { >- document.getElementById("from-error").innerHTML = ""; >- } >+ $(document).ready(function () { >+ $.validator.addMethod("gt", function(value, element, params) { >+ return parseInt(value) > parseInt($(params).val()); >+ }, _("Must be greater than from value.")); > >- if (isNaN(parseInt(to_input)))Â { >- document.getElementById("to-error").innerHTML = " *Must be a positive integer"; >- error = true; >- } else if (parseInt(from_input) > parseInt(to_input)) { >- document.getElementById("to-error").innerHTML = " *Cannot be smaller than starting value"; >- error = true; >- } else { >- document.getElementById("to-error").innerHTML = ""; >- } >- >- if (error) >- return; >- >- return Xport(); >- } >+ $("form[name=add_by_number]").validate({ >+ rules: { >+ from: { >+ required: true, >+ number: true, >+ min: 1 >+ }, >+ to: { >+ required: true, >+ number: true, >+ gt: "#from-input" >+ } >+ } >+ }); > >+ $("#print").on("click", function () { >+ if ( $("form[name=add_by_number]").valid() ) { >+ return Xport(); >+ } >+ }); >+ }); > </script> >-</head> >-<body id="labels_label-home" class="tools labels"> >- [% 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> › >- Label creator >- </div> >- <div id="doc3" class="yui-t2"> >- <div id="bd"> >- <div id="yui-main"> >- <div class="yui-b"> >- <div class="yui-g"> >- [% INCLUDE 'labels-toolbar.inc' %] >- <div class="yui-u first"> >+[% END %] > >- </div> >- <h3>Print barcode range</h3> >- </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" /> >- </li> >- <li> >- <label for="from-input">From:</label> >- <input type="number" name="from" id="from-input" value="0" style="text-align: right;"/> >- <span id="from-error" style="color: red; font-style: italic;"></span> >- <br/> >- </li> >- <li> >- <label for="to-input">To:</label> >- <input type="number" name="to" id="to-input" value="0" style="text-align: right;"/> >- <span id="to-error" style="color: red; font-style: italic;"></span> >- <br/> >- </li> >- </ol> >- </fieldset> >- </div> >- </form> >- <div id="batch-manage" class="btn-toolbar"> >- <a class="btn btn-default btn-sm" id="print" onClick="validate()"> >- <!-- This display a plus. Is there a more appropriate symbol to use? >- <i class="fa fa-plus"></i> >- --> >- Print range >- </a> >- </div> >- </div> >- </div> >- <div class="yui-b"> >- [% INCLUDE 'tools-menu.inc' %] >- </div> >- </div> >- [% INCLUDE 'intranet-bottom.inc' %] >+[% INCLUDE 'intranet-bottom.inc' %] >\ No newline at end of file >-- >2.11.0
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 7468
:
67184
|
67598
|
67636
|
70980
|
77592
|
81071
|
81072
|
81073
|
81074
|
81075
|
91568
|
91569
|
91570
|
97454
|
97455
|
97456
|
97457
|
97458
|
97459
|
97460
|
97461
|
97551
|
97552
|
97553
|
97554
|
97555
|
97556
|
97557
|
97558
|
97638
|
97639
|
97640
|
97641
|
97642
| 97643 |
97644
|
97645
|
97646