diff --git a/acqui.simple/additem-nomarc.pl b/acqui.simple/additem-nomarc.pl index 9bffa2d959..5b8a0ab475 100755 --- a/acqui.simple/additem-nomarc.pl +++ b/acqui.simple/additem-nomarc.pl @@ -19,13 +19,22 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA +# $Log$ +# Revision 1.2 2003/05/11 06:59:11 rangi +# Mostly templated. +# Still needs some work +# + use CGI; use strict; use C4::Catalogue; use C4::Biblio; use C4::Output; +use HTML::Template; +use C4::Auth; +use C4::Interface::CGI::Output; -my $input = new CGI; +my $input = new CGI; my $biblionumber = $input->param('biblionumber'); my $error = $input->param('error'); my $maxbarcode; @@ -43,271 +52,82 @@ my $itemtypecount; my @itemtypes; my %itemtypedescriptions; -if (! $biblionumber) { +if ( !$biblionumber ) { print $input->redirect('addbooks.pl'); -} else { +} +else { - ($bibliocount, @biblios) = &getbiblio($biblionumber); + ( $bibliocount, @biblios ) = &getbiblio($biblionumber); - if (! $bibliocount) { - print $input->redirect('addbooks.pl'); - } else { + if ( !$bibliocount ) { + print $input->redirect('addbooks.pl'); + } + else { - ($biblioitemcount, @biblioitems) = &getbiblioitembybiblionumber($biblionumber); - ($branchcount, @branches) = &branches; - ($itemtypecount, @itemtypes) = &getitemtypes; + ( $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 < $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 + for ( my $i = 0 ; $i < $branchcount ; $i++ ) { + $branchnames{ $branches[$i]->{'branchcode'} } = + $branches[$i]->{'branchname'}; + } # for - print $input->header; - print startpage(); - print startmenu('acquisitions'); + # print $input->header; + # print startpage(); + # print startmenu('acquisitions'); + my $input = new CGI; + my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { + template_name => "acqui.simple/additem-nomarc.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { catalogue => 1 }, + debug => 1, + } + ); - print << "EOF"; -$biblios[0]->{'title'} -
-EOF + if ( $error eq "nobarcode" ) { + $template->param( NOBARCODE => 1 ); + } + elsif ( $error eq "nobiblioitem" ) { + $template->param( NOBIBLIOITEM => 1 ); + } + elsif ( $error eq "barcodeinuse" ) { + $template->param( BARCODEINUSE => 1 ); + } # elsif - 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"; -
| 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'} |
-
+
+
+
+
| BIBLIO RECORD |
+
| Author: +Copyright: +Series Title: +Notes: |
+
| URL: +Date: +Notes: |
+
| ISBN: +Dewey: +Publisher: +Place: +Date: |
+Item: +Home Branch: $branchnames{$items[$j]->{'homebranch'}} +Notes: |
+
+