Changes to allow modifications to the website biblioitems
[koha.git] / moredetail.pl
1 #!/usr/bin/perl
2
3 #script to display detailed information
4 #written 8/11/99
5
6 use strict;
7 use C4::Search;
8 use C4::Koha;
9 use C4::Output;
10 use C4::Acquisitions;
11 use CGI;
12
13 my $input = new CGI;
14 my $type=$input->param('type');
15
16 print $input->header;
17
18 # setup colours
19 my $main;
20 my $secondary;
21 if ($type eq 'opac'){
22   $main='#99cccc';
23   $secondary='#efe5ef';
24 } else {
25   $main='#cccc99';
26   $secondary='#ffffcc';
27 }
28 print startpage();
29 print startmenu($type);
30 my $blah;
31
32 my $bib=$input->param('bib');
33 my $title=$input->param('title');
34 my $bi=$input->param('bi');
35 my $data=bibitemdata($bi);
36
37 my (@items)=itemissues($bi);
38 my ($order,$ordernum)=getorder($bi,$bib);
39 #print @items;
40 my $count=@items;
41
42 my $i=0;
43 print center();
44
45 my $dewey = $data->{'dewey'};                                                  
46 $dewey =~ s/0+$//;                                                             
47 if ($dewey eq "000.") { $dewey = "";};                                         
48 if ($dewey < 10){$dewey='00'.$dewey;}                                          
49 if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}                           
50 if ($dewey <= 0){
51   $dewey='';                                                                   
52 }               
53 $dewey=~ s/\.$//;
54 print <<printend
55 <br>
56 <a href=/cgi-bin/koha/request.pl?bib=$bib><img src=/images/requests.gif width=120 height=42 border=0 align=right border=0></a>
57 printend
58 ;
59 if ($type eq 'catmain'){
60   print "<FONT SIZE=6><em>Catalogue Maintenance</em></FONT><br>";
61 }
62 print <<printend
63 <FONT SIZE=6><em><a href=/cgi-bin/koha/detail.pl?bib=$bib&type=intra>$data->{'title'} ($data->{'author'})</a></em></FONT><P>
64 <p>
65 <form action=/cgi-bin/koha/modbibitem.pl>
66 <input type=hidden name=bibitem value=$bi>
67 <input type=hidden name=biblio value=$bib>
68 <!-------------------BIBLIO ITEM------------>
69 <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left>
70 <TR VALIGN=TOP>
71 <td  bgcolor="99cc33" background="/images/background-mem.gif" ><B>$data->{'biblioitemnumber'} GROUP - $data->{'description'} </b> </TD>
72 </TR>
73 <tr VALIGN=TOP  >
74 <TD width=210 >
75 <INPUT TYPE="image" name="submit"  VALUE="modify" height=42  WIDTH=93 BORDER=0 src="/images/modify-mem.gif"> 
76 <INPUT TYPE="image" name="delete"  VALUE="delete" height=42  WIDTH=93 BORDER=0 src="/images/delete-mem.gif"> 
77 <br>
78 <FONT SIZE=2  face="arial, helvetica">
79 <b>Biblionumber:</b> $bib<br>
80 <b>Item Type:</b> $data->{'itemtype'}<br>
81 <b>URL:</b> $data->{'url'}<br>
82 <b>Loan Length:</b> $data->{'loanlength'}<br>
83 <b>Rental Charge:</b> $data->{'rentalcharge'}<br>
84 <b>Classification:</b> $data->{'classification'}$dewey$data->{'subclass'}<br>
85 <b>ISBN:</b> $data->{'isbn'}<br>
86 <b>Publisher:</b> $data->{'publishercode'} <br>
87 <b>Place:</b> $data->{'place'}<br>
88 <b>Date:</b> $data->{'publicationyear'}<br>
89 <b>Volume:</b> $data->{'volumeddesc'}<br>
90 <b>Pages:</b> $data->{'pages'}<br>
91 <b>Illus:</b> $data->{'illus'}<br>
92 <b>Size:</b> $data->{'size'}<br>
93 <b>Notes:</b> $data->{'bnotes'}<br>
94 <b>No. of Items:</b> $count
95
96 printend
97 ;
98 if ($type eq 'catmain'){
99   print "<br><a href=/cgi-bin/koha/maint/shiftbib.pl?bi=$data->{'biblioitemnumber'}&bib=$data->{'biblionumber'}>Shift to another biblio</a>";
100  
101 }
102 print <<printend
103
104 </font>
105 </TD>
106 </tr>
107 </table>
108 </form>
109 printend
110 ;
111
112 for (my $i=0;$i<$count;$i++){
113 print <<printend
114 <img src="/images/holder.gif" width=16 height=300 align=left>
115 <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width=220 >                            
116 <TR VALIGN=TOP>
117 <td  bgcolor="99cc33" background="/images/background-mem.gif"><B>BARCODE $items[$i]->{'barcode'}</b></TD>
118 </TR>
119 <tr VALIGN=TOP  >
120 <TD width=220 >
121 <form action=/cgi-bin/koha/moditem.pl method=post>
122 <input type=hidden name=bibitem value=$bi>
123 <input type=hidden name=item value=$items[$i]->{'itemnumber'}>
124 <input type=hidden name=type value=$type>
125 <INPUT TYPE="image" name="submit"  VALUE="modify" height=42  WIDTH=93 BORDER=0 src="/images/modify-mem.gif"> 
126 <INPUT TYPE="image" name="delete"  VALUE="delete" height=42  WIDTH=93 BORDER=0 src="/images/delete-mem.gif"> 
127 <br>
128 printend
129 ;
130 $items[$i]->{'itemlost'}=~ s/0/No/;
131 $items[$i]->{'itemlost'}=~ s/1/Yes/;
132 $items[$i]->{'withdrawn'}=~ s/0/No/;
133 $items[$i]->{'withdrawn'}=~ s/1/Yes/;
134 $items[$i]->{'replacementprice'}+=0.00;
135
136 my $year=substr($items[$i]->{'timestamp0'},0,4);
137 my $mon=substr($items[$i]->{'timestamp0'},4,2);
138 my $day=substr($items[$i]->{'timestamp0'},6,2);
139 $items[$i]->{'timestamp0'}="$day/$mon/$year";
140
141 $items[$i]->{'dateaccessioned'} = slashifyDate($items[$i]->{'dateaccessioned'});
142 $items[$i]->{'datelastseen'} = slashifyDate($items[$i]->{'datelastseen'});
143
144 print <<printend
145 <FONT SIZE=2  face="arial, helvetica">
146 <b>Home Branch:</b> $items[$i]->{'homebranch'}<br>
147 <b>Last seen:</b> $items[$i]->{'datelastseen'}<br>
148 <b>Last borrowed:</b> $items[$i]->{'timestamp0'}<br>
149 printend
150 ;
151 if ($items[$i] eq 'Available'){
152   print "<b>Currently on issue to:</b><br>";
153 } else {
154   print "<b>Currently on issue to:</b> <a href=/cgi-bin/koha/moremember.pl?bornum=$items[$i]->{'borrower0'}>$items[$i]->{'card'}</a><br>";
155 }
156 print <<printend
157 <b>Last Borrower 1:</b> $items[$i]->{'card0'}<br>
158 <b>Last Borrower 2:</b> $items[$i]->{'card1'}<br>
159 <b>Current Branch:</b> $items[$i]->{'holdingbranch'}<br>
160 <b>Replacement Price:</b> $items[$i]->{'replacementprice'}<br>
161 <b>Item lost:</b> $items[$i]->{'itemlost'}<br>
162 <b>Paid for:</b> $items[$i]->{'paidfor'}<br>
163 <b>Notes:</b> $items[$i]->{'itemnotes'}<br>
164 <b>Renewals:</b> $items[$i]->{'renewals'}<br>
165 <b><a href=/cgi-bin/koha/acqui/acquire.pl?recieve=$ordernum&biblio=$bib&invoice=$order->{'booksellerinvoicenumber'}&catview=yes>Accession</a> Date: $items[$i]->{'dateaccessioned'}<br>
166 printend
167 ;
168 if ($items[$i]->{'wthdrawn'} eq '1'){
169   $items[$i]->{'wthdrawn'}="Yes";
170 } else {
171   $items[$i]->{'wthdrawn'}="No";
172 }
173 print <<printend
174 <b>Cancelled: $items[$i]->{'wthdrawn'}<br>
175 <b><a href=/cgi-bin/koha/bookcount.pl?&bib=$bib&bi=$bi&itm=$items[$i]->{'itemnumber'}>Total Issues:</a></b> $items[$i]->{'issues'}<br>
176 <b>Group Number:</b> $bi <br>
177 <b>Biblio number:</b> $bib <br>
178
179
180
181 </font>
182 </TD>
183 </tr>
184 </table>
185 </form>
186 printend
187 ;
188 }
189 print <<printend
190 <p>
191 </form>
192 printend
193 ;
194
195
196 print endcenter();
197
198 print endmenu($type);
199 print endpage();