5 #script to modify/delete groups
8 # modified 11/11/99 by chris@katipo.co.nz
9 # modified 18/4/00 by chris@katipo.co.nz
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
40 use C4::Interface::CGI::Output;
43 my $bibitemnum=$input->param('bibitem');
44 my $data=bibitemdata($bibitemnum);
45 my $biblio=$input->param('biblio');
46 my $submit=$input->param('submit');
48 print $input->redirect("deletebiblioitem.pl?biblioitemnumber=$bibitemnum&biblionumber=$biblio");
51 my ($template, $loggedinuser, $cookie) = get_template_and_user({
52 template_name => 'modbibitem.tmpl',
56 flagsrequired => {catalogue => 1},
62 #hash is set up with input name being the key then
63 #the value is a tab separated list, the first item being the input type
64 #$inputs{'Author'}="text\t$data->{'author'}\t0";
65 #$inputs{'Title'}="text\t$data->{'title'}\t1";
66 my $dewey = $data->{'dewey'};
68 if ($dewey eq "000.") { $dewey = "";};
69 if ($dewey < 10){$dewey='00'.$dewey;}
70 if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
75 $inputs{'Class'}="text\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
76 $inputs{'Item Type'}="text\t$data->{'itemtype'}\t3";
77 $inputs{'URL'}="text\t$data->{'url'}\t4";
78 $inputs{'Publisher'}="text\t$data->{'publishercode'}\t5";
79 #$inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6";
80 $inputs{'ISBN'}="text\t$data->{'isbn'}\t7";
81 $inputs{'Publication Year'}="text\t$data->{'publicationyear'}\t8";
82 $inputs{'Pages'}="text\t$data->{'pages'}\t9";
83 $inputs{'Illustrations'}="text\t$data->{'illustration'}\t10";
84 #$inputs{'Series Title'}="text\t$data->{'seriestitle'}\t11";
85 #$inputs{'Additional Author'}="text\t$additional\t12";
86 #$inputs{'Subtitle'}="text\t$subtitle->[0]->{'subtitle'}\t13";
87 #$inputs{'Unititle'}="text\t$data->{'unititle'}\t14";
88 #$inputs{'Notes'}="textarea\t$data->{'notes'}\t15";
89 #$inputs{'Serial'}="text\t$data->{'serial'}\t16";
90 $inputs{'Volume'}="text\t$data->{'volumeddesc'}\t17";
91 #$inputs{'Analytic author'}="text\t\t18";
92 #$inputs{'Analytic title'}="text\t\t19";
94 $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
95 $inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
97 $template->param( biblionumber => $data->{'biblionumber'},
98 title => $data->{'title'},
99 author => $data->{'author'},
100 description => $data->{'description'},
101 loggedinuser => $loggedinuser,
104 my ($count,@bibitems)=bibitems($data->{'biblionumber'});
108 for (my $i=0;$i<$count;$i++){
110 $line{biblioitemnumber} = $bibitems[$i]->{'biblioitemnumber'};
111 $line{description} = $bibitems[$i]->{'description'};
112 $line{isbn} = $bibitems[$i]->{'isbn'};
113 push(@bibitemloop,\%line);
115 $template->param(bibitemloop =>\@bibitemloop);
118 #my $notesinput=$input->textfield(-name=>'Notes', -default=>$data->{'bnotes'}, -size=>20);
119 $template->param(bnotes=>$data->{'bnotes'});
121 $template->param(itemtype => $data->{'itemtype'});
123 $template->param(url => $data->{'url'});
124 $template->param(classification => $data->{'classification'},
126 subclass => $data->{'subclass'},
127 publishercode => $data->{'publishercode'},
128 place => $data->{'place'},
129 isbn => $data->{'isbn'},
130 publicationyear => $data->{'publicationyear'},
131 pages => $data->{'pages'},
132 illustration => $data->{'illustration'},
133 volumeddesc => $data->{'volumeddesc'},
134 size => $data->{'size'},
135 biblionumber => $data->{'biblionumber'},
136 biblioitemnumber => $data->{'biblioitemnumber'});
138 my (@items)=itemissues($data->{'biblioitemnumber'});
142 for (my $i=0;$i<$count;$i++){
144 $items[$i]->{'datelastseen'} = format_date($items[$i]->{'datelastseen'});
145 $line{barcode}=$items[$i]->{'barcode'};
146 $line{itemnumber}=$items[$i]->{'itemnumber'};
147 $line{biblionumber}=$data->{'biblionumber'};
148 $line{biblioitemnumber}=$data->{'biblioitemnumber'};
149 $line{holdingbranch}=$items[$i]->{'holdingbranch'};
150 $line{datelastseen}=$items[$i]->{'datelastseen'};
151 push(@itemloop,\%line);
153 $template->param(itemloop => \@itemloop);
154 print "Content-Type: text/html\n\n", $template->output;