[Koha-cvs] koha koha-tmpl/intranet-tmpl/default/en/z3950/s... [rel_2_2]

paul poulain paul at koha-fr.org
Wed Nov 22 11:24:35 CET 2006


CVSROOT:	/cvsroot/koha
Module name:	koha
Branch:		rel_2_2
Changes by:	paul poulain <tipaul>	06/11/22 10:24:35

Modified files:
	koha-tmpl/intranet-tmpl/default/en/z3950: searchresult.tmpl 
	z3950          : search.pl 

Log message:
	fixing bugs in new z3950 client : search was not working for 2+ servers.
	+ reindenting with spaces
	+ removing some warns

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/z3950/searchresult.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.4.2.4&r2=1.4.2.5
http://cvs.savannah.gnu.org/viewcvs/koha/z3950/search.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.3.2.10&r2=1.3.2.11

Patches:
Index: koha-tmpl/intranet-tmpl/default/en/z3950/searchresult.tmpl
===================================================================
RCS file: /cvsroot/koha/koha/koha-tmpl/intranet-tmpl/default/en/z3950/Attic/searchresult.tmpl,v
retrieving revision 1.4.2.4
retrieving revision 1.4.2.5
diff -u -b -r1.4.2.4 -r1.4.2.5
--- koha-tmpl/intranet-tmpl/default/en/z3950/searchresult.tmpl	3 Nov 2006 10:56:59 -0000	1.4.2.4
+++ koha-tmpl/intranet-tmpl/default/en/z3950/searchresult.tmpl	22 Nov 2006 10:24:35 -0000	1.4.2.5
@@ -13,37 +13,34 @@
 
 <body>
 <div id="main-compact">
-<table>
 <!-- TMPL_IF name="opsearch" -->
-<h3>Select Search Libraries</h3>
+    <h2>Search on</h2>
 
+    <form method="post" action="search.pl" name="f">
 
-<form method="post" action="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="oldbiblionumber" value="<!-- TMPL_VAR NAME="oldbiblionumber" -->" />
-
-<tr>
-		<th>Library</th>
-		<th>Select</th>
-</tr>
-<!-- TMPL_LOOP name="serverloop" -->
-		<tr bgcolor="<!-- TMPL_VAR NAME="toggle" -->">
-			<td><!-- TMPL_VAR NAME="server" --></td>
-			
-			<td> <input type="checkbox" name="id" value=<!-- TMPL_VAR NAME="id" --> <!-- TMPL_IF name="checked" -->checked="1"<!-- /TMPL_IF --> ></td>
-	</tr>
+    <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="oldbiblionumber" value="<!-- TMPL_VAR NAME="oldbiblionumber" -->" />
+    
+    <!-- TMPL_LOOP name="serverloop" -->
+        <p>
+            <!-- TMPL_IF name="checked" -->
+                <input type="checkbox" name="id" value=<!-- TMPL_VAR NAME="id" --> checked="1">
+            <!-- TMPL_ELSE -->
+                <input type="checkbox" name="id" value=<!-- TMPL_VAR NAME="id" --> checked="1">
+            <!-- /TMPL_IF --><label><!-- TMPL_VAR NAME="server" --></label>
+        </p>
 	<!-- /TMPL_LOOP -->
-	<tr><td><input type="submit"  class="submit" value="Search internet" onclick="cursor :'wait'";
-	 /></td></tr></form>
+    <input type="submit"  class="submit" value="Search internet" onclick="cursor :'wait'"/>
+    </form>
 <!-- TMPL_ELSE -->
-
-<caption>Bibliographic Records Found in <!-- TMPL_VAR NAME="server" --></caption>
+    <h2>Results</h2>
+    <table>
 	<tr>
+        <th>Server</th>
 		<th>Title</th>
 		<th>Author</th>
 		<th>ISBN</th>
@@ -53,7 +50,8 @@
 	<!-- TMPL_IF name="breeding_loop" -->
 	<!-- TMPL_LOOP name="breeding_loop" --> 
 		<tr bgcolor="<!-- TMPL_VAR NAME="toggle" -->">
-			<td><!-- TMPL_VAR NAME="title" --></a>
+            <td><!-- TMPL_VAR name="server" --></td>
+            <td><!-- TMPL_VAR NAME="title" --></td>
 			<td><!-- TMPL_VAR NAME="author" --></td>
 			<td><!-- TMPL_VAR NAME="isbn" --></td>
 			<td><a href="javascript:Import(<!-- TMPL_VAR NAME="id" -->,<!-- TMPL_VAR NAME="oldbiblionumber" -->)">Import</a></td> 

Index: z3950/search.pl
===================================================================
RCS file: /cvsroot/koha/koha/z3950/search.pl,v
retrieving revision 1.3.2.10
retrieving revision 1.3.2.11
diff -u -b -r1.3.2.10 -r1.3.2.11
--- z3950/search.pl	3 Nov 2006 10:56:59 -0000	1.3.2.10
+++ z3950/search.pl	22 Nov 2006 10:24:35 -0000	1.3.2.11
@@ -104,7 +104,7 @@
 							
 	if ($isbn ne "/" || $issn ne "/") {
 		$attr='1=7';
-        warn "isbn : $isbn";
+#         warn "isbn : $isbn";
 		$term=$isbn if ($isbn ne "/");
 		$term=$issn if ($issn ne "/");
 	} elsif ($title ne "/") {
@@ -116,7 +116,7 @@
 	} 
 
 	my $query="\@attr $attr \"$term\"";	
-    warn "query ".$query;
+#     warn "query ".$query;
 	foreach my $servid (@id){
 		my $sth=$dbh->prepare("select * from z3950servers where id=?");
 		$sth->execute($servid);
@@ -130,7 +130,7 @@
 			$option1->option('password',$server->{password})  if $server->{password};
 			$option1->option('preferredRecordSyntax', $server->{syntax});
 			$oConnection[$s]=create ZOOM::Connection($option1) || warn ("something went wrong: ".$oConnection[$s]->errmsg());
-			warn ("server data",$server->{name}, $server->{port});
+# 			warn ("server data",$server->{name}, $server->{port});
 			$oConnection[$s]->connect($server->{host}, $server->{port}) || warn ("something went wrong: ".$oConnection[$s]->errmsg());
 			$serverhost[$s]=$server->{host};
 			$encoding[$s]=$server->{syntax};
@@ -166,7 +166,6 @@
 		my $numresults=$oResult[$k]->size() ;								
 		my $i;
 		my $result='';
-		@breeding_loop = ();
 		if ($numresults>0){
 			for ($i=0; $i<(($numresults<5) ? ($numresults) : (5)) ; $i++) {
 				my $rec=$oResult[$k]->record($i); 										
@@ -196,18 +195,17 @@
 				$row_data{id} = $bid;
 				$row_data{oldbiblionumber}=$oldbiblionumber;
 				push (@breeding_loop, \%row_data);
-         
 			}# upto 5 results
      
 		}#$numresults
 	}# if $k !=0
 	$numberpending=$nremaining-1;
-	$template->param(breeding_loop => \@breeding_loop,server=>$serverhost[$k],
+	$template->param(breeding_loop => \@breeding_loop, server=>$serverhost[$k],
 				numberpending => $numberpending,
 	);
-	output_html_with_http_headers $input, "", $template->output if $firstresult==1;
+	output_html_with_http_headers $input, $cookie, $template->output if $numberpending==0;
 
-	print  $template->output  if $firstresult !=1;
+# 	print  $template->output  if $firstresult !=1;
 	$firstresult++;
 
 	MAYBE_AGAIN:





More information about the Koha-cvs mailing list