2 # NOTE: Use standard 8-space tabs for this file (indents are 4 spaces)
6 # Copyright 2000-2003 Katipo Communications
8 # This file is part of Koha.
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along with
20 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA 02111-1307 USA
30 use C4::Output; # contains gettemplate
32 use C4::Interface::CGI::Output;
37 # FIXME subject is not exported to the template?
38 my $subject=$query->param('subject');
40 # if its a subject we need to use the subject.tmpl
41 my ($template, $loggedinuser, $cookie) = get_template_and_user({
42 template_name => ($subject? 'catalogue/subject.tmpl':
43 'catalogue/moredetail.tmpl'),
47 flagsrequired => {catalogue => 1},
52 my $biblionumber=$query->param('bib');
53 my $title=$query->param('title');
54 my $bi=$query->param('bi');
56 my $data=bibitemdata($bi);
57 my $dewey = $data->{'dewey'};
58 # FIXME Dewey is a string, not a number, & we should use a function
60 if ($dewey eq "000.") { $dewey = "";};
61 if ($dewey < 10){$dewey='00'.$dewey;}
62 if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
67 $data->{'dewey'}=$dewey;
71 my (@items)=itemissues($bi);
73 $data->{'count'}=$count;
74 my ($order,$ordernum)=getorder($bi,$biblionumber);
81 foreach my $item (@items){
82 $item->{'itemlost'}=~ s/0/No/;
83 $item->{'itemlost'}=~ s/1/Yes/;
84 $item->{'withdrawn'}=~ s/0/No/;
85 $item->{'withdrawn'}=~ s/1/Yes/;
86 $item->{'replacementprice'}+=0.00;
87 my $year=substr($item->{'timestamp0'},0,4);
88 my $mon=substr($item->{'timestamp0'},4,2);
89 my $day=substr($item->{'timestamp0'},6,2);
90 $item->{'timestamp0'}="$day/$mon/$year";
91 $item->{'dateaccessioned'} = format_date($item->{'dateaccessioned'});
92 $item->{'datelastseen'} = format_date($item->{'datelastseen'});
93 $item->{'ordernumber'} = $ordernum;
94 $item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'};
96 # FIXME untranslatable strings
97 if ($item->{'date_due'} eq 'Available'){
98 $item->{'issue'}="<b>Available</b><br>";
100 $item->{'issue'}="<b>Currently on issue to:</b> <a href=/cgi-bin/koha/moremember.pl?bornum=$item->{'borrower0'}>$item->{'card'}</a><br>";
104 $template->param(BIBITEM_DATA => \@results);
105 $template->param(ITEM_DATA => \@items);
106 $template->param(loggedinuser => $loggedinuser);
108 output_html_with_http_headers $query, $cookie, $template->output;