6 # Add info on biblioitems and items already entered as you enter new ones
20 my $isbn=$input->param('isbn');
21 my $q_isbn=$dbh->quote($isbn);
26 print startmenu
('acquisitions');
28 ($input->param('checkforbiblio')) && (checkforbiblio
());
29 ($input->param('newbiblioitem')) && (newbiblioitem
());
30 ($input->param('newitem')) && (newitem
());
33 my $title=$input->param('title');
34 my $q_title=$dbh->quote($title);
35 my $author=$input->param('author');
36 my $q_author=$dbh->quote($author);
37 my $seriestitle=$input->param('seriestitle');
39 ($seriestitle) && ($serial=1);
40 my $q_seriestitle=$dbh->quote($seriestitle);
41 my $copyrightdate=$input->param('copyrightdate');
42 my $q_copyrightdate=$dbh->quote($copyrightdate);
43 my $notes=$input->param('notes');
44 my $q_notes=$dbh->quote($notes);
45 my $subtitle=$input->param('subtitle');
46 my $q_subtitle=$dbh->quote($subtitle);
47 my $sth=$dbh->prepare("select biblionumber from biblio where title=$q_title
48 and author=$q_author and copyrightdate=$q_copyrightdate");
52 ($biblionumber) = $sth->fetchrow;
54 print "Adding new biblio for <i>$title</i> by $author<br>\n";
55 my $sth=$dbh->prepare("select max(biblionumber) from biblio");
57 ($biblionumber) = $sth->fetchrow;
59 $sth=$dbh->prepare("insert into biblio (biblionumber, title, author,
60 serial, seriestitle, copyrightdate, notes) values ($biblionumber,
61 $q_title, $q_author, $serial, $q_seriestitle, $q_copyrightdate,
64 $sth=$dbh->prepare("insert into bibliosubtitle (subtitle, biblionumber)
65 values ($q_subtitle, $biblionumber)");
68 my $itemtypeselect='';
69 $sth=$dbh->prepare("select itemtype,description from itemtypes");
71 while (my ($itemtype, $description) = $sth->fetchrow) {
72 $itemtypeselect.="<option value=$itemtype>$itemtype - $description\n";
74 my $authortext="by $author";
75 ($author) || ($authortext='');
77 $sth=$dbh->prepare("select BI.isbn,IT.description,BI.volume,BI.number,BI.volumeddesc,BI.dewey,BI.subclass from biblioitems BI, itemtypes IT where BI.itemtype=IT.itemtype and biblionumber=$biblionumber");
79 my $biblioitemdata='';
80 while (my ($isbn, $itemtype, $volume, $number, $volumeddesc, $dewey, $subclass) = $sth->fetchrow) {
84 $volumeinfo="V$volume, N$number";
86 $volumeinfo="Vol $volume";
90 $volumeinfo.=" $volumeddesc";
93 $biblioitemdata.="<tr><td>$isbn</td><td align=center>$itemtype</td><td align=center>$volumeinfo</td><td align=center>$dewey$subclass</td></tr>\n";
96 if ($biblioitemdata) {
100 <table border
=1 bgcolor
=#dddddd>
102 <th colspan
=4>Existing entries using Biblio number
$biblionumber</th
>
105 <th
>ISBN
</th><th>Item Type</th
><th
>Volume
</th><th>Classification</th
></tr
>
115 <table border
=1 bgcolor
=#dddddd>
116 <tr
><th colspan
=4>Section Two
: Publication Information
for<br
><i
>$title</i
>
117 $authortext</th></tr
>
119 <tr
><td align
=right
>Publisher
</td><td colspan=3><input name=publishercode size=30></td
></tr
>
120 <tr
><td align
=right
>Publication Year
</td><td><input name=publicationyear size=10></td
>
121 <td align
=right
>Place of Publication
</td><td><input name=place size=20></td
></tr
>
122 <tr
><td align
=right
>Illustrator
</td><td colspan=3><input name=illus size=20></td
></tr
>
123 <tr
><td align
=right
>Additional Authors
<br
>(One author per line
)</td
><td colspan
=3><textarea
124 name
=additionalauthors rows
=4 cols
=30></textarea></td
></tr
>
125 <tr
><td align
=right
>Subject Headings
<br
>(One subject per line
)</td
><td colspan
=3><textarea
126 name
=subjectheadings rows
=4 cols
=30></textarea></td
></tr
>
127 <tr
><td align
=right
>Item Type
</td><td colspan=3><select name=itemtype>$itemtypeselect</select
></td></tr
>
128 <tr
><td align
=right
>Dewey
</td><td><input name=dewey size=10></td
>
129 <td align
=right
>Dewey Subclass
</td><td><input name=subclass size=10></td
></tr
>
130 <tr
><td align
=right
>ISSN
</td><td colspan=3><input name=issn size=10></td
></tr
>
131 <tr
><td align
=right
>LCCN
</td><td colspan=3><input name=lccn size=10></td
></tr
>
132 <tr
><td align
=right
>Volume
</td><td><input name=volume size=10></td
>
133 <td align
=right
>Number
</td><td><input name=number size=10></td
></tr
>
134 <tr
><td align
=right
>Volume Description
</td><td colspan=3><input name=volumeddesc size=40></td
></tr
>
135 <tr
><td align
=right
>Pages
</td><td><input name=pages size=10></td
>
136 <td align
=right
>Size
</td><td><input name=size size=10></td
></tr
>
138 <tr
><td align
=right
>Notes
</td
><td colspan
=3><textarea name
=notes rows
=4 cols
=50
139 wrap
=physical
></textarea></td
></tr
>
144 <input type
=submit value
="Add New Bibliography Item">
146 <input type
=hidden name
=biblionumber value
=$biblionumber>
147 <input type
=hidden name
=isbn value
=$isbn>
148 <input type
=hidden name
=newbiblioitem value
=1>
158 my $biblionumber=$input->param('biblionumber');
159 my $volume=$input->param('volume');
160 my $q_volume=$dbh->quote($volume);
161 my $number=$input->param('number');
162 my $q_number=$dbh->quote($number);
163 my $classification=$input->param('classification');
164 my $q_classification=$dbh->quote($classification);
165 my $itemtype=$input->param('itemtype');
166 my $q_itemtype=$dbh->quote($itemtype);
167 my $issn=$input->param('issn');
168 my $q_issn=$dbh->quote($issn);
169 my $lccn=$input->param('lccn');
170 my $q_lccn=$dbh->quote($lccn);
171 my $dewey=$input->param('dewey');
172 my $q_dewey=$dbh->quote($dewey);
173 my $subclass=$input->param('subclass');
174 my $q_subclass=$dbh->quote($subclass);
175 my $publicationyear=$input->param('publicationyear');
176 my $q_publicationyear=$dbh->quote($publicationyear);
177 my $publishercode=$input->param('publishercode');
178 my $q_publishercode=$dbh->quote($publishercode);
179 my $volumedate=$input->param('volumedate');
180 my $q_volumedate=$dbh->quote($volumedate);
181 my $volumeddesc=$input->param('volumeddesc');
182 my $q_volumeddesc=$dbh->quote($volumeddesc);
183 my $illus=$input->param('illus');
184 my $q_illus=$dbh->quote($illus);
185 my $pages=$input->param('pages');
186 my $q_pages=$dbh->quote($pages);
187 my $notes=$input->param('notes');
188 my $q_notes=$dbh->quote($notes);
189 my $size=$input->param('size');
190 my $q_size=$dbh->quote($size);
191 my $place=$input->param('place');
192 my $q_place=$dbh->quote($place);
193 my $subjectheadings=$input->param('subjectheadings');
194 my $additionalauthors=$input->param('additionalauthors');
195 my $sth=$dbh->prepare("select max(biblioitemnumber) from biblioitems");
197 ($biblioitemnumber) = $sth->fetchrow;
199 ($q_isbn='') if ($q_isbn eq 'NULL');
200 $sth=$dbh->prepare("insert into biblioitems (biblioitemnumber,
201 biblionumber, volume, number, classification, itemtype, isbn, issn, lccn, dewey, subclass,
202 publicationyear, publishercode, volumedate, volumeddesc, illus, pages,
203 notes, size, place) values ($biblioitemnumber, $biblionumber, $q_volume,
204 $q_number, $q_classification, $q_itemtype, $q_isbn, $q_issn, $q_lccn, $q_dewey, $q_subclass,
205 $q_publicationyear, $q_publishercode, $q_volumedate, $q_volumeddesc,
206 $q_illus, $q_pages, $q_notes, $q_size, $q_place)");
208 my @subjectheadings=split(/\n/,$subjectheadings);
210 foreach $subjectheading (@subjectheadings) {
211 # remove any line ending characters (Ctrl-J or M)
212 $subjectheading=~s/\013//g;
213 $subjectheading=~s/\010//g;
214 # convert to upper case
215 $subjectheading=uc($subjectheading);
216 print STDERR
"S: $biblionumber, $subjectheading ";
217 chomp ($subjectheading);
218 print STDERR
"B: ".ord(substr($subjectheading, length($subjectheading)-1, 1))." ";
219 while (ord(substr($subjectheading, length($subjectheading)-1, 1))<14) {
220 chop $subjectheading;
222 print STDERR
"A: ".ord(substr($subjectheading, length($subjectheading)-1, 1))."\n";
224 my $q_subjectheading=$dbh->quote($subjectheading);
225 $sth=$dbh->prepare("insert into bibliosubject (biblionumber,subject)
226 values ($biblionumber, $q_subjectheading)");
229 my @additionalauthors=split(/\n/,$additionalauthors);
230 my $additionalauthor;
231 foreach $additionalauthor (@additionalauthors) {
232 # remove any line ending characters (Ctrl-L or Ctrl-M)
233 $additionalauthor=~s/\013//g;
234 $additionalauthor=~s/\010//g;
235 # convert to upper case
236 $additionalauthor=uc($additionalauthor);
238 my $q_additionalauthor=$dbh->quote($additionalauthor);
239 $sth=$dbh->prepare("insert into additionalauthors (biblionumber,author)
240 values ($biblionumber, $q_additionalauthor)");
246 my $biblionumber=$input->param('biblionumber');
247 my $biblioitemnumber=$input->param('biblioitemnumber');
248 my $barcode=$input->param('barcode');
249 my $itemnotes=$input->param('notes');
250 my $q_itemnotes=$dbh->quote($itemnotes);
251 my $replacementprice=$input->param('replacementprice');
252 ($replacementprice) || ($replacementprice=0);
253 my $sth=$dbh->prepare("select max(itemnumber) from items");
255 my ($itemnumber) = $sth->fetchrow;
257 my @datearr=localtime(time);
258 my $date=(1900+$datearr[5])."-".($datearr[4]+1)."-".$datearr[3];
259 my $q_homebranch=$dbh->quote($input->param('homebranch'));
260 $sth=$dbh->prepare("insert into items (itemnumber, biblionumber,
261 biblioitemnumber,barcode, itemnotes, holdingbranch, homebranch, dateaccessioned, replacementprice) values ($itemnumber,
262 $biblionumber, $biblioitemnumber, $barcode, $q_itemnotes, 'STWE', $q_homebranch, '$date', $replacementprice)");
268 if ($isbn eq 'NULL') {
269 $sth=$dbh->prepare("select biblionumber,biblioitemnumber from
270 biblioitems where biblioitemnumber=$biblioitemnumber");
272 $sth=$dbh->prepare("select biblionumber,biblioitemnumber from
273 biblioitems where isbn=$q_isbn");
276 if (my ($biblionumber, $biblioitemnumber) = $sth->fetchrow) {
278 $sth=$dbh->prepare("select I.barcode,I.itemnotes,B.title,B.author from items I, biblio B where B.biblionumber=I.biblionumber and biblioitemnumber=$biblioitemnumber");
281 while (my ($barcode, $itemnotes, $title, $author) = $sth->fetchrow) {
282 $itemdata.="<tr><td align=center>$barcode</td><td><u>$title</u></td><td>$author</td><td>$itemnotes</td></tr>\n";
289 <table border
=1 bgcolor
=#dddddd>
291 <th colspan
=4>Existing Items with ISBN
$isbn</th
>
294 <th
>Barcode
</th><th>Title</th
><th
>Author
</th><th>Notes</th
></tr
>
301 my $sth=$dbh->prepare("select max(barcode) from items");
303 my ($maxbarcode) = $sth->fetchrow;
307 <h2
>Section Three
: Specific Item Information
</h2
>
309 <input type
=hidden name
=newitem value
=1>
310 <input type
=hidden name
=biblionumber value
=$biblionumber>
311 <input type
=hidden name
=biblioitemnumber value
=$biblioitemnumber>
313 <tr
><td
>BARCODE
</td><td><input name=barcode size=10 value=$maxbarcode> Home Branch: <select name=homebranch><option value='STWE'>Stewart Elementary<option value='MEZ'>Meziadin Elementary</select
></td></tr
>
314 </tr><td colspan=2>Replacement Price: <input name=replacementprice size=10></td
></tr
>
315 <tr
><td
>Notes
</td
><td
><textarea name
=notes rows
=4 cols
=40
316 wrap
=physical
></textarea></td
></tr
>
318 <input type
=submit value
="Add Item">
320 <h3
>ISBN
$isbn Information
</h3
>
329 <input type
=hidden name
=isbn value
='$isbn'>
330 <input type
=hidden name
=checkforbiblio value
=1>
332 <tr
><th colspan
=2>Section One
: Copyright Information
</th></tr
>
333 <tr
><td
>Title
</td><td><input name=title size=40></td
></tr
>
334 <tr
><td
>Subtitle
</td><td><input name=subtitle size=40></td
></tr
>
335 <tr
><td
>Author
</td><td><input name=author size=40></td
></tr
>
336 <tr
><td
>Series Title
<br
>(if applicable
)</td
><td
><input name
=seriestitle
338 <tr
><td
>Copyright Date
</td><td><input name=copyrightdate size=10></td
></tr
>
339 <tr
><td
>Notes
</td
><td
><textarea name
=notes rows
=4 cols
=40
340 wrap
=physical
></textarea></td
></tr
>
342 <input type
=submit value
="Add new Bibliography">
348 <h2
>Adding new items to the Library Inventory
</h2
>
349 To add a new item
, scan
or type the ISBN number
:
352 ISBN
: <input name
=isbn
>
355 <a href
=addbooks
.pl?isbn
=NULL
>Enter book with
no ISBN
</a
>
357 Or
use the
<a href
=marcimport
.pl
>MARC Importing tool
</a
>
370 <table border
=1 width
=70% bgcolor
=#bbddbb>
374 Koha stores data
in three sections
.
377 <li
>The first section records bibliographic data such as title
, author
and
378 copyright
for a particular work
.
379 <li
>The second records bibliographic data
for a particular publication of that
380 work
, such as ISBN number
, physical description
, publisher information
, etc
.
381 <li
>The third section holds specific item information
, such as the bar code