3 # Copyright 2000-2002 Katipo Communications
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along with
17 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
18 # Suite 330, Boston, MA 02111-1307 USA
27 use C4::Output; # contains picktemplate
32 my $language='french';
36 open (KC, "/etc/koha.conf");
40 if (/(.*)\s*=\s*(.*)/) {
43 # Clean up white space at beginning and end
48 $configfile{$variable}=$value;
52 my $includes=$configfile{'includes'};
53 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
54 my $templatebase="catalogue/moredetail.tmpl";
55 my $startfrom=$query->param('startfrom');
56 ($startfrom) || ($startfrom=0);
57 my $theme=picktemplate($includes, $templatebase);
59 my $subject=$query->param('subject');
60 # if its a subject we need to use the subject.tmpl
62 $templatebase=~ s/searchresults\.tmpl/subject\.tmpl/;
64 my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
68 my $biblionumber=$query->param('bib');
69 my $title=$query->param('title');
70 my $bi=$query->param('bi');
72 my $data=bibitemdata($bi);
73 my $dewey = $data->{'dewey'};
75 if ($dewey eq "000.") { $dewey = "";};
76 if ($dewey < 10){$dewey='00'.$dewey;}
77 if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
82 $data->{'dewey'}=$dewey;
86 my (@items)=itemissues($bi);
88 $data->{'count'}=$count;
89 my ($order,$ordernum)=getorder($bi,$biblionumber);
97 foreach my $item (@items){
98 $item->{'itemlost'}=~ s/0/No/;
99 $item->{'itemlost'}=~ s/1/Yes/;
100 $item->{'withdrawn'}=~ s/0/No/;
101 $item->{'withdrawn'}=~ s/1/Yes/;
102 $item->{'replacementprice'}+=0.00;
103 my $year=substr($item->{'timestamp0'},0,4);
104 my $mon=substr($item->{'timestamp0'},4,2);
105 my $day=substr($item->{'timestamp0'},6,2);
106 $item->{'timestamp0'}="$day/$mon/$year";
107 $item->{'dateaccessioned'} = slashifyDate($item->{'dateaccessioned'});
108 $item->{'datelastseen'} = slashifyDate($item->{'datelastseen'});
109 $item->{'ordernumber'} = $ordernum;
110 $item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'};
112 if ($item->{'date_due'} = 'Available'){
113 $item->{'issue'}="<b>Available</b><br>";
115 $item->{'issue'}="<b>Currently on issue to:</b> <a href=/cgi-bin/koha/moremember.pl?bornum=$item->{'borrower0'}>$item->{'card'}</a><br>";
120 $template->param(includesdir => $includes);
121 $template->param(BIBITEM_DATA => \@results);
122 $template->param(ITEM_DATA => \@items);
123 print "Content-Type: text/html\n\n", $template->output;