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