turned of the branchtransfer when an item is set to "waiting".
[koha.git] / updatebibitem.pl
index 9d1d4ff..8c3851e 100755 (executable)
@@ -1,5 +1,23 @@
 #!/usr/bin/perl
 
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
 use C4::Database;
 use CGI;
 use strict;
@@ -8,6 +26,8 @@ use C4::Output;
 use C4::Search;
 
 my $input= new CGI;
+#print $input->header;
+#print $input->Dump;
 
 my $bibitemnum      = checkinp($input->param('bibitemnum'));
 my $bibnum          = checkinp($input->param('bibnum'));
@@ -17,6 +37,12 @@ my $isbn            = checkinp($input->param('ISBN'));
 my $publishercode   = checkinp($input->param('Publisher'));
 my $publicationdate = checkinp($input->param('Publication'));
 my $class           = checkinp($input->param('Class'));
+my $illus           = checkinp($input->param('Illustrations'));
+my $pages           = checkinp($input->param('Pages'));
+my $volumeddesc     = checkinp($input->param('Volume'));
+my $notes           = checkinp($input->param('Notes'));
+my $size            = checkinp($input->param('Size'));
+my $place           = checkinp($input->param('Place'));
 my $classification;
 my $dewey;
 my $subclass;
@@ -26,6 +52,7 @@ if ($itemtype ne 'NF') {
 } # if
 
 if ($class =~/[0-9]+/) {
+#   print $class;
    $dewey= $class;
    $dewey=~ s/[a-z]+//gi;
    my @temp;
@@ -36,20 +63,16 @@ if ($class =~/[0-9]+/) {
    } # else
    $classification=$temp[0];
    $subclass=$temp[1];
-
+#   print $classification,$dewey,$subclass;
 } else {
   $dewey='';
   $subclass='';
 } # else
 
-my $illus       = checkinp($input->param('Illustrations'));
-my $pages       = checkinp($input->param('Pages'));
-my $volumeddesc = checkinp($input->param('Volume'));
-my $notes       = checkinp($input->param('Notes'));
-my $size        = checkinp($input->param('Size'));
-my $place       = checkinp($input->param('Place'));
 my (@items) = &itemissues($bibitemnum);
+#print @items;           
 my $count   = @items;
+#print $count;
 my @barcodes;
 
 my $existing=$input->param('existing');
@@ -111,6 +134,7 @@ if ($existing eq 'YES'){
       &modbibitem({
          biblioitemnumber => $bibitemnum,
          itemtype         => $itemtype?$itemtype:"",
+         url              => $url?$url:"",
          isbn             => $isbn?$isbn:"",
          publishercode    => $publishercode?$publishercode:"",
          publicationyear  => $publicationdate?$publicationdate:"",
@@ -134,7 +158,24 @@ if ($existing eq 'YES'){
          }                                                                       
        }
       
-   }
+   } else {
+     &modbibitem({
+         biblioitemnumber => $bibitemnum,
+        itemtype         => $itemtype?$itemtype:"",
+        url              => $url?$url:"",
+        isbn             => $isbn?$isbn:"",
+        publishercode    => $publishercode?$publishercode:"",
+         publicationyear  => $publicationdate?$publicationdate:"",
+         classification   => $classification?$classification:"",
+         dewey            => $dewey?$dewey:"",
+         subclass         => $subclass?$subclass:"",
+         illus            => $illus?$illus:"",
+         pages            => $pages?$pages:"",
+         volumeddesc      => $volumeddesc?$volumeddesc:"",
+         notes            => $notes?$notes:"",
+         size             => $size?$size:"",
+         place            => $place?$place:"" });
+   } # else
 }
 print $input->redirect("moredetail.pl?type=intra&bib=$bibnum&bi=$bibitemnum");