From 073dc61c59fdf7544966c1661c50b8e379d24b40 Mon Sep 17 00:00:00 2001 From: truth_nz Date: Fri, 3 May 2002 02:47:33 +0000 Subject: [PATCH] Bug fixes to get the new acqui.simple system working. --- C4/Acquisitions.pm | 13 ++-- acqui.simple/addbiblioitem.pl | 29 ++++---- acqui.simple/additem.pl | 4 +- acqui.simple/savebiblio.pl | 19 +++--- acqui.simple/savebiblioitem.pl | 2 +- acqui.simple/saveitem.pl | 4 +- detail.pl | 121 ++++++++++++++++----------------- 7 files changed, 99 insertions(+), 93 deletions(-) diff --git a/C4/Acquisitions.pm b/C4/Acquisitions.pm index 9f29c1fa7d..4b5432c182 100644 --- a/C4/Acquisitions.pm +++ b/C4/Acquisitions.pm @@ -406,13 +406,12 @@ biblionumber = $bibnum, title = $biblio->{'title'}, author = $biblio->{'author'}, copyrightdate = $biblio->{'copyright'}, -series = $series; +serial = $series, seriestitle = $biblio->{'seriestitle'}, notes = $biblio->{'notes'}, abstract = $biblio->{'abstract'}"; $sth = $dbh->prepare($query); -# print $query; $sth->execute; $sth->finish; @@ -912,14 +911,18 @@ biblioitemnumber = $item->{'biblioitemnumber'}, barcode = $barcode, booksellerid = $item->{'booksellerid'}, dateaccessioned = NOW(), -homebranch = $item->{'branch'}, -holdingbranch = $item->{'branch'}, +homebranch = $item->{'homebranch'}, +holdingbranch = $item->{'homebranch'}, price = $item->{'price'}, replacementprice = $item->{'replacementprice'}, replacementpricedate = NOW(), -notforloan = $item->{'loan'}, itemnotes = $item->{'itemnotes'}"; + if ($item->{'loan'}) { + $query .= ", +notforloan = $item->{'loan'}"; + } # if + $sth = $dbh->prepare($query); $sth->execute; diff --git a/acqui.simple/addbiblioitem.pl b/acqui.simple/addbiblioitem.pl index 6bb0cbe5f7..001cfcae3d 100755 --- a/acqui.simple/addbiblioitem.pl +++ b/acqui.simple/addbiblioitem.pl @@ -16,13 +16,17 @@ if (! $biblionumber) { } else { ($count, @results) = &getbiblio($biblionumber); - $title = @results[0]->{'title'}; + + if (! $count) { + print $input->redirect('addbooks.pl'); + } else { + $title = @results[0]->{'title'}; - print $input->header; - print startpage(); - print startmenu('acquisitions'); + print $input->header; + print startpage(); + print startmenu('acquisitions'); - print << "EOF"; + print << "EOF"; Adding New Group Information - $title @@ -63,14 +67,14 @@ if (! $biblionumber) { @@ -116,6 +120,7 @@ EOF
EOF - print endmenu(); - print endpage(); + print endmenu(); + print endpage(); + } # else } # else diff --git a/acqui.simple/additem.pl b/acqui.simple/additem.pl index 4f7b1428b3..a209ca6fc5 100755 --- a/acqui.simple/additem.pl +++ b/acqui.simple/additem.pl @@ -15,7 +15,7 @@ my @results; if (! $biblioitemnum) { print $input->redirect('addbooks.pl'); } else { - + ($count, @results) = &getbiblioitem($biblioitemnum); if (! $count) { @@ -62,7 +62,7 @@ EOF print << "EOF";

Section Three: Specific Item Information

