9 use C4::Output; # contains picktemplate
14 my $language='french';
18 open (KC, "/etc/koha.conf");
22 if (/(.*)\s*=\s*(.*)/) {
25 # Clean up white space at beginning and end
30 $configfile{$variable}=$value;
34 my $includes=$configfile{'includes'};
35 ($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
36 my $templatebase="catalogue/moredetail.tmpl";
37 my $startfrom=$query->param('startfrom');
38 ($startfrom) || ($startfrom=0);
39 my $theme=picktemplate($includes, $templatebase);
41 my $subject=$query->param('subject');
42 # if its a subject we need to use the subject.tmpl
44 $templatebase=~ s/searchresults\.tmpl/subject\.tmpl/;
46 my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
50 my $biblionumber=$query->param('bib');
51 my $title=$query->param('title');
52 my $bi=$query->param('bi');
54 my $data=bibitemdata($bi);
55 my $dewey = $data->{'dewey'};
57 if ($dewey eq "000.") { $dewey = "";};
58 if ($dewey < 10){$dewey='00'.$dewey;}
59 if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
64 $data->{'dewey'}=$dewey;
68 my (@items)=itemissues($bi);
70 $data->{'count'}=$count;
71 my ($order,$ordernum)=getorder($bi,$biblionumber);
78 foreach my $item (@items){
79 $item->{'itemlost'}=~ s/0/No/;
80 $item->{'itemlost'}=~ s/1/Yes/;
81 $item->{'withdrawn'}=~ s/0/No/;
82 $item->{'withdrawn'}=~ s/1/Yes/;
83 $item->{'replacementprice'}+=0.00;
84 my $year=substr($item->{'timestamp0'},0,4);
85 my $mon=substr($item->{'timestamp0'},4,2);
86 my $day=substr($item->{'timestamp0'},6,2);
87 $item->{'timestamp0'}="$day/$mon/$year";
88 $item->{'dateaccessioned'} = slashifyDate($item->{'dateaccessioned'});
89 $item->{'datelastseen'} = slashifyDate($item->{'datelastseen'});
90 if ($item->{'date_due'} = 'Available'){
91 $item->{'issue'}="<b>Currently on issue to:</b><br>";
93 $item->{'issue'}="<b>Currently on issue to:</b> <a href=/cgi-bin/koha/moremember.pl?bornum=$item->{'borrower0'}>$item->{'card'}</a><br>";
98 $template->param(includesdir => $includes);
99 $template->param(BIBITEM_DATA => \@results);
100 $template->param(ITEM_DATA => \@items);
101 print "Content-Type: text/html\n\n", $template->output;