Skip to content
Browse files

Bug 7582 - When adding a Z39.50 server the "checked" option should us…

…e a checkbox

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
  • Loading branch information...
1 parent 99f686e commit 1a5afaa26d374144d1ebde6bcf9c69b97c048a5d @oleonard oleonard committed with PaulPoulain Feb 22, 2012
Showing with 10 additions and 5 deletions.
  1. +2 −1 admin/z3950servers.pl
  2. +8 −4 koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt
View
3 admin/z3950servers.pl
@@ -91,6 +91,7 @@ sub StringSearch {
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 @@ sub StringSearch {
$input->param('userid'),
$input->param('password'),
$input->param('searchfield'),
- $input->param('checked'),
+ $checked,
$input->param('rank'),
$input->param('syntax'),
$input->param('encoding'),
View
12 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 @@
</li>
<li><label for="password">Password: </label> <input type="text" name="password" id="password" value="[% password %]" />
</li>
- <li><label for="checked">Checked (searched by default): </label> <input type="text" size="1" name="checked" id="checked" value="[% checked %]" onblur="isNum(this)" /> </li>
+ <li><label for="checked">Checked (searched by default): </label>
+ [% IF ( checked ) %]
+ <input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
+ [% ELSE %]
+ <input type="checkbox" name="checked" id="checked" value="1" />
+ [% END %]
+ </li>
<li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% rank %]" onblur="isNum(this)" />
</li>
<li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>
@@ -305,7 +309,7 @@
[% ELSE %]
<tr>
[% END %]
-<td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% loo.checked %]</td><td>[% loo.rank %]</td> <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.name |url %]">Delete</a></td> </tr>
+<td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td> <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.name |url %]">Delete</a></td> </tr>
[% END %]</tbody>
</table>

0 comments on commit 1a5afaa

Please sign in to comment.
Something went wrong with that request. Please try again.