#!/usr/bin/perl
-# WARNING: 4-character tab stops here
# Copyright 2000-2002 Katipo Communications
#
# Suite 330, Boston, MA 02111-1307 USA
use strict;
+use warnings;
+
use CGI;
use C4::Auth;
use HTML::Template::Pro;
# Using more than one scrolling list in a CGI assigns the same default value to all the
# scrolling lists on the page !?!? That's why this function was written.
-my $query = new CGI;
+my $query = new CGI;
my $type = $query->param('type');
-my $op = $query->param('op');
+my $op = $query->param('op') || '';
my $batch_id = $query->param('batch_id');
my $ccl_query = $query->param('ccl_query');
my $startfrom = $query->param('startfrom') || 1;
my ( $template, $loggedinuser, $cookie );
-my ($total_hits, $orderby, $results, $total, $error, $marcresults, $idx, $datefrom, $dateto, $ccl_textbox);
+my (
+ $total_hits, $orderby, $results, $total, $error,
+ $marcresults, $idx, $datefrom, $dateto, $ccl_textbox
+);
my $resultsperpage = C4::Context->preference('numSearchResults') || '20';
: $startfrom + $resultsperpage - 1;
# multi page display
- my $displaynext = 0;
- my $displayprev = $startfrom;
-
- $displaynext = 1 if (scalar @results == $resultsperpage);
+ $displaynext = 0;
+ $displayprev = $startfrom > 1 ? $startfrom : 0;
- $template->param(
+ $displaynext = 1 if $to < $total_hits;
- total => $total_hits,
- from => $from,
- to => $to,
- startfromnext => $startfromnext,
- startfromprev => $startfromprev,
- startfrom => $startfrom,
- displaynext => $displaynext,
- displayprev => $displayprev,
- resultsperpage => $resultsperpage,
- numbers => \@numbers,
+ } else {
+ $displayprev = 0;
+ $displaynext = 0;
+ }
- );
- }
+ $template->param(
+ total => $total_hits,
+ from => $from,
+ to => $to,
+ startfromnext => $startfromnext,
+ startfromprev => $startfromprev,
+ startfrom => $startfrom,
+ displaynext => $displaynext,
+ displayprev => $displayprev,
+ resultsperpage => $resultsperpage,
+ numbers => \@numbers,
+ );
$template->param(
result => \@results,
);
my $itemtypes = GetItemTypes;
my @itemtypeloop;
- foreach my $thisitemtype (keys %$itemtypes) {
- my %row =(value => $thisitemtype,
- description => $itemtypes->{$thisitemtype}->{'description'},
- );
- push @itemtypeloop, \%row;
+ foreach my $thisitemtype ( keys %$itemtypes ) {
+ my %row = (
+ value => $thisitemtype,
+ description => $itemtypes->{$thisitemtype}->{'description'},
+ );
+ push @itemtypeloop, \%row;
}
$template->param(
- itemtypeloop =>\@itemtypeloop,
- batch_id => $batch_id,
- type => $type,
+ itemtypeloop => \@itemtypeloop,
+ batch_id => $batch_id,
+ type => $type,
);
}
+
# Print the page
-$template->param(
- DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
-);
+$template->param( DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), );
output_html_with_http_headers $query, $cookie, $template->output;
-
-# Local Variables:
-# tab-width: 4
-# End:
-
-
-
-
-
-
-