From a28629608b0970564a41729c29cea71035a0a3be Mon Sep 17 00:00:00 2001 From: rangi Date: Fri, 20 Apr 2001 00:31:02 +0000 Subject: [PATCH] Quick bodge to restrict the number of returned books showing to 8. (Request from the librarians here to speed up the screen reload) Needs to be tidied up --- circ/circulation.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/circ/circulation.pl b/circ/circulation.pl index bf54fda73a..6b8d29bb82 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -382,11 +382,19 @@ EOF Due DateBar CodeTitleAuthorTypeBorrower EOF my $color=''; + #set up so only the lat 8 returned items display (make for faster loading pages) + my $count=0; foreach (sort {$a <=> $b} keys %returneditems) { + if ($count < 8){ ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1); my $barcode=$returneditems{$_}; my $duedate=$riduedate{$_}; my @datearr = localtime(time()); + ### + # convert to nz date format + my @tempdate=split(/-/,$duedate); + $duedate="$tempdate[2]/$tempdate[1]/$tempdate[0]"; + #### my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]); my $overduetext="$duedate"; ($overduetext="$duedate") if ($duedate lt $todaysdate); @@ -395,6 +403,10 @@ EOF my ($borrower) = getpatroninformation(\%env,$borrowernumber,0); my ($iteminformation) = getiteminformation(\%env, 0, $barcode); print "$overduetext{'biblionumber'}&type=intra onClick=\"openWindow(this, 'Item', 480, 640)\">$barcode$iteminformation->{'title'}$iteminformation->{'author'}$iteminformation->{'itemtype'}{'borrowernumber'} onClick=\"openWindow(this,'Member', 480, 640)\">$borrower->{'cardnumber'} $borrower->{'firstname'} $borrower->{'surname'}\n"; + } else { + last + } + $count++; } print "\n"; } else { @@ -634,6 +646,13 @@ EOF my $bgcolor=''; my $datedue=$bookissue->{'date_due'}; my $dd=$bookissue->{'date_due'}; + #convert to nz style dates + #this should be set with some kinda config variable + + my @tempdate=split(/-/,$dd); + $dd="$tempdate[2]/$tempdate[1]/$tempdate[0]"; + + ##### $datedue=~s/-//g; if ($datedue < $todaysdate) { $dd="$dd\n"; -- 2.39.5