From 16954a80eb499e3b34783253d403ebf0ed794f9e Mon Sep 17 00:00:00 2001 From: sushi Date: Wed, 7 Jun 2006 04:29:10 +0000 Subject: [PATCH] Merging Katipo changes. Fix for bug 3589, can now order and receive donations in one go. Also a fix to allow user to create a new item, attached to an exisiting bibitem. --- acqui/newbiblio.pl | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/acqui/newbiblio.pl b/acqui/newbiblio.pl index fb30af036e..13b6d7de49 100755 --- a/acqui/newbiblio.pl +++ b/acqui/newbiblio.pl @@ -46,6 +46,7 @@ my $ordnum = $input->param('ordnum'); my $biblio = $input->param('biblio'); my $basketno = $input->param('basketno'); my $suggestionid = $input->param('suggestionid'); +my $donation = $input->param('donation'); my $close = $input->param('close'); my $data; my $new; @@ -78,7 +79,12 @@ if ( $ordnum eq '' ) { # create order else { #modify order $data = getsingleorder($ordnum); $biblio = $data->{'biblionumber'}; + #get basketno and suppleirno. too! + my $data2 = getbasket( $data->{'basketno'} ); + $basketno = $data2->{'basketno'}; + $booksellerid = $data2->{'booksellerid'}; } + my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "acqui/newbiblio.tmpl", @@ -182,6 +188,29 @@ else { $template->param( sort2 => $data->{'sort2'} ); } +my $bibitemsexists; + +#do a biblioitems lookup on bib +( my $bibitemscount, my @bibitems ) = getbiblioitembybiblionumber($biblio); +if ( $bibitemscount > 0 ) { + # warn "NEWBIBLIO: bibitems for $biblio exists\n"; + # warn Dumper $bibitemscount, @bibitems; + $bibitemsexists = 1; + + my @bibitemloop; + for ( my $i = 0 ; $i < $bibitemscount ; $i++ ) { + my %line; + $line{biblioitemnumber} = $bibitems[$i]->{'biblioitemnumber'}; + $line{isbn} = $bibitems[$i]->{'isbn'}; + $line{itemtype} = $bibitems[$i]->{'itemtype'}; + $line{volumeddesc} = $bibitems[$i]->{'volumeddesc'}; + push( @bibitemloop, \%line ); + + $template->param( bibitemloop => \@bibitemloop ); + } + $template->param( bibitemexists => "1" ); +} + # fill template $template->param( close => $close, @@ -225,7 +254,8 @@ $template->param( invoice => $data->{'booksellerinvoicenumber'}, ecost => $data->{'ecost'}, notes => $data->{'notes'}, - publishercode => $data->{'publishercode'} + publishercode => $data->{'publishercode'}, + donation => $donation ); output_html_with_http_headers $input, $cookie, $template->output; -- 2.39.2