Koha/acqui.simple/saveitem.pl
truth_nz 0b52637ff6 Fixed bug due to way hashes take values. Was stopping items being saved to
database. Added code to pick up branch list from database.
2002-05-06 02:47:49 +00:00

35 lines
973 B
Perl
Executable file

#!/usr/bin/perl
use CGI;
use strict;
use C4::Acquisitions;
my $input = new CGI;
my $barcode = $input->param('barcode');
my $biblioitemnum = $input->param('biblioitemnum');
my $item = {
biblioitemnumber => $biblioitemnum,
homebranch => $input->param('homebranch'),
replacementprice => $input->param('replacementprice')?$input->param('replacementprice'):"",
itemnotes => $input->param('notes')?$input->param('notes'):""
}; # my $item
my $count;
my @results;
if (! $barcode) {
print $input->redirect('additem.pl?error=nobarcode');
} elsif (! $biblioitemnum) {
print $input->redirect('addbooks.pl');
} else {
($count, @results) = &getbiblioitem($biblioitemnum);
if (! $count) {
print->redirect('addbooks.pl');
} else {
$item->{'biblionumber'} = $results[0]->{'biblionumber'};
&newitems($item, ($barcode));
print $input->redirect("additem.pl?biblioitemnum=$biblioitemnum");
} # else
} # else