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

(-)a/C4/Circulation.pm (+10 lines)
Lines 38-43 use C4::Branch; # GetBranches Link Here
38
use C4::Log; # logaction
38
use C4::Log; # logaction
39
use C4::Koha qw(GetAuthorisedValueByCode);
39
use C4::Koha qw(GetAuthorisedValueByCode);
40
use C4::Overdues qw(CalcFine UpdateFine);
40
use C4::Overdues qw(CalcFine UpdateFine);
41
use Algorithm::CheckDigits;
42
41
use Data::Dumper;
43
use Data::Dumper;
42
use Koha::DateUtils;
44
use Koha::DateUtils;
43
use Koha::Calendar;
45
use Koha::Calendar;
Lines 169-174 sub barcodedecode { Link Here
169
				$barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i;
171
				$barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i;
170
			}
172
			}
171
		}
173
		}
174
	} elsif ($filter eq 'EAN13') {
175
		my $ean = CheckDigits('ean');
176
		if ( $ean->is_valid($barcode) ) {
177
			#$barcode = sprintf('%013d',$barcode); # this doesn't work on 32-bit systems
178
			$barcode = '0' x ( 13 - length($barcode) ) . $barcode;
179
		} else {
180
			warn "# [$barcode] not valid EAN-13/UPC-A\n";
181
		}
172
	}
182
	}
173
    return $barcode;    # return barcode, modified or not
183
    return $barcode;    # return barcode, modified or not
174
}
184
}
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 166-172 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES Link Here
166
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('emailLibrarianWhenHoldIsPlaced',0,'If ON, emails the librarian whenever a hold is placed',NULL,'YesNo');
166
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('emailLibrarianWhenHoldIsPlaced',0,'If ON, emails the librarian whenever a hold is placed',NULL,'YesNo');
167
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
167
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
168
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');
168
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');
169
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');
169
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|EAN13','Choice');
170
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
170
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
171
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
171
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
172
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
172
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 (+7 lines)
Lines 5536-5541 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5536
    SetVersion($DBversion);
5536
    SetVersion($DBversion);
5537
}
5537
}
5538
5538
5539
$DBversion = "3.09.00.XXX"; # FIXME
5540
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
5541
    $dbh->do("UPDATE systempreferences SET options=concat(options,'|EAN13') WHERE variable='itemBarcodeInputFilter' AND options NOT LIKE '%EAN13%'");
5542
    print "Upgrade to $DBversion done (Add itemBarcodeInputFilter choice EAN13)\n";
5543
    SetVersion($DBversion);
5544
}
5545
5539
=head1 FUNCTIONS
5546
=head1 FUNCTIONS
5540
5547
5541
=head2 TableExists($table)
5548
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+1 lines)
Lines 16-21 Circulation: Link Here
16
                  cuecat: Convert from CueCat form
16
                  cuecat: Convert from CueCat form
17
                  T-prefix: Remove the first number from T-prefix style
17
                  T-prefix: Remove the first number from T-prefix style
18
                  libsuite8: Convert from Libsuite8 form
18
                  libsuite8: Convert from Libsuite8 form
19
                  EAN13: EAN-13 or zero-padded UPC-A from
19
            - scanned item barcodes.
20
            - scanned item barcodes.
20
        -
21
        -
21
            - Sort previous checkouts on the circulation page from
22
            - Sort previous checkouts on the circulation page from
(-)a/t/Circulation_barcodedecode.t (-2 / +3 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 => 24;
7
use Test::More tests => 26;
8
C4::Context->_new_userenv(123456);
8
C4::Context->_new_userenv(123456);
9
C4::Context->set_userenv(1,'kmkale' , 1, 'kk1' , 'IMS', 0, 'kmkale@anantcorp.com');
9
C4::Context->set_userenv(1,'kmkale' , 1, 'kk1' , 'IMS', 0, 'kmkale@anantcorp.com');
10
10
Lines 18-23 our %inputs = ( Link Here
18
    whitespace => [" 26002315", "26002315 ", "\n\t26002315\n"],
18
    whitespace => [" 26002315", "26002315 ", "\n\t26002315\n"],
19
    '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'],
20
    'libsuite8' => ['b000126', 'b12', 'B0126', 'IMS-B-126', 'ims-b-126','CD0000024','00123','11998'],
21
    EAN13      => [qw(892685001928 695152)],
21
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
22
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
22
);
23
);
23
our %outputs = (
24
our %outputs = (
Lines 25-30 our %outputs = ( Link Here
25
    whitespace => [qw(26002315 26002315 26002315)],
26
    whitespace => [qw(26002315 26002315 26002315)],
26
    'T-prefix' => [qw(T0031472 T0000002         )],
27
    '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'],
28
    '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'],
29
    EAN13      => [qw(0892685001928 0000000695152)],
28
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
30
    other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
29
);
31
);
30
    
32
    
31
- 

Return to bug 6448