[Koha-cvs] koha/z3950/server zed-koha-server.pl [rel_2_2]

paul poulain paul at koha-fr.org
Wed Aug 2 14:46:40 CEST 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	paul poulain <tipaul>	06/08/02 12:46:40

Modified files:
	z3950/server   : zed-koha-server.pl 

Log message:
	some changes in z3950 servers for better results (works with UNIMARC)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/z3950/server/zed-koha-server.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.4.2.1&r2=1.4.2.2

Patches:
Index: zed-koha-server.pl
===================================================================
RCS file: /cvsroot/koha/koha/z3950/server/zed-koha-server.pl,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -u -b -r1.4.2.1 -r1.4.2.2
--- zed-koha-server.pl	16 Jun 2005 15:50:22 -0000	1.4.2.1
+++ zed-koha-server.pl	2 Aug 2006 12:46:40 -0000	1.4.2.2
@@ -89,7 +89,7 @@
        	my $sth_get = $dbh->prepare("$sql_query");
 
        	## Send the query to the database:
-       	$sth_get->execute($query);
+       	$sth_get->execute($args->{RPN}->{query}->{term});
 	my $count = 0;
 	while(my ($data)=$sth_get->fetchrow_array) {
 		
@@ -110,7 +110,7 @@
 	
 	## The actual Term
 	my $term = $args->{term};
-	$term =~ s| |\%|g;
+	$term =~ s| |\%|g if $term;
         $term .= "\%";         ## Add the wildcard to search term
 
 	$_ = "$query";
@@ -236,7 +236,7 @@
 		my $sql_query = "SELECT marc_biblio.bibid FROM marc_biblio RIGHT JOIN biblio ON marc_biblio.biblionumber = biblio.biblionumber WHERE biblio.subject LIKE ?";
                 &run_query($sql_query, $query, $args);
         }
-	elsif (/1=1016/) {       ## any 
+    else {
                 $query =~ s|\@attrset 1.2.840.10003.3.1 \@attr 1=1016 ||g;
                 $query  =~ s|"||g;
                 $query  =~ s| |%|g;
@@ -258,8 +258,8 @@
 		$query =~ s|5=1||g;     ## truncation
 		
 		$query .= "\%";         ## Add the wildcard to search term
-                print "$query\n";
-		my $sql_query = "SELECT bibid FROM marc_word WHERE word LIKE?";
+                print "Querying : $query\n";
+		my $sql_query = "SELECT bibid FROM marc_word WHERE word LIKE ?";
                 &run_query($sql_query, $query, $args);
         }
 }





More information about the Koha-cvs mailing list