View | Details | Raw Unified | Return to bug 5418
Collapse All | Expand All

(-)a/C4/Circulation.pm (+9 lines)
Lines 137-142 System Pref options. Link Here
137
#
137
#
138
sub barcodedecode {
138
sub barcodedecode {
139
    my ($barcode, $filter) = @_;
139
    my ($barcode, $filter) = @_;
140
    my $branch = C4::Branch::mybranch();
140
    $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter;
141
    $filter = C4::Context->preference('itemBarcodeInputFilter') unless $filter;
141
    $filter or return $barcode;     # ensure filter is defined, else return untouched barcode
142
    $filter or return $barcode;     # ensure filter is defined, else return untouched barcode
142
	if ($filter eq 'whitespace') {
143
	if ($filter eq 'whitespace') {
Lines 155-160 sub barcodedecode { Link Here
155
        # FIXME: $barcode could be "T1", causing warning: substr outside of string
156
        # FIXME: $barcode could be "T1", causing warning: substr outside of string
156
        # Why drop the nonzero digit after the T?
157
        # Why drop the nonzero digit after the T?
157
        # Why pass non-digits (or empty string) to "T%07d"?
158
        # Why pass non-digits (or empty string) to "T%07d"?
159
	} elsif ($filter eq 'libsuite8') {
160
		unless($barcode =~ m/^($branch)-/i){	#if barcode starts with branch code its in Koha style. Skip it.
161
			if($barcode =~ m/^(\d)/i){	#Some barcodes even start with 0's & numbers and are assumed to have b as the item type in the libsuite8 software
162
                                $barcode =~ s/^[0]*(\d+)$/$branch-b-$1/i;
163
                        }else{
164
				$barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i;
165
			}
166
		}
158
	}
167
	}
159
    return $barcode;    # return barcode, modified or not
168
    return $barcode;    # return barcode, modified or not
160
}
169
}
(-)a/installer/data/mysql/en/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 145-151 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
145
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');
145
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');
146
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('globalDueDate','','If set, allows a global static due date for all checkouts','10','free');
146
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('globalDueDate','','If set, allows a global static due date for all checkouts','10','free');
147
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');
147
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');
148
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');
148
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');
149
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
149
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
150
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
150
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
151
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
151
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 (+8 lines)
Lines 3876-3881 VALUES Link Here
3876
    SetVersion ($DBversion);
3876
    SetVersion ($DBversion);
3877
};
3877
};
3878
3878
3879
$DBversion = '3.0X.0X.XXX';
3880
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
3881
    $dbh->do("update `systempreferences` set options='whitespace|T-prefix|cuecat|libsuite8' where variable='itemBarcodeInputFilter'");
3882
    print "Upgrade to $DBversion done (Add itemBarcodeInputFilter choice libsuite8)\n";
3883
    SetVersion ($DBversion);
3884
}
3885
3886
3879
=head1 FUNCTIONS
3887
=head1 FUNCTIONS
3880
3888
3881
=head2 DropAllForeignKeys($table)
3889
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-1 / +2 lines)
Lines 14-20 Circulation: Link Here
14
                  whitespace: Remove spaces from
14
                  whitespace: Remove spaces from
15
                  cuecat: Convert from CueCat form
15
                  cuecat: Convert from CueCat form
16
                  T-prefix: Remove the first number from T-prefix style
16
                  T-prefix: Remove the first number from T-prefix style
17
            - scanned patron barcodes.
17
                  libsuite8: Convert from Libsuite8 form
18
            - scanned item barcodes.
18
        -
19
        -
19
            - Sort previous checkouts on the circulation page from
20
            - Sort previous checkouts on the circulation page from
20
            - pref: previousIssuesDefaultSortOrder
21
            - pref: previousIssuesDefaultSortOrder
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl (-1 / +1 lines)
Lines 293-299 function refocus(calendar) { Link Here
293
        <!-- /TMPL_IF -->
293
        <!-- /TMPL_IF -->
294
294
295
        <!-- TMPL_IF NAME="UNKNOWN_BARCODE" -->
295
        <!-- TMPL_IF NAME="UNKNOWN_BARCODE" -->
296
            <li>The barcode was not found</li>
296
            <li>The barcode was not found <!-- TMPL_VAR NAME="barcode" --></li>
297
        <!-- /TMPL_IF -->
297
        <!-- /TMPL_IF -->
298
298
299
        <!-- TMPL_IF NAME="NOT_FOR_LOAN" -->
299
        <!-- TMPL_IF NAME="NOT_FOR_LOAN" -->
(-)a/kohaversion.pl (-1 / +1 lines)
Lines 16-22 the kohaversion is divided in 4 parts : Link Here
16
use strict;
16
use strict;
17
17
18
sub kohaversion {
18
sub kohaversion {
19
    our $VERSION = '3.03.00.004';
19
    our $VERSION = '3.0X.0X.XXX';
20
    # version needs to be set this way
20
    # version needs to be set this way
21
    # so that it can be picked up by Makefile.PL
21
    # so that it can be picked up by Makefile.PL
22
    # during install
22
    # during install
(-)a/t/Circulation_barcodedecode.t (-2 / +5 lines)
Lines 4-10 Link Here
4
use strict;
4
use strict;
5
use warnings;
5
use warnings;
6
6
7
use Test::More tests => 16;
7
use Test::More tests => 24;
8
C4::Context->_new_userenv(123456);
9
C4::Context->set_userenv(1,'kmkale' , 1, 'kk1' , 'IMS', 0, 'kmkale@anantcorp.com');
8
10
9
BEGIN {
11
BEGIN {
10
    use_ok('C4::Circulation');
12
    use_ok('C4::Circulation');
Lines 15-26 our %inputs = ( Link Here
15
                    'q.C3nZC3nZC3nWDNzYDxf2CNnY.fHmc.C3DWC3nZCNjXD3nW.', '.C3nZC3nZC3nWCxjWE3D1C3nX.cGf2.ENr7C3v7D3T3ENj3C3zYDNnZ.' ],
17
                    'q.C3nZC3nZC3nWDNzYDxf2CNnY.fHmc.C3DWC3nZCNjXD3nW.', '.C3nZC3nZC3nWCxjWE3D1C3nX.cGf2.ENr7C3v7D3T3ENj3C3zYDNnZ.' ],
16
    whitespace => [" 26002315", "26002315 ", "\n\t26002315\n"],
18
    whitespace => [" 26002315", "26002315 ", "\n\t26002315\n"],
17
    'T-prefix' => [qw(T0031472 T32)],
19
    'T-prefix' => [qw(T0031472 T32)],
20
    'libsuite8' => ['b000126', 'b12', 'B0126', 'IMS-B-126', 'ims-b-126','CD0000024','00123','11998'],
18
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
21
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
19
);
22
);
20
our %outputs = (
23
our %outputs = (
21
    cuecat     => ["26002315", "046675000808", "046675000808", "043000112403", "978068484914051500"],
24
    cuecat     => ["26002315", "046675000808", "046675000808", "043000112403", "978068484914051500"],
22
    whitespace => [qw(26002315 26002315 26002315)],
25
    whitespace => [qw(26002315 26002315 26002315)],
23
    'T-prefix' => [qw(T0031472 T0000002         )],
26
    'T-prefix' => [qw(T0031472 T0000002         )],
27
    'libsuite8' => ['IMS-b-126', 'IMS-b-12', 'IMS-B-126', 'IMS-B-126', 'ims-b-126','IMS-CD-24','IMS-b-123','IMS-b-11998'],
24
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
28
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
25
);
29
);
26
    
30
    
27
- 

Return to bug 5418