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

(-)a/tools/inventory.pl (-3 / +8 lines)
Lines 21-26 Link Here
21
use strict;
21
use strict;
22
use warnings;
22
use warnings;
23
23
24
use File::Slurp qw(read_file);
25
24
#need to open cgi and get the fh before anything else opens a new cgi context (see C4::Auth)
26
#need to open cgi and get the fh before anything else opens a new cgi context (see C4::Auth)
25
use CGI;
27
use CGI;
26
my $input = CGI->new;
28
my $input = CGI->new;
Lines 147-154 if ($uploadbarcodes && length($uploadbarcodes)>0){ Link Here
147
    my $qwthdrawn = $dbh->prepare($strsth);
149
    my $qwthdrawn = $dbh->prepare($strsth);
148
    my @errorloop;
150
    my @errorloop;
149
    my $count=0;
151
    my $count=0;
150
    while (my $barcode=<$uploadbarcodes>){
152
151
        $barcode =~ s/\r?\n$//;
153
    # This allows us to handle files where lines are delimited by \r, \n, or \r\n.
154
    my $file_contents = read_file( $uploadbarcodes );
155
    my @barcodes = split( /\r\n|\n|\r/, $file_contents );
156
157
    for my $barcode ( @barcodes ){
152
        if ($qwthdrawn->execute($barcode) &&$qwthdrawn->rows){
158
        if ($qwthdrawn->execute($barcode) &&$qwthdrawn->rows){
153
            push @errorloop, {'barcode'=>$barcode,'ERR_WTHDRAWN'=>1};
159
            push @errorloop, {'barcode'=>$barcode,'ERR_WTHDRAWN'=>1};
154
        }else{
160
        }else{
155
- 

Return to bug 10625