View | Details | Raw Unified | Return to bug 7582
Collapse All | Expand All

(-)a/admin/z3950servers.pl (-1 / +2 lines)
Lines 91-96 if ($op eq 'add_form') { Link Here
91
	my $dbh=C4::Context->dbh;
91
	my $dbh=C4::Context->dbh;
92
	my $sth=$dbh->prepare("select * from z3950servers where name=?");
92
	my $sth=$dbh->prepare("select * from z3950servers where name=?");
93
	$sth->execute($input->param('searchfield'));
93
	$sth->execute($input->param('searchfield'));
94
	my $checked = $input->param('checked') ? 1 : 0;
94
	if ($sth->rows) {
95
	if ($sth->rows) {
95
		$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=? where name=?");
96
		$sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=? where name=?");
96
		$sth->execute($input->param('host'),
97
		$sth->execute($input->param('host'),
Lines 99-105 if ($op eq 'add_form') { Link Here
99
		      $input->param('userid'),
100
		      $input->param('userid'),
100
		      $input->param('password'),
101
		      $input->param('password'),
101
		      $input->param('searchfield'),
102
		      $input->param('searchfield'),
102
		      $input->param('checked'),
103
		      $checked,
103
		      $input->param('rank'),
104
		      $input->param('rank'),
104
			  $input->param('syntax'),
105
			  $input->param('syntax'),
105
              $input->param('encoding'),
106
              $input->param('encoding'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt (-5 / +8 lines)
Lines 57-64 Link Here
57
                }
57
                }
58
                if (isNaN(f.rank.value)) {_alertString += "- rank must be a number\n";
58
                if (isNaN(f.rank.value)) {_alertString += "- rank must be a number\n";
59
                }
59
                }
60
                if (isNaN(f.checked.value) || f.checked.value<0 || f.checked.value>1) {_alertString += "- checked must be 0 or 1\n";
61
                }
62
                if (_alertString.length==0) {document.Aform.submit();
60
                if (_alertString.length==0) {document.Aform.submit();
63
                } else {alertString2 = "Form not submitted because of the following problem(s)\n";alertString2 += "------------------------------------------------------------------------------------\n\n";alertString2 += _alertString;alert(alertString2);
61
                } else {alertString2 = "Form not submitted because of the following problem(s)\n";alertString2 += "------------------------------------------------------------------------------------\n\n";alertString2 += _alertString;alert(alertString2);
64
                }
62
                }
Lines 109-115 Link Here
109
		</li>
107
		</li>
110
		<li><label for="password">Password: </label>	<input type="text" name="password" id="password" value="[% password %]" />
108
		<li><label for="password">Password: </label>	<input type="text" name="password" id="password" value="[% password %]" />
111
		</li>
109
		</li>
112
		<li><label for="checked">Checked (searched by default): </label>	<input type="text" size="1" name="checked" id="checked" value="[% checked %]" onblur="isNum(this)" />  </li>
110
		<li><label for="checked">Checked (searched by default): </label>
111
                        [% IF ( checked ) %]
112
                                <input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
113
                        [% ELSE %]
114
                                <input type="checkbox" name="checked" id="checked" value="1" />
115
                        [% END %]
116
                </li>
113
		<li><label for="rank">Rank (display order): </label>	<input type="text" name="rank" id="rank" size="4" value="[% rank %]" onblur="isNum(this)" />
117
		<li><label for="rank">Rank (display order): </label>	<input type="text" name="rank" id="rank" size="4" value="[% rank %]" onblur="isNum(this)" />
114
		</li>	
118
		</li>	
115
		<li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>	
119
		<li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>	
Lines 305-311 Link Here
305
                [% ELSE %]
309
                [% ELSE %]
306
                    <tr>
310
                    <tr>
307
                [% END %]
311
                [% END %]
308
<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>
312
<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>
309
                [% END %]</tbody>
313
                [% END %]</tbody>
310
	</table>
314
	</table>
311
315
312
- 

Return to bug 7582