[Koha-patches] [PATCH] Bug 7866: z39.50 search list ordered by rank

Adrien Saurat adrien.saurat at biblibre.com
Mon Apr 2 10:45:42 CEST 2012


In the z39.50 cataloging search page, the servers
are now sorted by rank and name.
---
 cataloguing/z3950_search.pl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl
index 10320e2..6e6b417 100755
--- a/cataloguing/z3950_search.pl
+++ b/cataloguing/z3950_search.pl
@@ -82,7 +82,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
 $template->param( frameworkcode => $frameworkcode, );
 
 if ( $op ne "do_search" ) {
-    my $sth = $dbh->prepare("select id,host,name,checked from z3950servers  order by host");
+    my $sth = $dbh->prepare("SELECT id,host,name,checked FROM z3950servers ORDER BY rank, name");
     $sth->execute();
     my $serverloop = $sth->fetchall_arrayref( {} );
     $template->param(
@@ -168,7 +168,7 @@ for my $i (1..$nterms-1) {
 warn "query ".$query  if $DEBUG;
 
     foreach my $servid (@id) {
-        my $sth = $dbh->prepare("select * from z3950servers where id=?");
+        my $sth = $dbh->prepare("SELECT * FROM z3950servers WHERE id=? ORDER BY rank, name");
         $sth->execute($servid);
         while ( $server = $sth->fetchrow_hashref ) {
             warn "serverinfo ".join(':',%$server) if $DEBUG;
-- 
1.7.4.1



More information about the Koha-patches mailing list