Lines 13-58
Link Here
|
13 |
[% IF ( add_form ) %] |
13 |
[% IF ( add_form ) %] |
14 |
<script type="text/javascript"> |
14 |
<script type="text/javascript"> |
15 |
//<![CDATA[ |
15 |
//<![CDATA[ |
16 |
// |
16 |
$(document).ready(function(){ |
17 |
function isNotNull(f,noalert) { |
17 |
$( "#serverentry" ).validate({ |
18 |
if (f.value.length ==0) { |
18 |
rules: { |
19 |
return false; |
19 |
searchfield: { required: true }, |
20 |
} |
20 |
host: { required: true }, |
21 |
return true; |
21 |
port: { |
22 |
} |
22 |
required: true, |
23 |
// |
23 |
number: true |
24 |
function isNum(v,maybenull) { |
24 |
}, |
25 |
var n = new Number(v.value); |
25 |
db: { required: true }, |
26 |
if (isNaN(n)) { |
26 |
rank: { number: true }, |
27 |
return false; |
27 |
timeout: { number: true } |
28 |
} |
28 |
} |
29 |
if (maybenull==0 && v.value=='') { |
29 |
}); |
30 |
return false; |
30 |
}); |
31 |
} |
31 |
//]]> |
32 |
return true; |
|
|
33 |
} |
34 |
// |
35 |
function Check(f) { |
36 |
var ok=1; |
37 |
var _alertString=""; |
38 |
var alertString2; |
39 |
if (f.searchfield.value.length==0) {_alertString += "- target name missing\n"; |
40 |
} |
41 |
if (f.host.value.length==0) {_alertString += "- host missing\n"; |
42 |
} |
43 |
if (f.port.value.length==0) {_alertString += "- port missing\n"; |
44 |
} |
45 |
if (f.db.value.length==0) {_alertString += "- database missing\n"; |
46 |
} |
47 |
if (isNaN(f.port.value)) {_alertString += "- port must be a number\n"; |
48 |
} |
49 |
if (isNaN(f.rank.value)) {_alertString += "- rank must be a number\n"; |
50 |
} |
51 |
if (_alertString.length==0) {document.Aform.submit(); |
52 |
} else {alertString2 = "Form not submitted because of the following problem(s)\n";alertString2 += "------------------------------------------------------------------------------------\n\n";alertString2 += _alertString;alert(alertString2); |
53 |
} |
54 |
} |
55 |
//]]> |
56 |
</script> |
32 |
</script> |
57 |
[% END %] |
33 |
[% END %] |
58 |
[% IF ( else ) %] |
34 |
[% IF ( else ) %] |
Lines 93-99
Link Here
|
93 |
|
69 |
|
94 |
[% IF ( add_form ) %] |
70 |
[% IF ( add_form ) %] |
95 |
|
71 |
|
96 |
<form action="[% script_name %]" name="Aform" method="post"> |
72 |
<form action="[% script_name %]" name="Aform" method="post" id="serverentry"> |
97 |
<input type="hidden" name="op" value="add_validate" /> |
73 |
<input type="hidden" name="op" value="add_validate" /> |
98 |
[% IF ( searchfield ) %] |
74 |
[% IF ( searchfield ) %] |
99 |
<h1>Modify Z39.50 server</h1> |
75 |
<h1>Modify Z39.50 server</h1> |
Lines 104-117
Link Here
|
104 |
<ol>[% IF ( searchfield ) %] |
80 |
<ol>[% IF ( searchfield ) %] |
105 |
<li><span class="label">Z39.50 server: </span> <input type="hidden" name="searchfield" value="[% searchfield %]" />[% searchfield %]</li> |
81 |
<li><span class="label">Z39.50 server: </span> <input type="hidden" name="searchfield" value="[% searchfield %]" />[% searchfield %]</li> |
106 |
[% ELSE %] |
82 |
[% ELSE %] |
107 |
<li><label for="searchfield">Z39.50 server: </label> <input type="text" name="searchfield" id="searchfield" size="65" maxlength="100" onblur="toUC(this)" /></li> |
83 |
<li><label for="searchfield" class="required">Z39.50 server: </label> <input type="text" name="searchfield" id="searchfield" size="65" maxlength="100" onblur="toUC(this)" required="required" /> <span class="required">Required</span></li> |
108 |
[% END %] |
84 |
[% END %] |
109 |
|
85 |
|
110 |
<li><label for="host">Hostname: </label> <input type="text" name="host" id="host" size="30" value="[% host %]" /> |
86 |
<li><label for="host" class="required">Hostname: </label> <input type="text" name="host" id="host" size="30" value="[% host %]" required="required" /> <span class="required">Required</span> |
111 |
</li> |
87 |
</li> |
112 |
<li><label for="port">Port: </label> <input type="text" name="port" id="port" size="5" value="[% port %]" onblur="isNum(this)" /> |
88 |
<li><label for="port" class="required">Port: </label> <input type="text" name="port" id="port" size="5" value="[% port %]" required="required" /> <span class="required">Required</span> |
113 |
</li> |
89 |
</li> |
114 |
<li><label for="db">Database: </label> <input type="text" name="db" id="db" value="[% db %]" /> |
90 |
<li><label for="db" class="required">Database: </label> <input type="text" name="db" id="db" value="[% db %]" required="required" /> <span class="required">Required</span> |
115 |
</li> |
91 |
</li> |
116 |
<li><label for="userid">Userid: </label> <input type="text" name="userid" id="userid" value="[% userid %]" /> |
92 |
<li><label for="userid">Userid: </label> <input type="text" name="userid" id="userid" value="[% userid %]" /> |
117 |
</li> |
93 |
</li> |
Lines 124-130
Link Here
|
124 |
<input type="checkbox" name="checked" id="checked" value="1" /> |
100 |
<input type="checkbox" name="checked" id="checked" value="1" /> |
125 |
[% END %] |
101 |
[% END %] |
126 |
</li> |
102 |
</li> |
127 |
<li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% rank %]" onblur="isNum(this)" /> |
103 |
<li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% rank %]" /> |
128 |
</li> |
104 |
</li> |
129 |
<li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label> |
105 |
<li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label> |
130 |
<select name="syntax"> |
106 |
<select name="syntax"> |
Lines 223-229
Link Here
|
223 |
</select> |
199 |
</select> |
224 |
</li> |
200 |
</li> |
225 |
<li><label for="timeout">Timeout (0 its like not set): </label> |
201 |
<li><label for="timeout">Timeout (0 its like not set): </label> |
226 |
<input type="text" name="timeout" id="timeout" size="4" value="[% timeout %]" onblur="isNum(this)" /> seconds |
202 |
<input type="text" name="timeout" id="timeout" size="4" value="[% timeout %]" /> seconds |
227 |
</li> |
203 |
</li> |
228 |
<li><label for="recordtype">Record type: </label> |
204 |
<li><label for="recordtype">Record type: </label> |
229 |
<select name="recordtype" id="recordtype"> |
205 |
<select name="recordtype" id="recordtype"> |
Lines 241-248
Link Here
|
241 |
</li> |
217 |
</li> |
242 |
</ol> |
218 |
</ol> |
243 |
</fieldset> |
219 |
</fieldset> |
244 |
|
220 |
|
245 |
<fieldset class="action"><input type="button" value="Save" onclick="Check(this.form)" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset> |
221 |
<fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset> |
246 |
</form> |
222 |
</form> |
247 |
[% END %] |
223 |
[% END %] |
248 |
|
224 |
|
249 |
- |
|
|