[Koha-cvs] koha cataloguing/z3950_search.pl koha-tmpl/intr... [rel_3_0]

Henri-Damien LAURENT laurenthdl at alinto.com
Mon Feb 19 11:45:59 CET 2007


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Henri-Damien LAURENT <hdl>	07/02/19 10:45:59

Modified files:
	cataloguing    : z3950_search.pl 
	koha-tmpl/intranet-tmpl/prog/en/cataloguing: z3950_search.tmpl 

Log message:
	Changing max result to 20.
	Using utf8::decode (input is utf8)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/z3950_search.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.2&r2=1.1.2.3
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/cataloguing/z3950_search.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.1.2.2&r2=1.1.2.3

Patches:
Index: cataloguing/z3950_search.pl
===================================================================
RCS file: /cvsroot/koha/koha/cataloguing/Attic/z3950_search.pl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- cataloguing/z3950_search.pl	19 Feb 2007 09:46:18 -0000	1.1.2.2
+++ cataloguing/z3950_search.pl	19 Feb 2007 10:45:58 -0000	1.1.2.3
@@ -100,16 +100,20 @@
     my @oResult;
     my $s=0;
                             
-    if ($isbn ne "/" || $issn ne "/") {
+    if ($isbn || $issn) {
         $attr='1=7';
 #         warn "isbn : $isbn";
-        $term=$isbn if ($isbn ne "/");
-        $term=$issn if ($issn ne "/");
-    } elsif ($title ne "/") {
-        $attr='1=4 @attr 4=1  ';
+		$term=$isbn if ($isbn);
+		$term=$issn if ($issn);
+	} elsif ($title) {
+		$attr='1=4 ';
+        utf8::decode($title);
+        $title=~tr/àâäéèêëîïôöùû/aaaeeeeiioouu/;
         $term=$title;
-    } elsif ($author ne "/") {
+	} elsif ($author) {
         $attr='1=1003';
+        utf8::decode($author);
+        $author=~tr/àâäéèêëîïôöùû/aaaeeeeiioouu/;
         $term=$author;
     } 
 
@@ -159,21 +163,21 @@
         my($error, $errmsg, $addinfo, $diagset) = $oConnection[$k]->error_x();
         if ($error) {
             warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n" if $DEBUG;
-            goto MAYBE_AGAIN;
-        }
+            
+        } else {
         my $numresults=$oResult[$k]->size() ;
         my $i;
         my $result='';
         if ($numresults>0){
-            for ($i=0; $i<(($numresults<5) ? ($numresults) : (5)) ; $i++) {
+              for ($i=0; $i<(($numresults<20) ? ($numresults) : (20)) ; $i++) {
                 my $rec=$oResult[$k]->record($i);
                 my $marcrecord;
                 $marcdata = $rec->raw();
                 $marcrecord= FixEncoding($marcdata);
-####WARNING records coming from Z3950 clients are in various character sets MARC8,UTF8,UNIMARC etc
-## In HEAD i change everything to UTF-8
-# In rel2_2 i am not sure what encoding is so no character conversion is done here
-##Add necessary encoding changes to here -TG
+  ####WARNING records coming from Z3950 clients are in various character sets MARC8,UTF8,UNIMARC etc
+  ## In HEAD i change everything to UTF-8
+  # In rel2_2 i am not sure what encoding is so no character conversion is done here
+  ##Add necessary encoding changes to here -TG
                 my $oldbiblio = MARCmarc2koha($dbh,$marcrecord,"");
                 $oldbiblio->{isbn} =~ s/ |-|\.//g,
                 $oldbiblio->{issn} =~ s/ |-|\.//g,
@@ -193,8 +197,8 @@
                 $row_data{biblionumber}=$biblionumber;
                 push (@breeding_loop, \%row_data);
             }# upto 5 results
-    
         }#$numresults
+        }
     }# if $k !=0
     $numberpending=$nremaining-1;
     $template->param(breeding_loop => \@breeding_loop, server=>$serverhost[$k],

Index: koha-tmpl/intranet-tmpl/prog/en/cataloguing/z3950_search.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/prog/en/cataloguing/Attic/z3950_search.tmpl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -b -r1.1.2.2 -r1.1.2.3
--- koha-tmpl/intranet-tmpl/prog/en/cataloguing/z3950_search.tmpl	19 Feb 2007 09:46:19 -0000	1.1.2.2
+++ koha-tmpl/intranet-tmpl/prog/en/cataloguing/z3950_search.tmpl	19 Feb 2007 10:45:59 -0000	1.1.2.3
@@ -19,11 +19,11 @@
     <form method="post" action="z3950_search.pl" name="f">
     
     <input type="hidden" name="op" id="op" value="do_search" />
-    <input type="hidden" name="title" value=<!-- TMPL_VAR NAME="title" --> />
-    <input type="hidden" name="author" value=<!-- TMPL_VAR NAME="author" --> />
-    <input type="hidden" name="isbn" value=<!-- TMPL_VAR NAME="isbn" --> />
-    <input type="hidden" name="issn" value=<!-- TMPL_VAR NAME="issn" --> />
-    <input type="hidden" name="frameworkcode" value=<!-- TMPL_VAR NAME="frameworkcode" --> />
+    <input type="hidden" name="title" value="<!-- TMPL_VAR NAME="title" -->" />
+    <input type="hidden" name="author" value="<!-- TMPL_VAR NAME="author" -->" />
+    <input type="hidden" name="isbn" value="<!-- TMPL_VAR NAME="isbn" -->" />
+    <input type="hidden" name="issn" value="<!-- TMPL_VAR NAME="issn" -->" />
+    <input type="hidden" name="frameworkcode" value="<!-- TMPL_VAR NAME="frameworkcode" -->" />
     <input type="hidden" name="oldbiblionumber" value="<!-- TMPL_VAR NAME="oldbiblionumber" -->" />
     
     <!-- TMPL_LOOP name="serverloop" -->





More information about the Koha-cvs mailing list