moving cataloguing scripts to a cataloguing directory (more logic than acqui.simple...
[koha.git] / cataloguing / addbooks.pl
1 #!/usr/bin/perl
2
3 # $Id$
4
5 #
6 # Modified saas@users.sf.net 12:00 01 April 2001
7 # The biblioitemnumber was not correctly initialised
8 # The max(barcode) value was broken - koha 'barcode' is a string value!
9 # - If left blank, barcode value now defaults to max(biblionumber)
10
11 #
12 # TODO
13 #
14 # Add info on biblioitems and items already entered as you enter new ones
15 #
16 # Add info on biblioitems and items already entered as you enter new ones
17
18 # Copyright 2000-2002 Katipo Communications
19 #
20 # This file is part of Koha.
21 #
22 # Koha is free software; you can redistribute it and/or modify it under the
23 # terms of the GNU General Public License as published by the Free Software
24 # Foundation; either version 2 of the License, or (at your option) any later
25 # version.
26 #
27 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
28 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
29 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
30 #
31 # You should have received a copy of the GNU General Public License along with
32 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
33 # Suite 330, Boston, MA  02111-1307 USA
34
35 use strict;
36 use CGI;
37 use C4::Auth;
38 # use C4::Catalogue;
39 use C4::Biblio;
40 use C4::Output;
41 use C4::Interface::CGI::Output;
42 use HTML::Template;
43 use C4::Koha;
44
45 my $query = new CGI;
46
47 my $error   = $query->param('error');
48 my $success = $query->param('biblioitem');
49 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
50     {
51         template_name   => "cataloguing/addbooks.tmpl",
52         query           => $query,
53         type            => "intranet",
54         authnotrequired => 0,
55         flagsrequired   => { editcatalogue => 1 },
56         debug           => 1,
57     }
58 );
59
60 # get framework list
61 my $frameworks = getframeworks;
62 my @frameworkcodeloop;
63 foreach my $thisframeworkcode (keys %$frameworks) {
64         my %row =(value => $thisframeworkcode,
65                                 frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'},
66                         );
67         push @frameworkcodeloop, \%row;
68 }
69
70 my $marc_p = C4::Context->boolean_preference("marc");
71 $template->param( NOTMARC => !$marc_p,
72                                 frameworkcodeloop => \@frameworkcodeloop );
73
74 output_html_with_http_headers $query, $cookie, $template->output;