@@ -, +, @@ svc/barcode - Go to the "Tools" home page. Follow the link to "Barcode image generator." - On the barcode image generator page, confirm that there is a "Barcode image generator" link in the sidebar and that it is displayed with bold text. - Test the features of the form: - Enter a numeric value in the "Barcode" field and tab out of the field or click "Show barcode" button. A barcode of type "Code39" should be shown with the text of the barcode included in the image below the barcode. - A text area below the barcode image should show the HTML used to generate the preview image. - Clicking in this textarea should automatically add the contents to the clipboard. You should be shown a message, "HTML copied to the clipboard." - Check the "hide text" checkbox. The barcode should be redisplayed without the text. - Check that changing the "barcode height" value is reflected correctly in the barcode image. - Try adding non-numeric data in the "Barcode" field. You should be shown an error message, "Barcodes of type [type] must be numeric." - Test these other numeric barcode types: Code39, COOP2of5, EAN13, EAN8, IATA2of5, Industrial2of5, ITF, Matrix2of5, NW7, UPCA, and UPCE. Note that EAN13, EAN8, UPCA, and UPCE expect specific patterns. Test values (found here: https://barcode.tec-it.com/en/UPCE): EAN13: 978020137962 EAN8: 9031101 UPCA: 72527273070 UPCE: 0123456 - Change the barcode type to "QRcode." - The form should change, hiding the "Hide text" checkbox and showing a new ranger slider for "QR Code module size." - The barcode field should now be labeled "Text, URL, or barcode, etc" - The barcode field hint should change to a hint about QRcode dimensions. - Changing the "module size" slider should change the size of the generated QR code. As you change the slider the selected value should be reflected in the box. --- .../prog/css/src/staff-global.scss | 11 +- .../prog/en/includes/tools-menu.inc | 1 + .../prog/en/modules/labels/barcode-print.tt | 212 ++++++++++++++++++ .../prog/en/modules/tools/tools-home.tt | 7 +- koha-tmpl/intranet-tmpl/prog/js/tools-menu.js | 2 +- labels/barcode-print.pl | 33 +++ 6 files changed, 260 insertions(+), 6 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/labels/barcode-print.tt create mode 100755 labels/barcode-print.pl --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -713,6 +713,12 @@ fieldset { } li { + margin-top: 1em; + + &:first-child { + margin-top: 0; + } + &[aria-disabled="true"] { color: #999; } @@ -909,10 +915,6 @@ fieldset { padding-left: 0; } } - - legend { - margin-bottom: 0; - } } ol { @@ -1038,6 +1040,7 @@ legend { border-radius: 3px; font-size: 123.1%; font-weight: bold; + margin-bottom: 0; padding: .2em .5em; width: auto; } --- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc @@ -73,6 +73,7 @@ [% IF ( CAN_user_tools_label_creator ) %]
  • Label creator
  • Quick spine label creator
  • +
  • Barcode image generator
  • [% END %] [% IF ( CAN_user_tools_rotating_collections ) %]
  • Rotating collections
  • --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/barcode-print.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/barcode-print.tt @@ -0,0 +1,212 @@ +[% USE raw %] +[% USE Asset %] +[% SET footerjs = 1 %] +[% INCLUDE 'doc-head-open.inc' %]Barcode image generator › Tools › Koha +[% INCLUDE 'doc-head-close.inc' %] +[% Asset.css("css/humanmsg.css") | $raw %] +[% FILTER collapse %] + +[% END %] + + + +[% INCLUDE 'header.inc' %] +[% INCLUDE 'cat-search.inc' %] + + + +
    +
    +
    +
    +

    Barcode image generator

    + +
    +
    +
    +
    +
      +
    1. + + +
    2. +
    3. + + + 3 +
      Module size refers to the pixel dimensions of each black or white square in the generated QR code.
      +
    4. +
    5. + +
    6. +
    7. + + +
    8. +
    9. + + + +
      Actual dimensions of the QR code depend on the amount of characters being encoded.
      +
      Barcode text must be numeric (0-9)
      +
    10. +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    + +
    + +
    +
    + +[% MACRO jsinclude BLOCK %] + [% Asset.js("js/tools-menu.js") | $raw %] + [% Asset.js("lib/jquery/plugins/humanmsg.js") | $raw %] + +[% END %] + +[% INCLUDE 'intranet-bottom.inc' %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt @@ -224,7 +224,12 @@
    Label creator
    Create printable labels and barcodes from catalog data
    [% END %] - + + [% IF ( CAN_user_tools_label_creator ) %] +
    Barcode image generator
    +
    Configure and create barcodes of various types to be output as an image
    + [% END %] + [% IF ( CAN_user_tools_label_creator ) %]
    Quick spine label creator
    Enter a barcode to generate a printable spine label. For use with dedicated label printers
    --- a/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js +++ a/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js @@ -1,6 +1,6 @@ $(document).ready(function() { var path = location.pathname.substring(1); - if (path.indexOf("labels") >= 0 && path.indexOf("spine") < 0 ) { + if (path.indexOf("labels") >= 0 && path.indexOf("spine") < 0 && path.indexOf("barcode") < 0 ) { $('#navmenulist a[href$="/cgi-bin/koha/labels/label-home.pl"]').addClass("current"); } else if (path.indexOf("patroncards") >= 0 ) { $('#navmenulist a[href$="/cgi-bin/koha/patroncards/home.pl"]').addClass("current"); --- a/labels/barcode-print.pl +++ a/labels/barcode-print.pl @@ -0,0 +1,33 @@ +#!/usr/bin/perl + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; +use CGI qw ( -utf8 ); +use C4::Auth qw( get_template_and_user ); +use C4::Output qw( output_html_with_http_headers ); +use C4::Context; + +my $query = CGI->new; +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { template_name => "labels/barcode-print.tt", + query => $query, + type => "intranet", + flagsrequired => { catalogue => 1 }, + } +); + +output_html_with_http_headers $query, $cookie, $template->output; --