Bug 13545 - Add barcode image generator service
Summary: Add barcode image generator service
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: 3.22
Hardware: PC Windows
: P1 - high normal (vote)
Assignee: Kyle M Hall
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-09 16:40 UTC by Kyle M Hall
Modified: 2017-01-30 08:32 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 13545 - Add barcode image generator service (2.41 KB, patch)
2015-01-09 16:49 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13545 - Add barcode image generator service (2.41 KB, patch)
2015-01-09 17:13 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13545 - Add barcode image generator service (2.40 KB, patch)
2015-01-12 12:03 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13545 - Add barcode image generator service (2.43 KB, patch)
2015-01-13 01:15 UTC, Brandon
Details | Diff | Splinter Review
Bug 13545 - Add barcode image generator service (2.49 KB, patch)
2015-01-16 10:12 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 13545: (followup) POD and error handling (1.97 KB, patch)
2015-02-10 15:56 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 13545 - Add barcode image generator service (2.51 KB, patch)
2015-02-13 16:22 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13545: (followup) POD and error handling (2.03 KB, patch)
2015-02-13 16:22 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13545 [QA Followup] - Complete POD documentation (1.09 KB, patch)
2015-02-13 16:22 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 13545 [QA Followup] - Complete POD documentation (954 bytes, patch)
2015-02-13 16:23 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2015-01-09 16:40:23 UTC
If we add a script to Koha that can be passed a barcode, we will be able to easily embed item and patron barcodes into html printable slips and notices. This can be very helpful for librarians, as it means scanning an image instead of typing in the barcode manually.
Comment 1 Kyle M Hall 2015-01-09 16:49:01 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2015-01-09 17:13:12 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2015-01-12 12:03:44 UTC Comment hidden (obsolete)
Comment 4 Brandon 2015-01-13 01:15:16 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2015-01-16 10:12:27 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-01-16 10:13:46 UTC
It could be great to have a small POD, to know the codes it's possible to use.
And maybe should we catch potential errors raised by the last line of the script?
Comment 7 Tomás Cohen Arazi 2015-02-10 15:56:28 UTC Comment hidden (obsolete)
Comment 8 Tomás Cohen Arazi 2015-02-10 15:59:30 UTC
I'm failing this one, even though I attached a followup so the author checks both the followup and the POD I added.

It should be clear which barcode 'types' we support, and they should be added to the dependencies if needed. For instance, I'm not sure we might add GD::Barcode to the dependencies.

I tried with GD::Barcode:::QRcode and GD::Barcode::UPCE, and it works fine.

I tested using an empty barcode number to generate an error.

Please revisit and sign if it is ok, but at least the POD should be ammended.
Comment 9 Kyle M Hall 2015-02-13 16:21:50 UTC
(In reply to Tomás Cohen Arazi from comment #8)
> I'm failing this one, even though I attached a followup so the author checks
> both the followup and the POD I added.
> 
> It should be clear which barcode 'types' we support, and they should be
> added to the dependencies if needed. For instance, I'm not sure we might add
> GD::Barcode to the dependencies.
> 
> I tried with GD::Barcode:::QRcode and GD::Barcode::UPCE, and it works fine.
> 
> I tested using an empty barcode number to generate an error.
> 
> Please revisit and sign if it is ok, but at least the POD should be ammended.

All the barcode types are part of the GD::Barcode module with the exception of Code93 which is used by the Canadian postal server. As such, I've left it out of the list for simplicity.
Comment 10 Kyle M Hall 2015-02-13 16:22:14 UTC
Created attachment 35912 [details] [review]
Bug 13545 - Add barcode image generator service

If we add a script to Koha that can be passed a barcode, we will be able
to easily embed item and patron barcodes into html printable slips and
notices. This can be very helpful for librarians, as it means scanning
an image instead of typing in the barcode manually.

This patch adds a barcode image generator that can be passed a barcode
and an optional type ( defaults to Code39, all GD::Barcode types should
work ). This image can be embedded in html slips and notices.
( e.g. <img src="/cgi-bin/koha/svc/barcode?barcode=<<items.barcode>>"></img> )

Test Plan:
1) Apply this patch
2) Browse to /cgi-bin/koha/svc/barcode?barcode=123456789 on your server
3) Note the barcode image

Signed-off-by: Brandon <brandon_h27@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 11 Kyle M Hall 2015-02-13 16:22:24 UTC
Created attachment 35913 [details] [review]
Bug 13545: (followup) POD and error handling

This patch adds POD to the new /svc/barcode service, and also implements some
error handling.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 12 Kyle M Hall 2015-02-13 16:22:26 UTC Comment hidden (obsolete)
Comment 13 Kyle M Hall 2015-02-13 16:23:02 UTC
Created attachment 35915 [details] [review]
Bug 13545 [QA Followup] - Complete POD documentation
Comment 14 Tomás Cohen Arazi 2015-02-13 17:13:13 UTC
Patches pushed to master.

Thanks Kyle!
Comment 15 Geetmala 2017-01-30 05:19:18 UTC
How to change library code in koha 3.20 because we seven branches each sch we have taken 3 letter before accession no. as barcode two of our sch name Prabhadevi and Sayani we started with PRAB and SAYA.  I want to change PRA and SAY instead of that please suggest me.
Comment 16 Katrin Fischer 2017-01-30 08:32:25 UTC
I think this is not possible with configuration in 3.20 - maybe it will be possible once notices templates are using template toolkit. This feature is in development for 17.05. If you want help for a customization, it's better to ask on the mailing list.