From 1a5afaa26d374144d1ebde6bcf9c69b97c048a5d Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 22 Feb 2012 12:24:54 -0500 Subject: [PATCH] Bug 7582 - When adding a Z39.50 server the "checked" option should use a checkbox Signed-off-by: Jared Camins-Esakov Signed-off-by: Paul Poulain --- admin/z3950servers.pl | 3 ++- .../prog/en/modules/admin/z3950servers.tt | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/admin/z3950servers.pl b/admin/z3950servers.pl index 44b3967f7a..f0a4dbb4ca 100755 --- a/admin/z3950servers.pl +++ b/admin/z3950servers.pl @@ -91,6 +91,7 @@ if ($op eq 'add_form') { my $dbh=C4::Context->dbh; my $sth=$dbh->prepare("select * from z3950servers where name=?"); $sth->execute($input->param('searchfield')); + my $checked = $input->param('checked') ? 1 : 0; if ($sth->rows) { $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=? where name=?"); $sth->execute($input->param('host'), @@ -99,7 +100,7 @@ if ($op eq 'add_form') { $input->param('userid'), $input->param('password'), $input->param('searchfield'), - $input->param('checked'), + $checked, $input->param('rank'), $input->param('syntax'), $input->param('encoding'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt index e565acff4f..12585b38b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt @@ -57,8 +57,6 @@ } if (isNaN(f.rank.value)) {_alertString += "- rank must be a number\n"; } - if (isNaN(f.checked.value) || f.checked.value<0 || f.checked.value>1) {_alertString += "- checked must be 0 or 1\n"; - } if (_alertString.length==0) {document.Aform.submit(); } else {alertString2 = "Form not submitted because of the following problem(s)\n";alertString2 += "------------------------------------------------------------------------------------\n\n";alertString2 += _alertString;alert(alertString2); } @@ -109,7 +107,13 @@
  • -
  • +
  • + [% IF ( checked ) %] + + [% ELSE %] + + [% END %] +
  • @@ -305,7 +309,7 @@ [% ELSE %] [% END %] -[% loo.name %][% loo.host %]:[% loo.port %][% loo.db %][% loo.userid %][% loo.password %][% loo.checked %][% loo.rank %] [% loo.syntax %][% loo.encoding %]EditDelete +[% loo.name %][% loo.host %]:[% loo.port %][% loo.db %][% loo.userid %][% loo.password %][% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %][% loo.rank %] [% loo.syntax %][% loo.encoding %]EditDelete [% END %] -- 2.39.5