I'll attach a modified patch to do it.  You'll still have to update the
sys. pref. options to enable this feature.  Look at the changes to
installer/data/mysql/en/mandatory/sysprefs.sql for an idea of what to
set the sys. pref. to.

Good luck.

On Fri, 2009-03-27 at 11:42 -0400, Roche III, Edward wrote:
> How do you create the filter? 
> 
> Thanks!
> Ed
> 
> Edward J. Roche
> Network Administrator
> Solanco School District
> 717.786.2151 x2437
> 
> "At the End of the Day, Did You Play to Win or Not to Lose?" 
>      
> 
> 
> -----Original Message-----
> From: Michael Hafen [mailto:mdha...@tech.washk12.org] 
> Sent: Friday, March 27, 2009 11:29 AM
> To: Roche III, Edward
> Cc: koha-devel@lists.koha.org
> Subject: Re: [Koha-devel] [Koha] Barcode Don't Found
> 
> I have in my libraries several copies with a "T " before the number part
> of the barcode.  Koha works with it fine.  I find the trick is to make
> sure what's in the Koha database and what's encoded in the barcode are
> the same.  It is possible with itemInputBarcodeFilter processing.  I've
> used that sys. pref. to strip leading spaces ( which I put in ) from
> some barcodes.
> 
> If what you want is to be able to enter just the number, or the "T " and
> the number ( like from a barcode scanner ), then I think making a custom
> itemInputBarcodeFilter ( like I did to trim leading spaces ) would be a
> good solution.
> 
> On Fri, 2009-03-27 at 10:00 -0400, Roche III, Edward wrote:
> > That is an idea but I would think there was a way to have Koha except
> > the T+space.
> > 
> > Thanks!
> > Ed
> > 
> > Edward J. Roche
> > Network Administrator
> > Solanco School District
> > 717.786.2151 x2437
> > 
> > "At the End of the Day, Did You Play to Win or Not to Lose?" 
> >      
> > 
> > 
> > -----Original Message-----
> > From: koha-boun...@lists.katipo.co.nz
> > [mailto:koha-boun...@lists.katipo.co.nz] On Behalf Of Owen Leonard
> > Sent: Friday, March 27, 2009 9:52 AM
> > To: k...@lists.katipo.co.nz
> > Subject: Re: [Koha] [Koha-devel] Barcode Don't Found
> > 
> > > Currently doing it by hand but have tried with the scanner with no
> > luck.
> > 
> > I asked because sometimes scanners are configured to add characters
> > where you might not expect them. I did a quick test in my 3.0
> > installation and didn't have any problem typing in the barcode.. I
> > don't have any prefix options specified.
> > 
> > What I wonder is if you couldn't store just the numeric portion of the
> > barcode (if it's the T+space causing the problem) and configure your
> > scanners to strip off the "T "? Of course you'd have to consult the
> > documentation for your scanners to know if that was possible. We've
> > done something similar in the past.
> > 
> >   -- Owen
> > 
-- 
Michael Hafen
Systems Analyst and Programmer
Washington County School District
Utah, USA

for Koha checkout
http://koha-dev.washk12.org
or
git://koha-dev.washk12.org/koha
>From f4d37b5c2b722b9cdf0702294e9ef9cb29443fba Mon Sep 17 00:00:00 2001
From: Michael Hafen <mdha...@tech.washk12.org>
Date: Thu, 21 Aug 2008 13:28:19 -0600
Subject: [PATCH] Add T-prefix removal to itemBarcodeInputFilter
Content-Type: text/plain; charset="utf-8"

This adds an option to itemBarcodeInputFilter, trim-Tprefix, that removes whitespace and 'T' from the beginning of the barcode.
---
 C4/Circulation.pm                              |    2 ++
 installer/data/mysql/en/mandatory/sysprefs.sql |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 installer/data/mysql/en/mandatory/sysprefs.sql

diff --git a/C4/Circulation.pm b/C4/Circulation.pm
index 4dcf179..c3b3c8c 100644
--- a/C4/Circulation.pm
+++ b/C4/Circulation.pm
@@ -144,6 +144,8 @@ sub barcodedecode {
     $filter or return $barcode;     # ensure filter is defined, else return untouched barcode
 	if ($filter eq 'whitespace') {
 		$barcode =~ s/\s//g;
+	} elsif ($filter eq 'trim-Tprefix') {
+		$barcode =~ s/^[tT\s]*//;
 	} elsif ($filter eq 'cuecat') {
 		chomp($barcode);
 	    my @fields = split( /\./, $barcode );
diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql
old mode 100644
new mode 100755
index c79a727..5ab9693
--- a/installer/data/mysql/en/mandatory/sysprefs.sql
+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
@@ -143,7 +143,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 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');
 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('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','none|whitespace|trim-Tprefix|T-prefix|cuecat','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('OPACSubscriptionDisplay','economical','Specify how to display subscription information in the OPAC','economical|off|full','Choice');
-- 
1.5.6.3

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha.org
http://lists.koha.org/mailman/listinfo/koha-devel

Reply via email to