There could be use cases where one would like to show the barcode image that is generated from ONE, previously created item in the cataloguing/additem page. One such case would be to send this ONE barcode image to a label printer without having to go over all the required steps to generate a batch of ONE barcode, create a PDF and print it. This extra functionality is easy to implement using the -already present- action submenu and the -also already present- /svc/barcode?barcode=XXX endpoint, by adding a few simple lines of code in the /modules/cataloguing/additem.tt template. Alternatively, one could generate such a popup with an onmouseover event when hovering over the barcode number.
Kudos to Fridolin for the quick brainstorming, where he mentioned the /svc/barcode?barcode=XXX endpoint :) Alternative JS library that seems promising and could be applied to end-user's browser: https://github.com/lindell/JsBarcode?tab=readme-ov-file
The 2D barcode creation library has a 'bug', that makes the default created barcode images unreadable under dark-themed browsers. The barcode image itself is OK, the dark background combined with the black lines of the barcode create the issue. I've opened an issue to the GD:Barcode library author, here: https://github.com/mbeijen/GD-Barcode/issues/9 QR barcodes are not affected, as they have a white border already applied around the black dots.
I'm not submitting a .patch file, because I know you'll fine-tune the code several times before it's accepted, you'll need a QA/test procedure, etc, but the simple/ugly looking but working prototype would be something like that: --- /home/koha/src/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt.orig 2025-05-20 17:55:30.691074105 +0300 +++ /home/koha/src/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt 2025-05-22 12:42:35.295432403 +0300 @@ -138,9 +138,6 @@ <li class="print_label"> <a class="dropdown-item submit-form-link" target="_blank" href="#" data-op="cud-add" data-number_list="[% item.itemnumber | html %]" data-number_type="itemnumber" data-method="post" data-action="/cgi-bin/koha/labels/label-edit-batch.pl" data-new_tab="true">Print label</a> </li> + <li class="show_barcode"> + <a class="dropdown-item" target="_blank" href="/cgi-bin/koha/svc/barcode?barcode=[% item.barcode | uri %]" >Show barcode</a> + </li> [% UNLESS item.nomod %] <li> <form id="[% item.itemnumber | html %]-delete-item-form" action="/cgi-bin/koha/cataloguing/additem.pl" method="post">