- #called from request.pl
- my ($biblioitemnumber)=@_;
- my $dbh=C4Connect;
- my $query="Select barcode from items where
- biblioitemnumber='$biblioitemnumber'
- and ((itemlost <> 1 and itemlost <> 2) or itemlost is NULL) and
- (wthdrawn <> 1 or wthdrawn is NULL)";
-
- my $sth=$dbh->prepare($query);
- $sth->execute;
- my @barcodes;
- my $i=0;
- while (my $data=$sth->fetchrow_hashref){
- $barcodes[$i]=$data->{'barcode'};
- $i++;
- }
- $sth->finish;
- $dbh->disconnect;
- return(@barcodes);
-
+ #called from request.pl
+ my ($biblioitemnumber)=@_;
+ my $dbh=C4Connect;
+ my $query="SELECT barcode, itemlost FROM items
+ WHERE biblioitemnumber = ?
+ AND (wthdrawn <> 1 OR wthdrawn IS NULL)";
+ my $sth=$dbh->prepare($query);
+ $sth->execute($biblioitemnumber);
+ my @barcodes;
+ my $i=0;
+ while (my $data=$sth->fetchrow_hashref){
+ $barcodes[$i]=$data;
+ $i++;
+ }
+ $sth->finish;
+ $dbh->disconnect;
+ return(@barcodes);