[Koha-cvs] CVS: koha/opac opac-searchresults.pl,1.1.2.8,1.1.2.9

Steve Tonnesen tonnesen at users.sourceforge.net
Fri Dec 6 21:25:03 CET 2002


Update of /cvsroot/koha/koha/opac
In directory sc8-pr-cvs1:/tmp/cvs-serv27236

Modified Files:
      Tag: rel-1-2
	opac-searchresults.pl 
Log Message:
Fixed the numbered page indexes at the top of the search results.  They were
calculated assuming 10 results per page, and the default was changed to 20.  I
assume this is going to become a configurable parameter at some time (system
default, user preference).


Index: opac-searchresults.pl
===================================================================
RCS file: /cvsroot/koha/koha/opac/opac-searchresults.pl,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -C2 -r1.1.2.8 -r1.1.2.9
*** opac-searchresults.pl	26 Nov 2002 04:40:02 -0000	1.1.2.8
--- opac-searchresults.pl	6 Dec 2002 20:24:58 -0000	1.1.2.9
***************
*** 61,65 ****
  my $env;
  $env->{itemcount}=1;
! my $number_of_results = 20;
  my @results;
  my $count;
--- 61,65 ----
  my $env;
  $env->{itemcount}=1;
! my $number_of_results_per_page = 20;
  my @results;
  my $count;
***************
*** 67,74 ****
  my $subjectitems=$query->param('subjectitems');
  if ($subjectitems) {
!     @results = subsearch($env,$subjectitems, $number_of_results, $startfrom);
      $count = $#results+1;
  } else {
!     ($count, @results) = catalogsearch($env,'',\%search,$number_of_results,$startfrom);
  }
  
--- 67,74 ----
  my $subjectitems=$query->param('subjectitems');
  if ($subjectitems) {
!     @results = subsearch($env,$subjectitems, $number_of_results_per_page, $startfrom);
      $count = $#results+1;
  } else {
!     ($count, @results) = catalogsearch($env,'',\%search,$number_of_results_per_page,$startfrom);
  }
  
***************
*** 115,124 ****
  my $numbers;
  @$numbers = ();
! if ($count>10) {
!     for (my $i=1; $i<$count/10+1; $i++) {
  	my $highlight=0;
  	my $themelang = $template->param('themelang');
! 	($startfrom==($i-1)*10) && ($highlight=1);
! 	push @$numbers, { number => $i, highlight => $highlight , startfrom => ($i-1)*10 };
      }
  }
--- 115,124 ----
  my $numbers;
  @$numbers = ();
! if ($count>$number_of_results_per_page) {
!     for (my $i=1; $i<$count/$number_of_results_per_page+1; $i++) {
  	my $highlight=0;
  	my $themelang = $template->param('themelang');
! 	($startfrom==($i-1)*$number_of_results_per_page) && ($highlight=1);
! 	push @$numbers, { number => $i, highlight => $highlight , startfrom => ($i-1)*$number_of_results_per_page };
      }
  }





More information about the Koha-cvs mailing list