This patch makes z3950_search.pl handle the situation properly, and z3950_search.tmpl
show a proper message instead of a program error. All this, in case the javascript
checks that alert the user (that at least one target has to be chosen) are by-passed.
Regards
To+
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed small translation problem in javascript alert message.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
}
else {
my @id = $input->param('id');
}
else {
my @id = $input->param('id');
+
+ if ( not defined @id ) {
+ # empty server list -> report and exit
+ $template->param( emptyserverlist => 1 );
+ output_html_with_http_headers $input, $cookie, $template->output;
+ exit;
+ }
+
my @oConnection;
my @oResult;
my @errconn;
my @oConnection;
my @oResult;
my @errconn;
$(".linktools").hide();
$("tr").removeClass("selected");
}
$(".linktools").hide();
$("tr").removeClass("selected");
}
$(document).ready(function(){
$("#CheckAll").click(function(){
$(".checkboxed").checkCheckboxes();
$(document).ready(function(){
$("#CheckAll").click(function(){
$(".checkboxed").checkCheckboxes();
var row = $(this).parent();
row.addClass("selected");
});
var row = $(this).parent();
row.addClass("selected");
});
+ $("form[name='f']").submit(function(){
+ if ($('input[type=checkbox]').filter(':checked').length == 0) {
+ alert(_("Please choose at least one Z39.50 target"));
+ return false;
+ } else
+ return true;
+ });
<!-- /TMPL_LOOP --></tbody>
</table>
<!-- TMPL_ELSE -->
<!-- /TMPL_LOOP --></tbody>
</table>
<!-- TMPL_ELSE -->
- <!-- TMPL_LOOP name="errconn" -->
- Connection failed to <!-- TMPL_VAR NAME="server" -->
- <!-- /TMPL_LOOP -->
+ <!-- TMPL_IF NAME="emptyserverlist" -->
+ You didn't select any Z39.50 target.
+ <!-- TMPL_ELSE -->
+ <!-- TMPL_LOOP name="errconn" -->
+ Connection failed to <!-- TMPL_VAR NAME="server" -->
+ <!-- /TMPL_LOOP -->
+ <!-- /TMPL_IF -->
<p>Nothing found. <a href="/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Try another search</a>.</p>
<!-- /TMPL_IF -->
<p>Nothing found. <a href="/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Try another search</a>.</p>
<!-- /TMPL_IF -->