Added code to allow searches to be used by catalogue maintenance
[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)=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->{'notes'}<br>
92 <b>No. of Items:</b> $count
93 printend
94 ;
95 if ($type eq 'catmain'){
96   print "<br><a href=/cgi-bin/koha/maint/shiftbib.pl?bi=$data->{'biblioitemnumber'}&bib=$data->{'biblionumber'}>Shift to another biblio</a>";
97  
98 }
99 print <<printend
100 </font>
101 </TD>
102 </tr>
103 </table>
104 </form>
105 printend
106 ;
107
108 for (my $i=0;$i<$count;$i++){
109 print <<printend
110 <img src="/images/holder.gif" width=16 height=300 align=left>
111 <TABLE  CELLSPACING=0  CELLPADDING=5 border=1 align=left width=220 >                            
112 <TR VALIGN=TOP>
113 <td  bgcolor="99cc33" background="/images/background-mem.gif"><B>BARCODE $items[$i]->{'barcode'}</b></TD>
114 </TR>
115 <tr VALIGN=TOP  >
116 <TD width=220 >
117 <form action=/cgi-bin/koha/moditem.pl method=post>
118 <input type=hidden name=bibitem value=$bi>
119 <input type=hidden name=item value=$items[$i]->{'itemnumber'}>
120 <INPUT TYPE="image" name="submit"  VALUE="modify" height=42  WIDTH=93 BORDER=0 src="/images/modify-mem.gif"> 
121 <INPUT TYPE="image" name="delete"  VALUE="delete" height=42  WIDTH=93 BORDER=0 src="/images/delete-mem.gif"> 
122 <br>
123 printend
124 ;
125 $items[$i]->{'itemlost'}=~ s/0/No/;
126 $items[$i]->{'itemlost'}=~ s/1/Yes/;
127 $items[$i]->{'withdrawn'}=~ s/0/No/;
128 $items[$i]->{'withdrawn'}=~ s/1/Yes/;
129 $items[$i]->{'replacementprice'}+=0.00;
130 my $year=substr($items[$i]->{'timestamp0'},0,4);
131 my $mon=substr($items[$i]->{'timestamp0'},4,2);
132 my $day=substr($items[$i]->{'timestamp0'},6,2);
133 $items[$i]->{'timestamp0'}="$day/$mon/$year";
134 my @temp=split('-',$items[$i]->{'dateaccessioned'});
135 $items[$i]->{'dateaccessioned'}="$temp[2]/$temp[1]/$temp[0]";
136 @temp=split('-',$items[$i]->{'datelastseen'});
137 $items[$i]->{'datelastseen'}="$temp[2]/$temp[1]/$temp[0]";
138 print <<printend
139 <FONT SIZE=2  face="arial, helvetica">
140 <b>Home Branch:</b> $items[$i]->{'homebranch'}<br>
141 <b>Last seen:</b> $items[$i]->{'datelastseen'}<br>
142 <b>Last borrowed:</b> $items[$i]->{'timestamp0'}<br>
143 printend
144 ;
145 if ($items[$i] eq 'Available'){
146   print "<b>Currently on issue to:</b><br>";
147 } else {
148   print "<b>Currently on issue to:</b> <a href=/cgi-bin/koha/moremember.pl?bornum=$items[$i]->{'borrower0'}>$items[$i]->{'card'}</a><br>";
149 }
150 print <<printend
151 <b>Last Borrower 1:</b> $items[$i]->{'card0'}<br>
152 <b>Last Borrower 2:</b> $items[$i]->{'card1'}<br>
153 <b>Current Branch:</b> $items[$i]->{'holdingbranch'}<br>
154 <b>Replacement Price:</b> $items[$i]->{'replacementprice'}<br>
155 <b>Item lost:</b> $items[$i]->{'itemlost'}<br>
156 <b>paid by:</b><br>
157 <b>Notes:</b> $items[$i]->{'itemnotes'}<br>
158 <b>Renewals:</b> $items[$i]->{'renewals'}<br>
159 <b><a href=/cgi-bin/koha/acqui/acquire.pl?recieve=$order->{'ordernumber'}&biblio=$bib&invoice=$order->{'booksellerinvoicenumber'}&catview=yes>Accession</a> Date: $items[$i]->{'dateaccessioned'}<br>
160 printend
161 ;
162 if ($items[$i]->{'wthdrawn'} eq '1'){
163   $items[$i]->{'wthdrawn'}="Yes";
164 } else {
165   $items[$i]->{'wthdrawn'}="No";
166 }
167 print <<printend
168 <b>Cancelled: $items[$i]->{'wthdrawn'}<br>
169 <b>Total Issues:</b> $items[$i]->{'issues'}<br>
170 <b>Group Number:</b> $bi <br>
171 <b>Biblio number:</b> $bib <br>
172
173
174
175 </font>
176 </TD>
177 </tr>
178 </table>
179 </form>
180 printend
181 ;
182 }
183 print <<printend
184 <p>
185 </form>
186 printend
187 ;
188
189
190 print endcenter();
191
192 print endmenu($type);
193 print endpage();