3 # Copyright 2000-2003 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
25 use C4
::Biblio
; # to use &GetBiblioItemData &GetItemsByBiblioitemnumber
27 use C4
::Output
; # contains gettemplate
29 use C4
::Dates qw
/format_date/;
30 use C4
::Circulation
; # to use itemissues
34 # FIXME subject is not exported to the template?
35 my $subject=$query->param('subject');
37 # if its a subject we need to use the subject.tmpl
38 my ($template, $loggedinuser, $cookie) = get_template_and_user
({
39 template_name
=> ($subject?
'catalogue/subject.tmpl':
40 'catalogue/moredetail.tmpl'),
44 flagsrequired
=> {catalogue
=> 1},
49 my $biblionumber=$query->param('biblionumber');
50 my $title=$query->param('title');
51 # my $bi=$query->param('bi');
52 # $bi = $biblionumber unless $bi;
53 my $data=GetBiblioData
($biblionumber);
54 my $dewey = $data->{'dewey'};
56 # FIXME Dewey is a string, not a number, & we should use a function
58 # if ($dewey eq "000.") { $dewey = "";};
59 # if ($dewey < 10){$dewey='00'.$dewey;}
60 # if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
65 # $data->{'dewey'}=$dewey;
68 my $fw = GetFrameworkCode
($biblionumber);
69 my @items= GetItemsInfo
($biblionumber);
71 $data->{'count'}=$count;
73 my $ordernum = GetOrderNumber
($biblionumber);
74 my $order = GetOrder
($ordernum);
75 my $ccodes= GetKohaAuthorisedValues
('items.ccode',$fw);
76 my $itemtypes = GetItemTypes
;
78 foreach my $item (@items){
79 $item->{itemlostloop
}= GetAuthorisedValues
(GetAuthValCode
('items.itemlost',$fw),$item->{itemlost
}) if GetAuthValCode
('items.itemlost',$fw);
80 $item->{itemdamagedloop
}= GetAuthorisedValues
(GetAuthValCode
('items.damaged',$fw),$item->{damaged
}) if GetAuthValCode
('items.damaged',$fw);
81 $item->{'collection'} = $ccodes->{$item->{ccode
}};
82 $item->{'itype'} = $itemtypes->{$item->{'itype'}}->{'description'};
83 $item->{'replacementprice'}=sprintf("%.2f", $item->{'replacementprice'});
84 $item->{'datelastborrowed'}= format_date
($item->{'datelastborrowed'});
85 $item->{'dateaccessioned'} = format_date
($item->{'dateaccessioned'});
86 $item->{'datelastseen'} = format_date
($item->{'datelastseen'});
87 $item->{'ordernumber'} = $ordernum;
88 $item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'};
90 if ($item->{'date_due'} eq ''){
93 $item->{'date_due'} = format_date
($item->{'date_due'});
98 $template->param(count
=> $data->{'count'});
99 $template->param(BIBITEM_DATA
=> \
@results);
100 $template->param(ITEM_DATA
=> \
@items);
101 $template->param(moredetailview
=> 1);
102 $template->param(loggedinuser
=> $loggedinuser);
103 $template->param(biblionumber
=> $biblionumber);
105 output_html_with_http_headers
$query, $cookie, $template->output;