-
+ diff --git a/acqui.simple/savebiblio.pl b/acqui.simple/savebiblio.pl index bb37689e51..9e24146279 100755 --- a/acqui.simple/savebiblio.pl +++ b/acqui.simple/savebiblio.pl @@ -5,13 +5,14 @@ use strict; use C4::Acquisitions; my $input = new CGI; -my $biblio->{'title'} = $input->param('title'); -my $biblio->{'subtitle'} = $input->param('subtitle'); -my $biblio->{'author'} = $input->param('author'); -my $biblio->{'seriestitle'} = $input->param('seriestitle'); -my $biblio->{'copyright'} = $input->param('copyrightdate'); -my $biblio->{'abstract'} = $input->param('abstract'); -my $biblio->{'notes'} = $input->param('notes'); +my $biblio = { title => $input->param('title'), + subtitle => $input->param('subtitle'), + author => $input->param('author'), + seriestitle => $input->param('seriestitle'), + copyright => $input->param('copyrightdate'), + abstract => $input->param('abstract'), + notes => $input->param('notes') + }; # my $biblio my $biblionumber; if (! $biblio->{'title'}) { @@ -19,7 +20,7 @@ if (! $biblio->{'title'}) { } else { $biblionumber = &newbiblio($biblio); - &newsubtitle($biblionumber, $subtitle); + &newsubtitle($biblionumber, $biblio->{'subtitle'}); - print $input->redirect('addbiblioitem.pl?biblionumber=$biblionumber'); + print $input->redirect("addbiblioitem.pl?biblionumber=$biblionumber"); } # else diff --git a/acqui.simple/savebiblioitem.pl b/acqui.simple/savebiblioitem.pl index 83eaa4ee00..e333751cd4 100755 --- a/acqui.simple/savebiblioitem.pl +++ b/acqui.simple/savebiblioitem.pl @@ -36,5 +36,5 @@ if (! $biblionumber) { $biblioitemnum = &newbiblioitem($biblioitem); - print $input->redirect('additem.pl?biblioitemnum=$biblioitemnum'); + print $input->redirect("additem.pl?biblioitemnum=$biblioitemnum"); } # else diff --git a/acqui.simple/saveitem.pl b/acqui.simple/saveitem.pl index 59be49e9fd..ffb23a1cd2 100755 --- a/acqui.simple/saveitem.pl +++ b/acqui.simple/saveitem.pl @@ -8,7 +8,7 @@ my $input = new CGI; my $barcode = $input->param('barcode'); my $biblioitemnum = $input->param('biblioitemnum'); my $item = { - biblioitemnum => $biblioitemnum, + biblioitemnumber => $biblioitemnum, homebranch => $input->param('homebranch'), replacementprice => $input->param('replacementprice'), itemnotes => $input->param('notes') @@ -30,6 +30,6 @@ if (! $barcode) { $item->{'biblionumber'} = $results[0]->{'biblionumber'}; &newitems($item, ($barcode)); - print $input->redirect('additem.pl?biblioitemnum=$biblioitemnum'); + print $input->redirect("additem.pl?biblioitemnum=$biblioitemnum"); } # else } # else diff --git a/detail.pl b/detail.pl index ce53b2fa6d..ade8d0b9df 100755 --- a/detail.pl +++ b/detail.pl @@ -4,57 +4,60 @@ #written 8/11/99 use strict; -#use DBI; use C4::Search; use CGI; use C4::Output; my $input = new CGI; -print $input->header; -#whether it is called from the opac of the intranet -my $type=$input->param('type'); -if ($type eq ''){ - $type='intra'; -} -#setup colours +my $type = $input->param('type'); +my $bib = $input->param('bib'); +my $title = $input->param('title'); +my @items = &ItemInfo(undef, $bib, $type); +my $dat = &bibdata($bib); +my $count = @items; +my ($count3, $addauthor) = &addauthor($bib); +my $additional = $addauthor->[0]->{'author'}; +my @temp = split('\t', $items[0]); my $main; my $secondary; + +if ($type eq ''){ + $type = 'opac'; +} # if + +# setup colours if ($type eq 'opac'){ - $main='#99cccc'; - $secondary='#efe5ef'; + $main = '#99cccc'; + $secondary = '#efe5ef'; } else { - $main='#cccc99'; - $secondary='#ffffcc'; -} + $main = '#cccc99'; + $secondary = '#ffffcc'; +} # else + +print $input->header; print startpage(); print startmenu($type); -#print $type; -my $blah; -my $bib=$input->param('bib'); -my $title=$input->param('title'); + if ($type ne 'opac'){ - print ""; -} + print << "EOF"; + +EOF +} # if +for (my $i = 1; $i < $count3; $i++) { + $additional .= "|" . $addauthor->[$i]->{'author'}; +} # for -my @items=ItemInfo(\$blah,$bib,$type); -my $dat=bibdata($bib); -my $count=@items; -my ($count3,$addauthor)=addauthor($bib); -my $additional=$addauthor->[0]->{'author'}; -for (my $i=1;$i<$count3;$i++){ - $additional=$additional."|".$addauthor->[$i]->{'author'}; -} -my @temp=split('\t',$items[0]); if ($type eq 'catmain'){ print mkheadr(3,"Catalogue Maintenance"); -} +} # if + if ($dat->{'author'} ne ''){ print mkheadr(3,"$dat->{'title'} ($dat->{'author'}) $temp[4]"); } else { print mkheadr(3,"$dat->{'title'} $temp[4]"); } -print < @@ -66,39 +69,38 @@ print <
BIBLIO RECORD -printend -; +EOF + if ($type ne 'opac'){ print "$bib"; } -print <
-printend -; +EOF + if ($type ne 'opac'){ print " "; } -print < -printend -; +EOF if ($type ne 'opac'){ -print <Subtitle: $dat->{'subtitle'}
Author: $dat->{'author'}
Additional Author: $additional
@@ -112,8 +114,8 @@ print <Serial: $dat->{'serial'}
Total Number of Items: $count

-printend -; +EOF + } else { if ($dat->{'subtitle'} ne ''){ @@ -148,19 +150,14 @@ print "Total Number of Items: $count "; } -print <

- -printend -; - - -#print @items; +EOF my $i=0; print center(); @@ -173,8 +170,8 @@ if ($type eq 'opac'){ } my $colour=1; while ($i < $count){ -# print $items[$i],"
"; - my @results=split('\t',$items[$i]); + + my @results = split('\t', $items[$i]); if ($type ne 'opac'){ $results[1]=mklink("/cgi-bin/koha/moredetail.pl?item=$results[5]&bib=$bib&bi=$results[8]&type=$type",$results[1]); } @@ -216,31 +213,31 @@ print mktableft(); print "

"; print mktablehdr(); if ($type ne 'opac'){ -print <

HELP
Update Biblio for all Items: Click on the Modify button [left] to amend the biblio. Any changes you make will update the record for all the items listed above.

Updating the Biblio for only ONE or SOME Items: -printend -; +EOF + if ($type eq 'catmain'){ -print < -printend -; +EOF + } else { -print <acquisitions process to fix this. You will need to "re-order" the items, and delete them from this biblio.

-printend -; +EOF + } } print mktableft(); -- 2.39.5