Template for 135a field plugin
[koha.git] / acqui.simple / saveitem.pl
index 370d199..dadf0f8 100755 (executable)
@@ -1,8 +1,27 @@
 #!/usr/bin/perl
 
+# $Id$
+
+# 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 CGI;
 use strict;
-use C4::Catalogue;
+use C4::Catalogue;
 use C4::Biblio;
 
 my $input            = new CGI;
@@ -13,6 +32,7 @@ my $item             = {
     biblionumber     => $biblionumber,
     biblioitemnumber => $biblioitemnumber?$biblioitemnumber:"",
     homebranch       => $input->param('homebranch'),
+    holdingbranch       => $input->param('homebranch'),
     replacementprice => $input->param('replacementprice')?$input->param('replacementprice'):"",
     itemnotes        => $input->param('notes')?$input->param('notes'):""
 }; # my $item
@@ -24,8 +44,6 @@ my $biblioitem       = {
     publicationyear   => $input->param('publicationyear')?$input->param('publicationyear'):"",
     place             => $input->param('place')?$input->param('place'):"",
     illus             => $input->param('illus')?$input->param('illus'):"",
-    additionalauthors => $input->param('additionalauthors')?$input->param('additionalauthors'):"",
-    subjectheadings   => $input->param('subjectheadings')?$input->param('subjectheadings'):"",
     url               => $input->param('url')?$input->param('url'):"",
     dewey             => $input->param('dewey')?$input->param('dewey'):"",
     subclass          => $input->param('subclass')?$input->param('subclass'):"",
@@ -36,7 +54,7 @@ my $biblioitem       = {
     volumeddesc       => $input->param('volumeddesc')?$input->param('volumeddesc'):"",
     pages             => $input->param('pages')?$input->param('pages'):"",
     size              => $input->param('size')?$input->param('size'):"",
-    notes             => $input->param('notes')?$input->param('notes'):""
+    notes             => $input->param('itemnotes')?$input->param('itemnotes'):""
 }; # my biblioitem
 my $newgroup = 0;
 my $website  = 0;
@@ -53,15 +71,16 @@ if ($input->param('newgroup')) {
 if (! $biblionumber) {
     print $input->redirect('addbooks.pl');
 } elsif ((! $barcode) && (! $website)) {
-    print $input->redirect("additem.pl?biblionumber=$biblionumber&error=nobarcode");
+    print $input->redirect("additem-nomarc.pl?biblionumber=$biblionumber&error=nobarcode");
 } elsif ((! $newgroup) && (! $biblioitemnumber)) {
-    print $input->redirect("additem.pl?biblionumber=$biblionumber&error=nobiblioitem");
+    print $input->redirect("additem-nomarc.pl?biblionumber=$biblionumber&error=nobiblioitem");
 } else {
-    
+
     if ($website) {
        &newbiblioitem($biblioitem);
+               print $input->redirect("additem-nomarc.pl?biblionumber=$biblionumber");
     } elsif (&checkitems(1,$barcode)) {
-       print $input->redirect("additem.pl?biblionumber=$biblionumber&error=barcodeinuse");
+       print $input->redirect("additem-nomarc.pl?biblionumber=$biblionumber&error=barcodeinuse");
     } else {
 
        if ($newgroup) {
@@ -71,6 +90,6 @@ if (! $biblionumber) {
 
        &newitems($item, ($barcode));
 
-       print $input->redirect("additem.pl?biblionumber=$biblionumber");
+       print $input->redirect("additem-nomarc.pl?biblionumber=$biblionumber");
     } # else
 } # else