Report to user the connections errors to z39.50 server, like timeout(10007), and...
authorNahuel Angelinetti <nahuel.angelinetti@biblibre.com>
Fri, 17 Oct 2008 07:38:13 +0000 (09:38 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 12 Nov 2008 14:01:09 +0000 (15:01 +0100)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
cataloguing/z3950_search.pl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl

index 1463e59..08b45d3 100755 (executable)
@@ -106,6 +106,7 @@ else {
     my @id = $input->param('id');
     my @oConnection;
     my @oResult;
+    my @errconn;
     my $s = 0;
     my $query;
     my $nterms;
@@ -199,6 +200,9 @@ warn "query ".$query  if $DEBUG;
         my ( $error, $errmsg, $addinfo, $diagset ) =
           $oConnection[$k]->error_x();
         if ($error) {
+            if ($error =~ m/^(10000|10007)$/ ) {
+                push(@errconn, {'server' => $serverhost[$k]});
+            }
             warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n"
               if $DEBUG;
 
@@ -263,7 +267,8 @@ warn "query ".$query  if $DEBUG;
         breeding_loop => \@breeding_loop,
         server        => $servername[$k],
         numberpending => $numberpending,
-               biblionumber  => $biblionumber,
+        biblionumber  => $biblionumber,
+        errconn       => \@errconn
     );
     
     output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0;
index 97683dd..3b47914 100644 (file)
@@ -109,6 +109,9 @@ $.tablesorter.addParser({
     <!-- /TMPL_LOOP --></tbody>
 </table>
     <!-- TMPL_ELSE -->
+        <!-- TMPL_LOOP name="errconn" -->
+            Connection failed to <!-- TMPL_VAR NAME="server" -->
+        <!-- /TMPL_LOOP -->
        <p>Nothing found. <a href="/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Try another search</a>.</p>
     <!-- /TMPL_IF -->