6 #script to modify/delete biblios
8 # modified 11/11/99 by chris@katipo.co.nz
9 # modified 12/16/02 by hdl@ifrance.com : Templating
11 # Copyright 2000-2002 Katipo Communications
13 # This file is part of Koha.
15 # Koha is free software; you can redistribute it and/or modify it under the
16 # terms of the GNU General Public License as published by the Free Software
17 # Foundation; either version 2 of the License, or (at your option) any later
20 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
21 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
22 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
24 # You should have received a copy of the GNU General Public License along with
25 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
26 # Suite 330, Boston, MA 02111-1307 USA
34 #use C4::Acquisitions;
40 use C4::Interface::CGI::Output;
43 my $submit=$input->param('delete.x');
44 my $itemnum=$input->param('item');
45 my $bibitemnum=$input->param('bibitem');
47 print $input->redirect("/cgi-bin/koha/delitem.pl?itemnum=$itemnum&bibitemnum=$bibitemnum");
50 my $data=bibitemdata($bibitemnum);
52 my $item=itemnodata('blah','',$itemnum);
53 #my ($analytictitle)=analytic($biblionumber,'t');
54 #my ($analyticauthor)=analytic($biblionumber,'a');
57 my ($template, $loggedinuser, $cookie) = get_template_and_user({
58 template_name => 'moditem.tmpl',
62 flagsrequired => {catalogue => 1},
69 #hash is set up with input name being the key then
70 #the value is a tab separated list, the first item being the input type
71 #$inputs{'Author'}="text\t$data->{'author'}\t0";
72 #$inputs{'Title'}="text\t$data->{'title'}\t1";
73 # FIXME - The Dewey code is a string, not a number. And "000" is a
74 # perfectly acceptable value.
75 my $dewey = $data->{'dewey'};
77 if ($dewey eq "000.") { $dewey = "";};
78 if ($dewey < 10){$dewey='00'.$dewey;}
79 if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
85 # 12/16/2002 hdl@ifrance.com : all these inputs seem unused !!!
87 $inputs{'Barcode'}="text\t$item->{'barcode'}\t0";
88 $inputs{'Class'}="hidden\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
89 #$inputs{'Item Type'}="text\t$data->{'itemtype'}\t3";
90 #$inputs{'Subject'}="textarea\t$sub\t4";
91 $inputs{'Publisher'}="hidden\t$data->{'publishercode'}\t5";
92 #$inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6";
93 $inputs{'ISBN'}="hidden\t$data->{'isbn'}\t7";
94 $inputs{'Publication Year'}="hidden\t$data->{'publicationyear'}\t8";
95 $inputs{'Pages'}="hidden\t$data->{'pages'}\t9";
96 $inputs{'Illustrations'}="hidden\t$data->{'illustration'}\t10";
97 #$inputs{'Series Title'}="text\t$data->{'seriestitle'}\t11";
98 #$inputs{'Additional Author'}="text\t$additional\t12";
99 #$inputs{'Subtitle'}="text\t$subtitle->[0]->{'subtitle'}\t13";
100 #$inputs{'Unititle'}="text\t$data->{'unititle'}\t14";
101 $inputs{'ItemNotes'}="textarea\t$item->{'itemnotes'}\t15";
102 #$inputs{'Serial'}="text\t$data->{'serial'}\t16";
103 $inputs{'Volume'}="hidden\t$data->{'volumeddesc'}\t17";
104 $inputs{'Home Branch'}="text\t$item->{'homebranch'}\t18";
105 $inputs{'Lost'}="radio\t$item->{'itemlost'}\t19";
106 #$inputs{'Analytic author'}="text\t\t18";
107 #$inputs{'Analytic title'}="text\t\t19";
108 $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
109 $inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
110 $inputs{'itemnumber'}="hidden\t$itemnum\t22";
112 #12/16/2002 hdl@ifrance.com : end of comment
116 #12/16/2002 hdl@ifrance.com : templating
117 $template->param( title => $data->{'title'},
118 author => $data->{'author'},
119 barcode => $item->{'barcode'},
120 classification => "$data->{'classification'}$dewey$data->{'subclass'}",
121 publisher => $data->{'publisher'},
122 publicationyear => $data->{'publicationyear'},
123 pages => $data->{'pages'},
124 illustration => $data->{'illustration'},
125 itemnotes => $item->{'itemnotes'},
126 volumedesc => $data->{'volumedesc'},
127 homebranch => $data->{'homebranch'},
128 itemlost => ($item->{'itemlost'} ==1),
129 itemwithdrawn => ($item->{'wthdrawn'} ==1),
130 biblionumber => $data->{'biblionumber'},
131 biblioitemnumber => $data->{'biblioitemnumber'},
132 itemnumber => $itemnum);
134 print "Content-Type: text/html\n\n", $template->output;
135 #12/16/2002 hdl@ifrance.com : templating