From 4da8f3c72132b9706e2e074a7a9b8e271d040741 Mon Sep 17 00:00:00 2001 From: rangi Date: Sun, 4 May 2003 03:16:15 +0000 Subject: [PATCH] We have a simple acquisitions system without marc mostly going now. You can add a new biblio/biblioitem/item now. Currently you can only do this by using the Add biblio without ISBN/ISSN link. The next task is to get the isbnsearch and title search linking to the nonmarc scripts if marc support is off, and then to template them all. --- acqui.simple/addbiblio-nomarc.pl | 99 ++++++++++ acqui.simple/addbooks.pl | 22 ++- acqui.simple/additem-nomarc.pl | 313 +++++++++++++++++++++++++++++++ acqui.simple/savebiblio.pl | 46 +++++ acqui.simple/saveitem.pl | 8 +- 5 files changed, 475 insertions(+), 13 deletions(-) create mode 100755 acqui.simple/addbiblio-nomarc.pl create mode 100755 acqui.simple/additem-nomarc.pl create mode 100755 acqui.simple/savebiblio.pl diff --git a/acqui.simple/addbiblio-nomarc.pl b/acqui.simple/addbiblio-nomarc.pl new file mode 100755 index 0000000000..5653ed3528 --- /dev/null +++ b/acqui.simple/addbiblio-nomarc.pl @@ -0,0 +1,99 @@ +#!/usr/bin/perl + +# $Id$ + +# +# TODO +# +# Add info on biblioitems and items already entered as you enter new ones +# + +# 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::Output; + +my $input = new CGI; +my $error = $input->param('error'); + +print $input->header; +print startpage(); +print startmenu('acquisitions'); + +print << "EOF"; +Adding a new Biblio
+ + + + + +
Section One: Copyright Information
+EOF + +if ( $error eq "notitle" ) { + print << "EOF"; +

+

+ Please Specify a Title +
+EOF +} # if + +print << "EOF"; +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Title: *
Subtitle:
Author:
Series Title:
+ (if applicable)
Copyright Date:
Abstract:
Notes:
+
+ * Required +EOF + +print endmenu(); +print endpage(); diff --git a/acqui.simple/addbooks.pl b/acqui.simple/addbooks.pl index 5b76d39654..ec47b093fe 100755 --- a/acqui.simple/addbooks.pl +++ b/acqui.simple/addbooks.pl @@ -15,7 +15,6 @@ # # Add info on biblioitems and items already entered as you enter new ones - # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -46,12 +45,17 @@ my $query = new CGI; my $error = $query->param('error'); my $success = $query->param('biblioitem'); -my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "acqui.simple/addbooks.tmpl", - query => $query, - type => "intranet", - authnotrequired => 0, - flagsrequired => {catalogue => 1}, - debug => 1, - }); +my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "acqui.simple/addbooks.tmpl", + query => $query, + type => "intranet", + authnotrequired => 0, + flagsrequired => { catalogue => 1 }, + debug => 1, + } +); +my $marc_p = C4::Context->boolean_preference("marc"); +$template->param( NOTMARC => !$marc_p ); + output_html_with_http_headers $query, $cookie, $template->output; diff --git a/acqui.simple/additem-nomarc.pl b/acqui.simple/additem-nomarc.pl new file mode 100755 index 0000000000..9bffa2d959 --- /dev/null +++ b/acqui.simple/additem-nomarc.pl @@ -0,0 +1,313 @@ +#!/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::Biblio; +use C4::Output; + +my $input = new CGI; +my $biblionumber = $input->param('biblionumber'); +my $error = $input->param('error'); +my $maxbarcode; +my $isbn; +my $bibliocount; +my @biblios; +my $biblioitemcount; +my @biblioitems; +my $branchcount; +my @branches; +my %branchnames; +my $itemcount; +my @items; +my $itemtypecount; +my @itemtypes; +my %itemtypedescriptions; + +if (! $biblionumber) { + print $input->redirect('addbooks.pl'); +} else { + + ($bibliocount, @biblios) = &getbiblio($biblionumber); + + if (! $bibliocount) { + print $input->redirect('addbooks.pl'); + } else { + + ($biblioitemcount, @biblioitems) = &getbiblioitembybiblionumber($biblionumber); + ($branchcount, @branches) = &branches; + ($itemtypecount, @itemtypes) = &getitemtypes; + + for (my $i = 0; $i < $itemtypecount; $i++) { + $itemtypedescriptions{$itemtypes[$i]->{'itemtype'}} = $itemtypes[$i]->{'description'}; + } # for + + for (my $i = 0; $i < $branchcount; $i++) { + $branchnames{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'}; + } # for + + print $input->header; + print startpage(); + print startmenu('acquisitions'); + + print << "EOF"; +$biblios[0]->{'title'} +

