Bug 11795 - Use validation plugin when creating new Z39.50 server
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / z3950servers.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; [% IF ( else ) %]Z39.50 servers[% END %]
3 [% IF ( add_form ) %] Z39.50 servers &rsaquo; [% IF ( searchfield ) %]Modify Z39.50 server [% searchfield %][% ELSE %]New Z39.50 server[% END %][% END %]
4 [% IF ( delete_confirm ) %]Z39.50 servers &rsaquo; Confirm deletion[% END %]
5 [% IF ( confirm_add ) %] Z39.50 servers &rsaquo; Z39.50 server added[% END %]
6 [% IF ( confirm_update ) %] Z39.50 servers &rsaquo; Z39.50 server updated[% END %]
7 [% IF ( delete_confirmed ) %]Z39.50 servers &rsaquo; Z39.50 server deleted[% END %]</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% IF ( else ) %]
10 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
11 [% INCLUDE 'datatables.inc' %]
12 [% END %]
13 [% IF ( add_form ) %]
14 <script type="text/javascript">
15 //<![CDATA[
16     $(document).ready(function(){
17         $( "#serverentry" ).validate({
18             rules: {
19                 searchfield: { required: true },
20                 host: { required: true },
21                 port: {
22                     required: true,
23                     number: true
24                 },
25                 db: { required: true },
26                 rank: { number: true },
27                 timeout: { number: true }
28             }
29         });
30     });
31 //]]>
32 </script>
33 [% END %]
34 [% IF ( else ) %]
35     <script type="text/javascript">
36     //<![CDATA[
37      $(document).ready(function() {
38         [% IF ( loop ) %]$("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
39             "aoColumnDefs": [
40                 { "aTargets": [ 2,3,4,7,8,9,10,11 ], "bSortable": false, "bSearchable": false },
41             ],
42             "iDisplayLength": 20,
43             "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
44             "sPaginationType": "four_button"
45         }));[% END %]
46      });
47     //]]>
48     </script>
49 [% END %]
50
51 </head>
52 <body id="admin_z3950servers" class="admin">
53 [% INCLUDE 'header.inc' %]
54 [% INCLUDE 'z3950-admin-search.inc' %]
55
56 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo; [% IF ( else ) %]Z39.50 servers[% END %]
57 [% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; [% IF ( searchfield ) %]Modify Z39.50 server [% searchfield %][% ELSE %]New Z39.50 server[% END %][% END %]
58 [% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; Confirm deletion[% END %]
59 [% IF ( confirm_add ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; Z39.50 server added[% END %]
60 [% IF ( confirm_update ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; Z39.50 server updated[% END %]
61
62 [% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; Z39.50 server deleted[% END %]</div>
63
64 <div id="doc3" class="yui-t2">
65    
66    <div id="bd">
67         <div id="yui-main">
68         <div class="yui-b">
69
70 [% IF ( add_form ) %]
71        
72         <form action="[% script_name %]" name="Aform" method="post" id="serverentry">
73         <input type="hidden" name="op" value="add_validate" />
74 [% IF ( searchfield ) %]
75                 <h1>Modify Z39.50 server</h1>
76         [% ELSE %]
77                 <h1>New Z39.50 server</h1>
78         [% END %]                
79         <fieldset class="rows">
80         <ol>[% IF ( searchfield ) %]
81                 <li><span class="label">Z39.50 server: </span>        <input type="hidden" name="searchfield" value="[% searchfield %]" />[% searchfield %]</li>
82         [% ELSE %]
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>
84         [% END %]
85
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>
87                 </li>
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>
89                 </li>
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>
91                 </li>
92                 <li><label for="userid">Userid: </label>        <input type="text" name="userid" id="userid" value="[% userid %]" />
93                 </li>
94                 <li><label for="password">Password: </label>    <input type="text" name="password" id="password" value="[% password %]" />
95                 </li>
96                 <li><label for="checked">Checked (searched by default): </label>
97                         [% IF ( checked ) %]
98                                 <input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
99                         [% ELSE %]
100                                 <input type="checkbox" name="checked" id="checked" value="1" />
101                         [% END %]
102                 </li>
103         <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% rank %]" />
104                 </li>   
105                 <li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>   
106 <select name="syntax">
107 [% IF ( syntaxUNIMARC ) %]
108 <option value="UNIMARC" selected="selected">UNIMARC</option>
109 [% ELSE %]
110 <option value="UNIMARC">UNIMARC</option>
111 [% END %]
112 [% IF ( syntaxINTERMARC ) %]
113 <option value="INTERMARC" selected="selected">INTERMARC</option>
114 [% ELSE %]
115 <option value="INTERMARC">INTERMARC</option>
116 [% END %]
117 [% IF ( syntaxCCF ) %]
118 <option value="CCF" selected="selected">CCF</option>
119 [% ELSE %]
120 <option value="CCF">CCF</option>
121 [% END %]
122 [% IF ( syntaxUSMARC ) %]
123 <option value="USMARC" selected="selected">MARC21/USMARC</option>
124 [% ELSE %]
125 <option value="USMARC">MARC21/USMARC</option>
126 [% END %]
127 [% IF ( syntaxUKMARC ) %]
128 <option value="UKMARC" selected="selected">UKMARC</option>
129 [% ELSE %]
130 <option value="UKMARC">UKMARC</option>
131 [% END %]
132 [% IF ( syntaxNORMARC ) %]
133 <option value="NORMARC" selected="selected">NORMARC</option>
134 [% ELSE %]
135 <option value="NORMARC">NORMARC</option>
136 [% END %]
137 [% IF ( syntaxLIBRISMARC ) %]
138 <option value="LIBRISMARC" selected="selected">LIBRISMARC</option>
139 [% ELSE %]
140 <option value="LIBRISMARC">LIBRISMARC</option>
141 [% END %]
142 [% IF ( syntaxDANMARC ) %]
143 <option value="DANMARC" selected="selected">DANMARC</option>
144 [% ELSE %]
145 <option value="DANMARC">DANMARC</option>
146 [% END %]
147 [% IF ( syntaxFINMARC ) %]
148 <option value="FINMARC" selected="selected">FINMARC</option>
149 [% ELSE %]
150 <option value="FINMARC">FINMARC</option>
151 [% END %]
152 [% IF ( syntaxCANMARC ) %]
153 <option value="CANMARC" selected="selected">CANMARC</option>
154 [% ELSE %]
155 <option value="CANMARC">CANMARC</option>
156 [% END %]
157 [% IF ( syntaxSBN ) %]
158 <option value="SBN" selected="selected">SBN</option>
159 [% ELSE %]
160 <option value="SBN">SBN</option>
161 [% END %]
162 [% IF ( syntaxPICAMARC ) %]
163 <option value="PICAMARC" selected="selected">PICAMARC</option>
164 [% ELSE %]
165 <option value="PICAMARC">PICAMARC</option>
166 [% END %]
167 [% IF ( syntaxAUSMARC ) %]
168 <option value="AUSMARC" selected="selected">AUSMARC</option>
169 [% ELSE %]
170 <option value="AUSMARC">AUSMARC</option>
171 [% END %]
172 [% IF ( syntaxIBERMARC ) %]
173 <option value="IBERMARC" selected="selected">IBERMARC</option>
174 [% ELSE %]
175 <option value="IBERMARC">IBERMARC</option>
176 [% END %]
177 [% IF ( syntaxCATMARC ) %]
178 <option value="CATMARC" selected="selected">CATMARC</option>
179 [% ELSE %]
180 <option value="CATMARC">CATMARC</option>
181 [% END %]
182 [% IF ( syntaxMALMARC ) %]
183 <option value="MALMARC" selected="selected">MALMARC</option>
184 [% ELSE %]
185 <option value="MALMARC">MALMARC</option>
186 [% END %]
187 </select>
188 </li>
189
190     <li><label for="encoding">Encoding (z3950 can send<br /> records in various encodings. Choose one): </label>  
191 <select name="encoding">
192 [% FOREACH enc IN [ 'utf8' 'EUC-KR' 'ISO_5426' 'ISO_6937' 'ISO_8859-1' 'MARC-8' ] %]
193     [% IF ( encoding == enc ) %]
194     <option value="[% enc %]" selected="selected">[% enc %]</option>
195     [% ELSE %]
196     <option value="[% enc %]">[% enc %]</option>
197     [% END %]
198 [% END %]
199 </select>
200 </li>
201     <li><label for="timeout">Timeout (0 its like not set): </label>
202         <input type="text" name="timeout" id="timeout" size="4" value="[% timeout %]" /> seconds
203         </li>
204     <li><label for="recordtype">Record type: </label>
205     <select name="recordtype" id="recordtype">
206             [% IF ( recordtypebiblio ) %]
207             <option value="biblio" selected="selected">Bibliographic</option>
208             [% ELSE %]
209                    <option value="biblio">Bibliographic</option>
210             [% END %]
211             [% IF ( recordtypeauthority ) %]
212             <option value="authority" selected="selected">Authority</option>
213             [% ELSE %]
214                    <option value="authority">Authority</option>
215             [% END %]
216         </select>
217     </li>
218 </ol>
219         </fieldset>
220
221         <fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset>
222         </form>
223 [% END %]
224
225 [% IF ( confirm_add ) %]
226 <h3>Z39.50 server added</h3>
227 <form action="[% script_name %]" method="post">
228         <input type="submit" value="OK" />
229         </form>
230 [% END %]
231
232 [% IF ( confirm_update ) %]
233 <h3>Z39.50 server updated</h3>
234 <form action="[% script_name %]" method="post">
235         <input type="submit" value="OK" />
236         </form>
237 [% END %]
238
239 [% IF ( delete_confirm ) %]
240         [% reqsel %]
241 <h3>Confirm deletion of server [% searchfield %]</h3>
242         <ul>
243                 <li><strong>Target: </strong>        [% searchfield %]</li>
244                 <li><strong>Hostname: </strong>[% host %]</li>
245                 <li><strong>Port: </strong>[% port %]</li>
246                 <li><strong>Database: </strong>[% db %]</li>
247                 <li><strong>Userid: </strong>[% userid %]</li>
248                 <li><strong>Password: </strong>[% password %]</li>
249                 <li><strong>Checked: </strong>[% checked %]</li>
250                 <li><strong>Rank: </strong>[% rank %]</li>
251                 <li><strong>Syntax: </strong>[% syntax %]</li>
252                 <li><strong>Encoding: </strong>[% encoding %]</li>
253                 <li><strong>Timeout: </strong>[% timeout %]</li>
254                 <li><strong>Record type: </strong>[% recordtype %]</li>
255         </ul>                <form action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="submit" value="Delete this server" /></form>  <form action="[% script_name %]" method="post"><input type="submit" value="Do not delete" /></form>
256
257
258
259 [% END %]
260
261 [% IF ( delete_confirmed ) %]
262 <h3>Z39.50 server deleted</h3>
263 <form action="[% script_name %]" method="post">
264                 <input type="submit" value="OK" />
265 </form>
266 [% END %]
267
268 [% IF ( else ) %]
269
270 <div id="toolbar" class="btn-toolbar">
271     <a id="newserver" class="btn btn-small" href="/cgi-bin/koha/admin/z3950servers.pl?op=add_form"><i class="icon-plus"></i> New Z39.50 server</a>
272 </div>
273
274 <h3>Z39.50 servers administration</h3>
275
276         [% IF ( searchfield ) %]
277                 You searched for [% searchfield %]
278         [% END %]
279 <table id="serverst">
280                 <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th>&nbsp;</th><th>&nbsp;</th>
281                 </tr></thead>
282                 <tbody>[% FOREACH loo IN loop %]
283                 [% UNLESS ( loop.odd ) %]
284                     <tr class="highlight">
285                 [% ELSE %]
286                     <tr>
287                 [% END %]
288 <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>
289
290 <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td>[% loo.recordtype %]</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>
291                 [% END %]</tbody>
292 </table>
293
294 [% IF ( offsetgtzero ) %]<form action="[% script_name %]" method="get">
295         <input type="hidden" name="offset" value="[% prevpage %]" />
296         <input type="submit" value="&lt;&lt; Previous">
297 </form>[% END %]
298
299 [% IF ( ltcount ) %]<form action="[% script_name %]" method="get">
300         <input type="hidden" name="offset" value="[% nextpage %]" />
301         <input type="submit" value="Next &gt;&gt;" />
302 </form> [% END %]
303  
304
305 [% END %]
306
307 </div>
308 </div>
309 <div class="yui-b">
310 [% INCLUDE 'admin-menu.inc' %]
311 </div>
312 </div>
313 [% INCLUDE 'intranet-bottom.inc' %]