From b96b1f02f34048f07e559f0c2a4469d46c8a1f1c Mon Sep 17 00:00:00 2001 From: finlayt Date: Wed, 27 Nov 2002 01:46:54 +0000 Subject: [PATCH] more improovements for the hlt opac --- opac/opac-detail.pl | 43 ++++++++++------------------------------- opac/opac-user.pl | 1 - opac/opac-userupdate.pl | 20 +++++++++---------- 3 files changed, 19 insertions(+), 45 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index ce5362e1cc..0b32a357d7 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -1,23 +1,18 @@ #!/usr/bin/perl use strict; require Exporter; -use C4::Output; # contains gettemplate use CGI; use C4::Search; use C4::Auth; my $query=new CGI; - - -my $flagsrequired; -$flagsrequired->{borrow}=1; - -my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 1, $flagsrequired); - - -my $template = gettemplate ("opac-detail.tmpl", "opac"); - -$template->param(loggedinuser => $loggedinuser); +my ($template, $borrowernumber, $cookie) + = get_template_and_user({template_name => "opac-detail.tmpl", + query => $query, + type => "opac", + authnotrequired => 1, + flagsrequired => {borrow => 1}, + }); my $biblionumber=$query->param('bib'); $template->param(biblionumber => $biblionumber); @@ -40,40 +35,22 @@ for (my $i = 1; $i < $authorcount; $i++) { my $norequests = 1; foreach my $itm (@items) { $norequests = 0 unless $itm->{'notforloan'}; + $itm->{$itm->{'publictype'}} = 1; } $template->param(norequests => $norequests); - - -my @results; - -$results[0]=$dat; +my @results = ($dat,); my $resultsarray=\@results; my $itemsarray=\@items; my $webarray=\@webbiblioitems; my $sitearray=\@websites; - -my $startfrom=$query->param('startfrom'); -($startfrom) || ($startfrom=0); - -my $count=1; - -# now to get the items into a hash we can use and whack that thru -$template->param(startfrom => $startfrom+1); -$template->param(endat => $startfrom+20); -$template->param(numrecords => $count); -my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20); -my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0); -$template->param(nextstartfrom => $nextstartfrom); -$template->param(prevstartfrom => $prevstartfrom); - $template->param(BIBLIO_RESULTS => $resultsarray); $template->param(ITEM_RESULTS => $itemsarray); $template->param(WEB_RESULTS => $webarray); $template->param(SITE_RESULTS => $sitearray); -print "Content-Type: text/html\n\n", $template->output; +print $query->header(-cookie => $cookie), $template->output; diff --git a/opac/opac-user.pl b/opac/opac-user.pl index aadf6e1400..3741f08588 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -68,7 +68,6 @@ foreach my $key (keys %$issues) { if ($issue->{'overdue'}) { push @overdues, $issue; - foreach my $k (keys %$issue) {warn "$k : $issue->{$k}";} $overdues_count++; $issue->{'status'} = "OVERDUE"; } else { diff --git a/opac/opac-userupdate.pl b/opac/opac-userupdate.pl index cb210a56db..201488ca33 100755 --- a/opac/opac-userupdate.pl +++ b/opac/opac-userupdate.pl @@ -13,13 +13,16 @@ use C4::Circulation::Circ2; my $query = new CGI; -my $flagsrequired; -$flagsrequired->{borrow}=1; - -my ($loggedinuser, $cookie, $sessionID) = checkauth($query, 0, $flagsrequired); +my ($template, $borrowernumber, $cookie) + = get_template_and_user({template_name => "opac-userupdate.tmpl", + query => $query, + type => "opac", + authnotrequired => 0, + flagsrequired => {borrow => 1}, + debug => 1, + }); # get borrower information .... -my $borrowernumber = getborrowernumber($loggedinuser); my ($borr, $flags) = getpatroninformation(undef, $borrowernumber); @@ -66,8 +69,6 @@ EOF } } -my $template = gettemplate("opac-userupdate.tmpl", "opac"); - $borr->{'dateenrolled'} = slashifyDate($borr->{'dateenrolled'}); $borr->{'expiry'} = slashifyDate($borr->{'expiry'}); @@ -80,7 +81,4 @@ $bordat[0] = $borr; $template->param(BORROWER_INFO => \@bordat); - -$template->param(loggedinuser => $loggedinuser); - -print "Content-Type: text/html\n\n", $template->output; +print $query->header(-cookie => $cookie), $template->output; -- 2.39.5