Koha/koha-tmpl/intranet-tmpl/prog/js/tools-menu.js
Owen Leonard cb195553d3 Bug 29821: Add interface for generating barcodes using svc/barcode
This patch adds a new page providing an interface for generating
barcodes using svc/barcode. A form allows the user to choose various
parameters and see the resulting barcode image.

To test, apply the patch and rebuild the staff interface SCSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- 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.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-04-08 15:49:17 +02:00

22 lines
1.5 KiB
JavaScript

$(document).ready(function() {
var path = location.pathname.substring(1);
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");
} else if (path.indexOf("clubs") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/clubs/clubs.pl"]').addClass("current");
} else if (path.indexOf("patron_lists") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/patron_lists/lists.pl"]').addClass("current");
} else if (path.indexOf("rotating_collections") >= 0 ){
$('#navmenulist a[href$="/cgi-bin/koha/rotating_collections/rotatingCollections.pl"]').addClass("current");
} else if ((path+location.search).indexOf("batchMod.pl?del=1") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/tools/batchMod.pl?del=1"]').addClass("current");
} else if (path.indexOf("quotes-upload.pl") >= 0 ){
$('#navmenulist a[href$="/cgi-bin/koha/tools/quotes.pl"]').addClass("current");
} else if (path.indexOf("stockrotation") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/tools/stockrotation.pl"]').addClass("current");
} else if (path.indexOf("plugins") >= 0 ) {
$('#navmenulist a[href$="/cgi-bin/koha/plugins/plugins-home.pl?method=tool"]').addClass("current");
}
});