X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=moredetail.pl;h=8a7e0e271db0b0d5464de30d613e055c6c3b3648;hb=d5dfb954e26b059ee7f1ad157b8b730d9a4e49c0;hp=f8dbb5c5d8f0cf22572de1bbd7fba253ffcf1679;hpb=1e67687742e36bbb90746ecdd78a0c6a63aad890;p=koha.git diff --git a/moredetail.pl b/moredetail.pl index f8dbb5c5d8..8a7e0e271d 100755 --- a/moredetail.pl +++ b/moredetail.pl @@ -1,5 +1,7 @@ #!/usr/bin/perl +# $Id$ + # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. @@ -23,45 +25,27 @@ require Exporter; 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 () { - 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 @@ -88,7 +72,6 @@ my $count=@items; $data->{'count'}=$count; my ($order,$ordernum)=getorder($bi,$biblionumber); - my $env; $env->{itemcount}=1; @@ -109,16 +92,16 @@ foreach my $item (@items){ $item->{'ordernumber'} = $ordernum; $item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'}; - if ($item->{'date_due'} = 'Available'){ + if ($item->{'date_due'} eq 'Available'){ $item->{'issue'}="Available
"; } else { $item->{'issue'}="Currently on issue to: {'borrower0'}>$item->{'card'}
"; } - } $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;