+EOF + + if ($error eq "nobarcode") { + print << "EOF"; +You must give the item a barcode +

+EOF + } elsif ($error eq "nobiblioitem") { + print << "EOF"; +You must create a new group for your item to be added to +

+EOF + } elsif ($error eq "barcodeinuse") { + print << "EOF"; +Sorry, that barcode is already in use +

+EOF + } # elsif + print << "EOF"; + + + + + + + +EOF + + for (my $i = 0; $i < $biblioitemcount; $i++) { + if ($biblioitems[$i]->{'itemtype'} eq "WEB") { + + print << "EOF"; + + + + + + +EOF + + } else { + $biblioitems[$i]->{'dewey'} =~ /(\d*\.\d\d)/; + $biblioitems[$i]->{'dewey'} = $1; + + print << "EOF"; + + + + + + +EOF + + ($itemcount, @items) = &getitemsbybiblioitem($biblioitems[$i]->{'biblioitemnumber'}); + + for (my $j = 0; $j < $itemcount; $j++) { + print << "EOF"; + + + +EOF + } # for + } # else + } # for + + print << "EOF"; +
BIBLIO RECORD $biblionumber
Author: $biblios[0]->{'author'}
+Copyright: $biblios[0]->{'copyrightdate'}
+Series Title: $biblios[0]->{'seriestitle'}
+Notes: $biblios[0]->{'notes'}
$biblioitems[$i]->{'biblioitemnumber'} GROUP - $itemtypedescriptions{$biblioitems[$i]->{'itemtype'}}
URL: $biblioitems[$i]->{'url'}
+Date: $biblioitems[$i]->{'publicationyear'}
+Notes: $biblioitems[$i]->{'notes'}
$biblioitems[$i]->{'biblioitemnumber'} GROUP - $itemtypedescriptions{$biblioitems[$i]->{'itemtype'}}
ISBN: $biblioitems[$i]->{'isbn'}
+Dewey: $biblioitems[$i]->{'dewey'}
+Publisher: $biblioitems[$i]->{'publishercode'}
+Place: $biblioitems[$i]->{'place'}
+Date: $biblioitems[$i]->{'publicationyear'}
Item: $items[$j]->{'barcode'}
+Home Branch: $branchnames{$items[$j]->{'homebranch'}}
+Notes: $items[$j]->{'itemnotes'}
+ + +

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ADD NEW ITEM:
+For a website add the group only
Item Barcode:
Branch:
Replacement Price:
Notes:
Add to existing group:
Group:
OR Add to a new Group:
Format:
ISBN:
Publisher:
Publication Year:
Place of Publication:
Illustrator:
Additional Authors:
One Author per line
Subject Headings:
One Subject per line
Website URL:
Dewey:
Dewey Subclass:
ISSN:
LCCN: +
Volume:
Number:
Volume Description:
Pages:
Size:
Notes:
+ +
+
+EOF + + print endmenu('acquisitions'); + print endpage(); + } # if +} # if diff --git a/acqui.simple/savebiblio.pl b/acqui.simple/savebiblio.pl new file mode 100755 index 0000000000..71403339dd --- /dev/null +++ b/acqui.simple/savebiblio.pl @@ -0,0 +1,46 @@ +#!/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 CGI; +use strict; +use C4::Catalogue; +use C4::Biblio; + +my $input = new CGI; +my $biblio = { + title => $input->param('title'), + subtitle => $input->param('subtitle')?$input->param('subtitle'):"", + author => $input->param('author')?$input->param('author'):"", + seriestitle => $input->param('seriestitle')?$input->param('seriestitle'):"", + copyright => $input->param('copyrightdate')?$input->param('copyrightdate'):"", + abstract => $input->param('abstract')?$input->param('abstract'):"", + notes => $input->param('notes')?$input->param('notes'):"" +}; # my $biblio +my $biblionumber; + +if (! $biblio->{'title'}) { + print $input->redirect('addbiblio-nomarc.pl?error=notitle'); +} else { + + $biblionumber = &newbiblio($biblio); + &newsubtitle($biblionumber, $biblio->{'subtitle'}); + + print $input->redirect("additem-nomarc.pl?biblionumber=$biblionumber"); +} # else diff --git a/acqui.simple/saveitem.pl b/acqui.simple/saveitem.pl index 2726f09fac..a1c62f4a9f 100755 --- a/acqui.simple/saveitem.pl +++ b/acqui.simple/saveitem.pl @@ -72,15 +72,15 @@ 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); } 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) { @@ -90,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 -- 2.39.5