5 # Copyright 2000-2002 Katipo Communications
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA 02111-1307 USA
29 my $biblionumber = $input->param('biblionumber');
30 my $error = $input->param('error');
44 my %itemtypedescriptions;
46 if (! $biblionumber) {
47 print $input->redirect('addbooks.pl');
50 ($bibliocount, @biblios) = &getbiblio($biblionumber);
53 print $input->redirect('addbooks.pl');
56 ($biblioitemcount, @biblioitems) = &getbiblioitembybiblionumber($biblionumber);
57 ($branchcount, @branches) = &branches;
58 ($itemtypecount, @itemtypes) = &getitemtypes;
60 for (my $i = 0; $i < $itemtypecount; $i++) {
61 $itemtypedescriptions{$itemtypes[$i]->{'itemtype'}} = $itemtypes[$i]->{'description'};
64 for (my $i = 0; $i < $branchcount; $i++) {
65 $branchnames{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'};
70 print startmenu('acquisitions');
73 <font size="6"><em>$biblios[0]->{'title'}</em></font>
77 if ($error eq "nobarcode") {
79 <font size="5" color="red">You must give the item a barcode</font>
82 } elsif ($error eq "nobiblioitem") {
84 <font size="5" color="red">You must create a new group for your item to be added to</font>
87 } elsif ($error eq "barcodeinuse") {
89 <font size="5" color="red">Sorry, that barcode is already in use</font>
94 <table align="left" cellpadding="5" cellspacing="0" border="1" width="220">
95 <tr valign="top" bgcolor="#CCCC99">
96 <td background="/images/background-mem.gif"><b>BIBLIO RECORD $biblionumber</b></td>
99 <td><b>Author:</b> $biblios[0]->{'author'}<br>
100 <b>Copyright:</b> $biblios[0]->{'copyrightdate'}<br>
101 <b>Series Title:</b> $biblios[0]->{'seriestitle'}<br>
102 <b>Notes:</b> $biblios[0]->{'notes'}</td>
106 for (my $i = 0; $i < $biblioitemcount; $i++) {
107 if ($biblioitems[$i]->{'itemtype'} eq "WEB") {
110 <tr valign="top" bgcolor="#CCCC99">
111 <td background="/images/background-mem.gif"><b>$biblioitems[$i]->{'biblioitemnumber'} GROUP - $itemtypedescriptions{$biblioitems[$i]->{'itemtype'}}</b></td>
114 <td><b>URL:</b> $biblioitems[$i]->{'url'}<br>
115 <b>Date:</b> $biblioitems[$i]->{'publicationyear'}<br>
116 <b>Notes:</b> $biblioitems[$i]->{'notes'}</td>
121 $biblioitems[$i]->{'dewey'} =~ /(\d*\.\d\d)/;
122 $biblioitems[$i]->{'dewey'} = $1;
125 <tr valign="top" bgcolor="#CCCC99">
126 <td background="/images/background-mem.gif"><b>$biblioitems[$i]->{'biblioitemnumber'} GROUP - $itemtypedescriptions{$biblioitems[$i]->{'itemtype'}}</b></td>
129 <td><b>ISBN:</b> $biblioitems[$i]->{'isbn'}<br>
130 <b>Dewey:</b> $biblioitems[$i]->{'dewey'}<br>
131 <b>Publisher:</b> $biblioitems[$i]->{'publishercode'}<br>
132 <b>Place:</b> $biblioitems[$i]->{'place'}<br>
133 <b>Date:</b> $biblioitems[$i]->{'publicationyear'}</td>
137 ($itemcount, @items) = &getitemsbybiblioitem($biblioitems[$i]->{'biblioitemnumber'});
139 for (my $j = 0; $j < $itemcount; $j++) {
141 <tr valign="top" bgcolor="#FFFFCC">
142 <td><b>Item:</b> $items[$j]->{'barcode'}<br>
143 <b>Home Branch:</b> $branchnames{$items[$j]->{'homebranch'}}<br>
144 <b>Notes:</b> $items[$j]->{'itemnotes'}</td>
153 <img src="/images/holder.gif" width="16" height="650" align="left">
157 <form action="saveitem.pl" method="post">
158 <input type="hidden" name="biblionumber" value="$biblionumber">
159 <table border="1" cellspacing="0" cellpadding="5">
160 <tr valign="top" bgcolor="#CCCC99">
161 <td background="/images/background-mem.gif" colspan="2"><b>ADD NEW ITEM:</b><br>
162 <small><i>For a website add the group only</i></small></td>
165 <td>Item Barcode:</td>
166 <td><input type="text" name="barcode" size="40"></td>
170 <td><select name="homebranch">
173 for (my $i = 0; $i < $branchcount; $i++) {
175 <option value="$branches[$i]->{'branchcode'}">$branches[$i]->{'branchname'}</option>
183 <td>Replacement Price:</td>
184 <td><input type="text" name="replacementprice" size="40"></td>
188 <td><textarea name="itemnotes" cols="30" rows="6"></textarea></td>
190 <tr valign="top" bgcolor="#CCCC99">
191 <td colspan="2" background="/images/background-mem.gif"><b>Add to existing group:</b></td>
195 <td><select name="biblioitemnumber">
198 for (my $i = 0; $i < $biblioitemcount; $i++) {
199 if ($biblioitems[$i]->{'itemtype'} ne "WEB") {
201 <option value="$biblioitems[$i]->{'biblioitemnumber'}">$itemtypedescriptions{$biblioitems[$i]->{'itemtype'}}</option>
210 <td colspan="2" align="center"><input type="submit" name="existinggroup" value="Add New Item to Existing Group"></td>
212 <tr valign="top" bgcolor="#CCCC99">
213 <td colspan="2" background="/images/background-mem.gif"><b>OR Add to a new Group:</b></td>
217 <td><select name="itemtype">
220 for (my $i = 0; $i < $itemtypecount; $i++) {
222 <option value="$itemtypes[$i]->{'itemtype'}">$itemtypes[$i]->{'description'}</option>
231 <td><input name="isbn" size="40"></td>
235 <td><input name="publishercode" size="40"></td>
238 <td>Publication Year:</td>
239 <td><input name="publicationyear" size="40"></td>
242 <td>Place of Publication:</td>
243 <td><input name="place" size="40"></td>
246 <td>Illustrator:</td>
247 <td><INPUT name="illus" size="40"></td>
250 <td>Additional Authors:<br><i>One Author per line</i></td>
251 <td><textarea name="additionalauthors" cols="30" rows="6"></textarea></td>
254 <td>Subject Headings:<br><i>One Subject per line</i></td>
255 <td><textarea name="subjectheadings" cols="30" rows="6"></textarea></td>
258 <td>Website URL:</td>
259 <td><INPUT name="url" size="40"></td>
263 <td><INPUT name="dewey" size="40"></td>
266 <td>Dewey Subclass:</td>
267 <td><input name="subclass" size="40"></td>
271 <td><input name="issn" size="40"></td>
275 <td><input name="lccn" size="40"</td>
279 <td><input name="volume" size="40"></td>
283 <td><input name="number" size="40"></td>
286 <td>Volume Description:</td>
287 <td><input name="volumeddesc" size="40"></td>
291 <td><input name="pages" size="40"></td>
295 <td><input name="size" size="40"></td>
299 <td><textarea name="notes" cols="30" rows="6"></textarea></td>
302 <td colspan="2" align="center"><input type="submit" name="newgroup" value="Add New Item to New Group"></td>
310 print endmenu('acquisitions');