Bug 12265: [QA Follow-up] Replace DBIx search by find
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / z3950servers.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Administration &rsaquo; Z39.50 servers
3 [% IF op == 'edit' %] &rsaquo; Modify Z39.50 server [% server.name %][% END %]
4 [% IF op ==  'add' %] &rsaquo; New Z39.50 server[% END %]
5 </title>
6 [% INCLUDE 'doc-head-close.inc' %]
7
8 [% IF op == 'list' %]
9     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
10     [% INCLUDE 'datatables.inc' %]
11 [% END %]
12
13 <script type="text/javascript">
14 //<![CDATA[
15 [% IF ( add_form ) %]
16     $(document).ready(function(){
17         // Update selects for syntax, encoding and recordtype
18         [% IF server %]
19             $("#syntax").val('[% server.syntax %]');
20             $("#encoding").val('[% server.encoding %]');
21             $("#recordtype").val('[% server.recordtype %]');
22         [% END %]
23         $( "#serverentry" ).validate({
24             rules: {
25                 servername: { required: true },
26                 host: { required: true },
27                 port: {
28                     required: true,
29                     number: true
30                 },
31                 db: { required: true },
32                 rank: { number: true },
33                 timeout: { number: true }
34             }
35         });
36     });
37 [% ELSE %]
38     $(document).ready(function() {
39         $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
40             "aoColumnDefs": [
41                 { "aTargets": [2,3,4,7,8,9,10,11], "bSortable": false, "bSearchable": false },
42             ],
43             "sPaginationType": "four_button"
44         }));
45     });
46     function ConfirmDelete(name,id) {
47         if( confirm( _("Choose OK if you really want to delete server ")+
48           name+'.')) {
49             window.location="[% script_name %]?op=delete_confirmed&id="+id;
50         }
51         return false;
52     }
53 [% END %]
54 //]]>
55 </script>
56
57 </head>
58 <body id="admin_z3950servers" class="admin">
59 [% INCLUDE 'header.inc' %]
60 [% INCLUDE 'z3950-admin-search.inc' %]
61
62 <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;
63 <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a>
64 [% IF op == 'edit' %]&rsaquo; Modify Z39.50 server [% server.name %][% END %]
65 [% IF op ==  'add' %]&rsaquo; New Z39.50 server[% END %]
66 </div>
67
68 <div id="doc3" class="yui-t2">
69 <div id="bd">
70 <div id="yui-main">
71 <div class="yui-b">
72
73 [% IF msg_deleted %]
74     <div class="dialog alert">Z39.50 server deleted ([% msg_add %])</div>
75 [% ELSIF msg_updated %]
76     <div class="dialog alert">Z39.50 server updated ([% msg_add %])</div>
77 [% ELSIF msg_added %]
78     <div class="dialog alert">Z39.50 server added ([% msg_add %])</div>
79 [% ELSIF msg_notfound %]
80     <div class="dialog alert">Error: Server with id [% msg_add %] not found</div>
81 [% END %]
82
83 [% IF ( add_form ) %]
84     <form action="[% script_name %]" name="Aform" method="post" id="serverentry">
85         <input type="hidden" name="op" value="add_validated" />
86         [% IF op == 'edit' %]
87             <h1>Modify Z39.50 server</h1>
88             <input type="hidden" name="id" value="[% server.id %]" />
89         [% ELSE %]
90             <h1>New Z39.50 server</h1>
91         [% END %]                
92         <fieldset class="rows">
93         <ol>
94         <li><label for="name" class="required">Z39.50 server: </label><input type="text" name="servername" id="servername" size="65" maxlength="100" onblur="toUC(this)" value="[% server.name | html %]" required="required"/> <span class="required">Required</span></li>
95
96         <li><label for="host" class="required">Hostname: </label> <input type="text" name="host" id="host" size="30" value="[% server.host %]" required="required" /> <span class="required">Required</span>
97         </li>
98         <li><label for="port" class="required">Port: </label> <input type="text" name="port" id="port" size="5" value="[% server.port %]" required="required" /> <span class="required">Required</span>
99         </li>
100         <li><label for="db" class="required">Database: </label> <input type="text" name="db" id="db" value="[% server.db %]" required="required" /> <span class="required">Required</span>
101         </li>
102         <li><label for="userid">Userid: </label> <input type="text" name="userid" id="userid" value="[% server.userid %]" />
103         </li>
104         <li><label for="password">Password: </label> <input type="text" name="password" id="password" value="[% server.password %]" />
105         </li>
106         <li><label for="checked">Checked (searched by default): </label>
107         [% IF ( server.checked ) %]
108             <input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
109         [% ELSE %]
110             <input type="checkbox" name="checked" id="checked" value="1" />
111         [% END %]
112         </li>
113         <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
114         </li>
115
116         <li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>
117         <select name="syntax" id="syntax">
118             <option value="UNIMARC">UNIMARC</option>
119             <option value="INTERMARC">INTERMARC</option>
120             <option value="CCF">CCF</option>
121             <option value="USMARC">MARC21/USMARC</option>
122             <option value="UKMARC">UKMARC</option>
123             <option value="NORMARC">NORMARC</option>
124             <option value="LIBRISMARC">LIBRISMARC</option>
125             <option value="DANMARC">DANMARC</option>
126             <option value="FINMARC">FINMARC</option>
127             <option value="CANMARC">CANMARC</option>
128             <option value="SBN">SBN</option>
129             <option value="PICAMARC">PICAMARC</option>
130             <option value="AUSMARC">AUSMARC</option>
131             <option value="IBERMARC">IBERMARC</option>
132             <option value="CATMARC">CATMARC</option>
133             <option value="MALMARC">MALMARC</option>
134         </select>
135         </li>
136
137         <li><label for="encoding">Encoding (z3950 can send<br /> records in various encodings. Choose one): </label>
138         <select name="encoding" id="encoding">
139             [% FOREACH enc IN [ 'utf8' 'EUC-KR' 'ISO_5426' 'ISO_6937' 'ISO_8859-1' 'MARC-8' ] %]
140                 <option value="[% enc %]">[% enc %]</option>
141             [% END %]
142         </select>
143         </li>
144
145         <li><label for="timeout">Timeout (0 its like not set): </label>
146         <input type="text" name="timeout" id="timeout" size="4" value="[% server.timeout %]" /> seconds
147         </li>
148         <li><label for="recordtype">Record type: </label>
149         <select name="recordtype" id="recordtype">
150             <option value="biblio">Bibliographic</option>
151             <option value="authority">Authority</option>
152         </select>
153         </li>
154         </ol>
155         </fieldset>
156
157         <fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset>
158     </form>
159 [% END %]
160
161 [% IF op == 'list' %]
162     <div id="toolbar" class="btn-toolbar">
163         <a id="newserver" class="btn btn-small" href="/cgi-bin/koha/admin/z3950servers.pl?op=add"><i class="icon-plus"></i> New Z39.50 server</a>
164     </div>
165     <h3>Z39.50 servers administration</h3>
166     [% IF id %]
167         You searched for record [% id %]
168     [% ELSIF searchfield %]
169         You searched for [% searchfield %]
170     [% END %]
171     <table id="serverst">
172         <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>Options</th>
173         </tr></thead>
174         <tbody>
175         [% FOREACH loo IN loop %]
176             [% UNLESS ( loop.odd ) %]
177                 <tr class="highlight">
178             [% ELSE %]
179                 <tr>
180             [% END %]
181             <td><a href="[% loo.script_name %]?op=edit&amp;id=[% loo.id %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% IF loo.password %]########[% END %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td>
182 <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td>[% loo.recordtype %]</td>
183             <td><a href="[% loo.script_name %]?op=edit&amp;id=[% loo.id %]">Edit</a> <a href="[% loo.script_name %]?op=add&amp;id=[% loo.id %]">Copy</a> <a href="javascript:void(0);" onclick="ConfirmDelete('[% loo.name | replace("['\"]","") %]','[% loo.id %]');">Delete</a></td>
184             </tr>
185         [% END %]
186         </tbody>
187     </table>
188 [% END %]
189
190 </div>
191 </div>
192 <div class="yui-b">
193 [% INCLUDE 'admin-menu.inc' %]
194 </div>
195 </div>
196 [% INCLUDE 'intranet-bottom.inc' %]