#!/usr/bin/perl
+# $Id$
+
# Copyright 2000-2002 Katipo Communications
#
# This file is part of Koha.
use C4::Koha;
use CGI;
use C4::Search;
-use C4::Acquisitions;
-use C4::Output; # contains picktemplate
+use C4::Catalogue;
+use C4::Output; # contains gettemplate
+use C4::Auth;
my $query=new CGI;
-
-my $language='french';
-
-
-my %configfile;
-open (KC, "/etc/koha.conf");
-while (<KC>) {
- chomp;
- (next) if (/^\s*#/);
- if (/(.*)\s*=\s*(.*)/) {
- my $variable=$1;
- my $value=$2;
- # Clean up white space at beginning and end
- $variable=~s/^\s*//g;
- $variable=~s/\s*$//g;
- $value=~s/^\s*//g;
- $value=~s/\s*$//g;
- $configfile{$variable}=$value;
- }
-}
-
-my $includes=$configfile{'includes'};
-($includes) || ($includes="/usr/local/www/hdl/htdocs/includes");
-my $templatebase="catalogue/moredetail.tmpl";
-my $startfrom=$query->param('startfrom');
-($startfrom) || ($startfrom=0);
-my $theme=picktemplate($includes, $templatebase);
+my $includes = C4::Context->config('includes') ||
+ "/usr/local/www/hdl/htdocs/includes";
+my $startfrom=$query->param('startfrom') || 0;
my $subject=$query->param('subject');
# if its a subject we need to use the subject.tmpl
+my $template;
if ($subject){
- $templatebase=~ s/searchresults\.tmpl/subject\.tmpl/;
+ $template = gettemplate("catalogue/subject.tmpl");
+} else {
+ $template = gettemplate("catalogue/moredetail.tmpl");
}
-my $template = HTML::Template->new(filename => "$includes/templates/$theme/$templatebase", die_on_bad_params => 0, path => [$includes]);
+my $flagsrequired;
+$flagsrequired->{catalogue}=1;
+my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 0, $flagsrequired);
# get variables
$data->{'count'}=$count;
my ($order,$ordernum)=getorder($bi,$biblionumber);
-
my $env;
$env->{itemcount}=1;
$item->{'ordernumber'} = $ordernum;
$item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'};
- if ($item->{'date_due'} = 'Available'){
+ if ($item->{'date_due'} eq 'Available'){
$item->{'issue'}="<b>Available</b><br>";
} else {
$item->{'issue'}="<b>Currently on issue to:</b> <a href=/cgi-bin/koha/moremember.pl?bornum=$item->{'borrower0'}>$item->{'card'}</a><br>";
}
-
}
$template->param(includesdir => $includes);
$template->param(BIBITEM_DATA => \@results);
$template->param(ITEM_DATA => \@items);
+$template->param(loggedinuser => $loggedinuser);
print "Content-Type: text/html\n\n", $template->output;