@@ -, +, @@ --- C4/Circulation.pm | 6 +++++- circ/circulation.pl | 4 ++-- installer/data/mysql/en/mandatory/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 2 +- .../en/modules/admin/preferences/circulation.pref | 1 + .../prog/en/modules/circ/circulation.tmpl | 2 +- 6 files changed, 11 insertions(+), 6 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -136,7 +136,7 @@ System Pref options. # FIXME -- these plugins should be moved out of Circulation.pm # sub barcodedecode { - my ($barcode, $filter) = @_; + my ($barcode, $filter, $branch) = @_; $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter; $filter or return $barcode; # ensure filter is defined, else return untouched barcode if ($filter eq 'whitespace') { @@ -155,6 +155,10 @@ sub barcodedecode { # FIXME: $barcode could be "T1", causing warning: substr outside of string # Why drop the nonzero digit after the T? # Why pass non-digits (or empty string) to "T%07d"? + } elsif ($filter eq 'libsuite8') { + unless($barcode =~ m/^($branch)-/i){ + $barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i + } } return $barcode; # return barcode, modified or not } --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -115,8 +115,8 @@ if (C4::Context->preference("UseTablesortForCirc")) { my $barcode = $query->param('barcode') || ''; $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace - -$barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter')); +my $filter = C4::Context->preference('itemBarcodeInputFilter') || ''; +$barcode = barcodedecode($barcode,$filter,$branch) if( $barcode && C4::Context->preference('itemBarcodeInputFilter')); my $stickyduedate = $query->param('stickyduedate') || $session->param('stickyduedate'); my $duedatespec = $query->param('duedatespec') || $session->param('stickyduedate'); my $issueconfirmed = $query->param('issueconfirmed'); --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ a/installer/data/mysql/en/mandatory/sysprefs.sql @@ -145,7 +145,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines). Requires accruefines cronjob.','off|test|production','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('globalDueDate','','If set, allows a global static due date for all checkouts','10','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ceilingDueDate','','If set, date due will not be past this date. Enter date according to the dateformat System Preference',NULL,'free'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat|libsuite8','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -731,7 +731,7 @@ $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,ty $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('libraryAddress','','The address to use for printing receipts, overdues, etc. if different than physical address',NULL,'free')"); $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, test or production','test|production','Choice')"); $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('globalDueDate','','If set, allows a global static due date for all checkouts',NULL,'free')"); -$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','cuecat','Choice')"); +$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','libsuite8','Choice')"); $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo')"); $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free')"); $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACSubscriptionDisplay','economical','Specify how to display subscription information in the OPAC','economical|off|full','Choice')"); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -14,6 +14,7 @@ Circulation: whitespace: Remove spaces from cuecat: Convert from CueCat form T-prefix: Remove the first number from T-prefix style + libsuite8: Convert from Libsuite8 form - scanned patron barcodes. - - Sort previous checkouts on the circulation page from --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl @@ -301,7 +301,7 @@ function refocus(calendar) { -
  • The barcode was not found
  • +
  • The barcode was not found
  • --