Bug 26352: Add plugin hooks to transform patron barcodes
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 2 Sep 2020 13:22:57 +0000 (09:22 -0400)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 6 Oct 2021 12:56:09 +0000 (14:56 +0200)
commitaea8ce7fccf4b2e09de74d12d2d0e03bfaea65c0
tree48e2295f703eaf9ccb31541cbda9428bbb3e1069
parentb2b1483f4d829512b7d92723b587a7f060de57bb
Bug 26352: Add plugin hooks to transform patron barcodes

Some of our partners have unusual barcode requirements that have
required us to transform scanned barcodes using javascript. This is not
the most reliable method. It would make more sense to have Koha
transform the barcodes on the backend using a plugin. We should add
hooks to transform and generate new item and patron barcodes.

Test Plan:
1) Apply this patch
2) Download and install the Barcode Transformer plugin
   https://github.com/bywatersolutions/koha-plugin-barcode-transformer/releases/download/v1.0.1/koha-plugin-barcode-transformer-v1.0.1.kpz
3) Go to the plugin configuration page, set the configuration to the example configuration from the same page
4) In the patron search and anywhere else you can scan a patron
   cardnumber, type in some cardnumbers but prefix them with A and postfix
   them with A or B, e.g. A12345AA12345B
5) Note the letters are removed by Koha!
6) Try a cardnumber like X123456Y
7) Note Koha converts it to Z13456Z

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/SIP/Sip/MsgType.pm
Koha/Patron.pm
circ/circulation.pl
members/memberentry.pl
opac/sco/sco-main.pl