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
39 use C4::Interface::CGI::Output;
42 my $bibitemnum=$input->param('bibitem');
43 my $data=bibitemdata($bibitemnum);
44 my $biblio=$input->param('biblio');
45 my $submit=$input->param('submit');
47 print $input->redirect("deletebiblioitem.pl?biblioitemnumber=$bibitemnum&biblionumber=$biblio");
50 my ($template, $loggedinuser, $cookie) = get_template_and_user({
51 template_name => 'modbibitem.tmpl',
55 flagsrequired => {catalogue => 1},
61 #hash is set up with input name being the key then
62 #the value is a tab separated list, the first item being the input type
63 #$inputs{'Author'}="text\t$data->{'author'}\t0";
64 #$inputs{'Title'}="text\t$data->{'title'}\t1";
65 my $dewey = $data->{'dewey'};
67 if ($dewey eq "000.") { $dewey = "";};
68 if ($dewey < 10){$dewey='00'.$dewey;}
69 if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
74 $inputs{'Class'}="text\t$data->{'classification'}$dewey$data->{'subclass'}\t2";
75 $inputs{'Item Type'}="text\t$data->{'itemtype'}\t3";
76 $inputs{'URL'}="text\t$data->{'url'}\t4";
77 $inputs{'Publisher'}="text\t$data->{'publishercode'}\t5";
78 #$inputs{'Copyright date'}="text\t$data->{'copyrightdate'}\t6";
79 $inputs{'ISBN'}="text\t$data->{'isbn'}\t7";
80 $inputs{'Publication Year'}="text\t$data->{'publicationyear'}\t8";
81 $inputs{'Pages'}="text\t$data->{'pages'}\t9";
82 $inputs{'Illustrations'}="text\t$data->{'illustration'}\t10";
83 #$inputs{'Series Title'}="text\t$data->{'seriestitle'}\t11";
84 #$inputs{'Additional Author'}="text\t$additional\t12";
85 #$inputs{'Subtitle'}="text\t$subtitle->[0]->{'subtitle'}\t13";
86 #$inputs{'Unititle'}="text\t$data->{'unititle'}\t14";
87 #$inputs{'Notes'}="textarea\t$data->{'notes'}\t15";
88 #$inputs{'Serial'}="text\t$data->{'serial'}\t16";
89 $inputs{'Volume'}="text\t$data->{'volumeddesc'}\t17";
90 #$inputs{'Analytic author'}="text\t\t18";
91 #$inputs{'Analytic title'}="text\t\t19";
93 $inputs{'bibnum'}="hidden\t$data->{'biblionumber'}\t20";
94 $inputs{'bibitemnum'}="hidden\t$data->{'biblioitemnumber'}\t21";
96 $template->param( biblionumber => $data->{'biblionumber'},
97 title => $data->{'title'},
98 author => $data->{'author'},
99 description => $data->{'description'},
100 loggedinuser => $loggedinuser,
103 my ($count,@bibitems)=bibitems($data->{'biblionumber'});
107 for (my $i=0;$i<$count;$i++){
109 $line{biblioitemnumber} = $bibitems[$i]->{'biblioitemnumber'};
110 $line{description} = $bibitems[$i]->{'description'};
111 $line{isbn} = $bibitems[$i]->{'isbn'};
112 push(@bibitemloop,\%line);
114 $template->param(bibitemloop =>\@bibitemloop);
117 #my $notesinput=$input->textfield(-name=>'Notes', -default=>$data->{'bnotes'}, -size=>20);
118 $template->param(bnotes=>$data->{'bnotes'});
120 $template->param(itemtype => $data->{'itemtype'});
122 $template->param(url => $data->{'url'});
123 $template->param(classification => $data->{'classification'},
125 subclass => $data->{'subclass'},
126 publishercode => $data->{'publishercode'},
127 place => $data->{'place'},
128 isbn => $data->{'isbn'},
129 publicationyear => $data->{'publicationyear'},
130 pages => $data->{'pages'},
131 illustration => $data->{'illustration'},
132 volumeddesc => $data->{'volumeddesc'},
133 size => $data->{'size'},
134 biblionumber => $data->{'biblionumber'},
135 biblioitemnumber => $data->{'biblioitemnumber'});
137 my (@items)=itemissues($data->{'biblioitemnumber'});
141 for (my $i=0;$i<$count;$i++){
143 $items[$i]->{'datelastseen'} = format_date($items[$i]->{'datelastseen'});
144 $line{barcode}=$items[$i]->{'barcode'};
145 $line{itemnumber}=$items[$i]->{'itemnumber'};
146 $line{biblionumber}=$data->{'biblionumber'};
147 $line{biblioitemnumber}=$data->{'biblioitemnumber'};
148 $line{holdingbranch}=$items[$i]->{'holdingbranch'};
149 $line{datelastseen}=$items[$i]->{'datelastseen'};
150 push(@itemloop,\%line);
152 $template->param(itemloop => \@itemloop);
153 print "Content-Type: text/html\n\n", $template->output;