Bug fixes to get the new acqui.simple system working.
authortruth_nz <truth_nz>
Fri, 3 May 2002 02:47:33 +0000 (02:47 +0000)
committertruth_nz <truth_nz>
Fri, 3 May 2002 02:47:33 +0000 (02:47 +0000)
C4/Acquisitions.pm
acqui.simple/addbiblioitem.pl
acqui.simple/additem.pl
acqui.simple/savebiblio.pl
acqui.simple/savebiblioitem.pl
acqui.simple/saveitem.pl
detail.pl

index 9f29c1f..4b5432c 100644 (file)
@@ -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;
 
index 6bb0cbe..001cfca 100755 (executable)
@@ -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";
 <font size="6"><em>Adding New Group Information - $title</em></font>
 <table bgcolor="#ffcc00" width="80%" cellpadding="5">
 <tr valign="center">
@@ -63,14 +67,14 @@ if (! $biblionumber) {
 <td colspan="3"><select name="itemtype">
 EOF
 
-    ($count, @results) = &getitemtypes;
-    for (my $i = 0; $i < $count; $i++) {
-       print << "EOF";
+       ($count, @results) = &getitemtypes;
+       for (my $i = 0; $i < $count; $i++) {
+           print << "EOF";
 <option value="$results[$i]->{'itemtype'}">$results[$i]->{'itemtype'} - $results[$i]->{'description'}
 EOF
-    } # for
+       } # for
 
-    print << "EOF";
+       print << "EOF";
 </select></td>
 </tr>
 <tr>
@@ -116,6 +120,7 @@ EOF
   </table></FORM>
 EOF
 
-    print endmenu();
-    print endpage();
+       print endmenu();
+       print endpage();
+    } # else
 } # else
index 4f7b142..a209ca6 100755 (executable)
@@ -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";
 <center>
 <h2>Section Three: Specific Item Information</h2>
-<form action="saveitems" method="post">
+<form action="saveitem.pl" method="post">
 <input type="hidden" name="biblioitemnum" value="$biblioitemnum">
 <table>
 <tr>
index bb37689..9e24146 100755 (executable)
@@ -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
index 83eaa4e..e333751 100755 (executable)
@@ -36,5 +36,5 @@ if (! $biblionumber) {
 
     $biblioitemnum = &newbiblioitem($biblioitem);
 
-    print $input->redirect('additem.pl?biblioitemnum=$biblioitemnum');
+    print $input->redirect("additem.pl?biblioitemnum=$biblioitemnum");
 } # else
index 59be49e..ffb23a1 100755 (executable)
@@ -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
index ce53b2f..ade8d0b 100755 (executable)
--- 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 "<a href=request.pl?bib=$bib><img height=42  WIDTH=120 BORDER=0 src=\"/images/requests.gif\" align=right border=0></a>";
-}
+    print << "EOF";
+<a href=request.pl?bib=$bib><img height=42  WIDTH=120 BORDER=0 src=\"/images/requests.gif\" align=right border=0></a>
+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 <<printend
+print << "EOF";
 
 <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width="220">
 
@@ -66,39 +69,38 @@ print <<printend
 <TR VALIGN=TOP>
 
 <td  bgcolor="$main" 
-printend
-;
+EOF
+
 if ($type ne 'opac'){
  print "background=\"/images/background-mem.gif\"";
 }
-print <<printend
+print << "EOF";
 ><B>BIBLIO RECORD 
-printend
-;
+EOF
+
 if ($type ne 'opac'){
   print "$bib";
 }
-print <<printend
+print << "EOF";
 </TD></TR>
 
 
 <tr VALIGN=TOP  >
 <TD>
-printend
-;
+EOF
+
 if ($type ne 'opac'){
   print "<INPUT TYPE=\"image\" name=\"submit\"  VALUE=\"modify\" height=42  WIDTH=93 BORDER=0 src=\"/images/modify-mem.gif\"> 
   <INPUT TYPE=\"image\" name=\"delete\"  VALUE=\"delete\" height=42  WIDTH=93 BORDER=0 src=\"/images/delete-mem.gif\">";
 }
-print <<printend
+print << "EOF";
 <br>
 <FONT SIZE=2  face="arial, helvetica">
-printend
-;
+EOF
 
 
 if ($type ne 'opac'){
-print <<printend
+print << "EOF";
 <b>Subtitle:</b> $dat->{'subtitle'}<br>
 <b>Author:</b> $dat->{'author'}<br>
 <b>Additional Author:</b> $additional<br>
@@ -112,8 +114,8 @@ print <<printend
 <b>Serial:</b> $dat->{'serial'}<br>
 <b>Total Number of Items:</b> $count
 <p>
-printend
-;
+EOF
+
 }
 else {
 if ($dat->{'subtitle'} ne ''){
@@ -148,19 +150,14 @@ print "<b>Total Number of Items:</b> $count
 ";
 
 }
-print <<printend
+print << "EOF";
 </form>
 </font></TD>
 </TR>
 
 </TABLE>
 <img src="/images/holder.gif" width=16 height=300 align=left>
-
-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],"<br>";
-  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 "<p>";
 print mktablehdr();
 if ($type ne 'opac'){
-print <<printend
+print << "EOF";
 <TR VALIGN=TOP>
 <TD  bgcolor="99cc33" background="/images/background-mem.gif" colspan=2><p><b>HELP</b><br>
 <b>Update Biblio for all Items:</b> Click on the <b>Modify</b> button [left] to amend the biblio.  Any changes you make will update the record for <b>all</b> the items listed above. <p>
 <b>Updating the Biblio for only ONE or SOME Items:</b> 
-printend
-;
+EOF
+
 if ($type eq 'catmain'){
-print <<printend
+print << "EOF";
 If some of the items listed above need a different biblio, 
 you need to click on the wrong item, then shift the group it belongs to, to the correct biblio.
 You will need to know the correct biblio number
 <p>
 
    </TR>
-printend
-;
+EOF
+
 } else {
-print <<printend
+print << "EOF";
 If some of the items listed above need a different biblio, or are on the wrong biblio, you must use the <a href="acquisitions/">acquisitions</a> process to fix this. You will need to "re-order" the items, and delete them from this biblio.
 <p>
 
    </TR>
-printend
-;
+EOF
+
 }
 }
 print mktableft();