4 [% PROCESS 'i18n.inc' %]
6 [% INCLUDE 'doc-head-open.inc' %]
8 [% IF (server.servertype||type) == 'sru' %]
9 [% SET servertype = "SRU" %]
10 [% ELSIF (server.servertype||type) == 'zed' %]
11 [% SET servertype = "Z39.50" %]
14 <title>[% FILTER collapse %]
16 [% tx("Modify {servertype} server '{servername}'", { servertype = servertype, servername = server.servername }) | html %] ›
17 [% ELSIF op == 'add' %]
18 [% tx("New {servertype} server", { servertype = servertype }) | html %] ›
19 [% ELSIF searchfield %]
20 [% tx("Search results for '{search_keyword}'", { search_keyword = searchfield }) | html %] ›
22 [% t("Z39.50/SRU servers") | html %] ›
23 [% t("Administration") | html %] ›
24 [% t("Koha") | html %]
26 [% INCLUDE 'doc-head-close.inc' %]
29 <body id="admin_z3950servers" class="admin">
30 [% WRAPPER 'header.inc' %]
31 [% INCLUDE 'z3950-admin-search.inc' %]
34 [% WRAPPER 'sub-header.inc' %]
35 [% WRAPPER breadcrumbs %]
36 [% WRAPPER breadcrumb_item %]
37 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
40 [% IF op == 'edit' || op == 'add' || searchfield %]
41 [% WRAPPER breadcrumb_item %]
42 <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a>
47 [% WRAPPER breadcrumb_item bc_active= 1 %]
48 [% tx("Modify {servertype} server '{servername}'", { servertype = servertype, servername = server.servername }) | html %]
51 [% ELSIF op == 'add' %]
52 [% WRAPPER breadcrumb_item bc_active= 1 %]
53 [% tx("New {servertype} server", { servertype = servertype }) | html %]
56 [% ELSIF searchfield %]
57 [% WRAPPER breadcrumb_item bc_active= 1 %]
58 [% tx("Search results for '{search_keyword}'", { search_keyword = searchfield }) | html %]
61 [% WRAPPER breadcrumb_item bc_active= 1 %]
62 <span>Z39.50/SRU servers</span>
65 [% END #/ WRAPPER breadcrumbs %]
66 [% END #/ WRAPPER sub-header.inc %]
68 <div class="main container-fluid">
70 <div class="col-sm-10 col-sm-push-2">
74 <div class="dialog alert">Z39.50/SRU server deleted ([% msg_add | html %])</div>
75 [% ELSIF msg_updated %]
76 <div class="dialog message">Z39.50/SRU server updated ([% msg_add | html %])</div>
78 <div class="dialog message">Z39.50/SRU server added ([% msg_add | html %])</div>
79 [% ELSIF msg_notfound %]
80 <div class="dialog alert">Error: Server with ID [% msg_add | html %] not found</div>
84 <form action="[% script_name | html %]" name="Aform" method="post" id="serverentry">
86 <h1>[% tx("Modify {servertype} server '{servername}'", { servertype = servertype, servername = server.servername }) | html %]</h1>
87 <input type="hidden" name="id" value="[% server.id | html %]" />
89 <h1>[% tx("New {servertype} server", { servertype = servertype }) | html %]</h1>
92 <input type="hidden" name="op" value="add_validated" />
93 <input type="hidden" name="servertype" value="[% server.servertype||type||'zed' | html %]"/>
94 <fieldset class="rows">
96 <li><label for="name" class="required">Server name: </label>
97 [% IF server.servername %]
98 <input type="text" name="servername" id="servername" size="65" maxlength="100" value="[% server.servername | html %]" required="required" />
100 <input type="text" name="servername" id="servername" class="focus" size="65" maxlength="100" value="[% server.servername | html %]" required="required" />
102 <span class="required">Required</span>
105 <li><label for="host" class="required">Hostname: </label> <input type="text" name="host" id="host" size="30" value="[% server.host | html %]" required="required" /> <span class="required">Required</span>
106 [% IF (server.servertype||type) == 'sru' %]
107 <div class="hint">Includes the domain part, but the path part of the URL should go into Database.</div>
110 <li><label for="port" class="required">Port: </label> <input type="text" name="port" id="port" size="5" value="[% server.port | html %]" required="required" /> <span class="required">Required</span>
112 <li><label for="db" class="required">Database: </label> <input type="text" name="db" id="db" value="[% server.db | html %]" required="required" /> <span class="required">Required</span>
114 <li><label for="userid">Userid: </label> <input type="text" name="userid" id="userid" value="[% server.userid | html %]" />
116 <li><label for="password">Password: </label> <input type="text" name="password" id="password" value="[% server.password | html %]" />
119 <label for="checked">Preselected: </label>
120 [% IF ( server.checked ) %]
121 <input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
123 <input type="checkbox" name="checked" id="checked" value="1" />
125 <span class="hint">Searched by default.</span>
128 <label for="rank">Rank: </label>
129 <input type="text" name="rank" id="rank" size="4" value="[% server.rank | html %]" />
130 <div class="hint">Display order.</div>
132 [% IF (server.servertype||type) == 'zed' %]
134 <label for="attributes">Attributes: </label>
135 <input type="text" name="attributes" id="attributes" size="30" value="[% server.attributes | html %]" />
136 <div class="hint">Additional PQF attributes added to each query.</div>
141 <label for="syntax">Syntax: </label>
142 <select name="syntax" id="syntax">
143 <option value="UNIMARC">UNIMARC</option>
144 <option value="INTERMARC">INTERMARC</option>
145 <option value="CCF">CCF</option>
146 <option value="USMARC">MARC21/USMARC</option>
147 <option value="UKMARC">UKMARC</option>
148 <option value="NORMARC">NORMARC</option>
149 <option value="LIBRISMARC">LIBRISMARC</option>
150 <option value="DANMARC">DANMARC</option>
151 <option value="FINMARC">FINMARC</option>
152 <option value="CANMARC">CANMARC</option>
153 <option value="SBN">SBN</option>
154 <option value="PICAMARC">PICAMARC</option>
155 <option value="AUSMARC">AUSMARC</option>
156 <option value="IBERMARC">IBERMARC</option>
157 <option value="CATMARC">CATMARC</option>
158 <option value="MALMARC">MALMARC</option>
160 <div class="hint">Z39.50 can send records in various formats. Choose one.</div>
164 <label for="encoding">Encoding: </label>
165 <select name="encoding" id="encoding">
166 [% FOREACH enc IN [ 'utf8' 'EUC-KR' 'ISO_5426' 'ISO_6937' 'ISO_8859-1' 'MARC-8' ] %]
167 <option value="[% enc | html %]">[% enc | html %]</option>
170 <div class="hint">Z39.50 can send records in various encodings. Choose one.</div>
174 <label for="timeout">Timeout: </label>
175 <input type="text" name="timeout" id="timeout" size="4" value="[% server.timeout | html %]" /> seconds
176 <div class="hint">Enter 0 to disable.</div>
178 <li><label for="recordtype">Record type: </label>
179 <select name="recordtype" id="recordtype">
180 <option value="biblio">Bibliographic</option>
181 <option value="authority">Authority</option>
184 [% IF (server.servertype||type) == 'sru' %]
186 <label for="sru_options">Additional SRU options: </label>
187 <input type="text" name="sru_options" id="sru_options" size="50" value="[% server.sru_options | html %]"/>
188 <div class="hint">Separate options by commas. Example: sru=get,sru_version=1.1. See also http://www.indexdata.com/yaz/doc/zoom.html.</div>
191 <label for="sru_fields">SRU Search fields mapping: </label>
192 <input type="hidden" name="sru_fields" id="sru_fields" value="[% server.sru_fields | html %]" />
193 <input type="text" name="show_sru_fields" id="show_sru_fields" size="100" value="[% server.sru_fields | html %]" disabled="disabled" /> <input type="button" id="modify_sru_fields" value="Modify" />
197 <label for="add_xslt">XSLT File(s) for transforming results: </label>
198 <input type="text" name="add_xslt" id="add_xslt" size="100" value="[% server.add_xslt | html %]"/>
199 <div class="hint">Separate multiple filenames by commas.</div>
205 <fieldset class="action"><input type="submit" class="btn btn-primary" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset>
209 [% IF op == 'list' %]
210 <div id="toolbar" class="btn-toolbar">
211 <a id="newserver" class="btn btn-default" href="/cgi-bin/koha/admin/z3950servers.pl?op=add&type=zed"><i class="fa fa-plus"></i> New Z39.50 server</a>
212 <a id="newserver" class="btn btn-default" href="/cgi-bin/koha/admin/z3950servers.pl?op=add&type=sru"><i class="fa fa-plus"></i> New SRU server</a>
214 <h1>Z39.50/SRU servers</h1>
217 [% tx("Searching by target starting with '{search_keyword}'", { search_keyword = searchfield }) | html %]
221 <div class="page-section">
222 <table id="serverst">
224 <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Preselected</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>Record type</th><th>Attributes</th><th class="noExport">Actions</th>
227 [% FOREACH loo IN loop %]
229 <td><a href="/cgi-bin/koha/admin/z3950servers.pl?op=edit&id=[% loo.id | uri %]">[% loo.servername | html %]</a></td><td>[% loo.host | html %]:[% loo.port | html %]</td><td>[% loo.db | html %]</td><td>[% loo.userid | html %]</td><td>[% IF loo.password %]########[% END %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank | html %]</td>
230 <td>[% loo.syntax | html %]</td><td>[% loo.encoding | html %]</td><td>[% loo.timeout | html %]</td>
231 <td>[% IF ( loo.recordtype == 'biblio' ) %]
232 <span>Bibliographic</span>
233 [% ELSIF ( loo.recordtype == 'authority' ) %]
234 <span>Authority</span>
237 <td>[% loo.attributes | html %]</td>
239 <div class="btn-group dropup">
240 <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-toggle="dropdown" href="#">
241 Actions <b class="caret"></b>
243 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id | html %]">
244 <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=edit&id=[% loo.id | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a></li>
245 <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=add&id=[% loo.id | uri %]"><i class="fa fa-copy"></i> Copy</a></li>
246 <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=delete_confirmed&id=[% loo.id | uri %]" class="delete" data-servername="[% loo.servername | html %]"><i class="fa fa-trash-can"></i> Delete</a></li>
254 </div> <!-- /.page-section -->
258 </div> <!-- /.col-sm-10.col-sm-push-2 -->
260 <div class="col-sm-2 col-sm-pull-10">
262 [% INCLUDE 'admin-menu.inc' %]
264 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
265 </div> <!-- /.row -->
267 [% MACRO jsinclude BLOCK %]
268 [% Asset.js("js/admin-menu.js") | $raw %]
269 [% IF op == 'list' %]
270 [% INCLUDE 'datatables.inc' %]
274 [% IF ( add_form ) %]
275 $(document).ready(function(){
276 // Update selects for syntax, encoding and recordtype
278 $("#syntax").val('[% server.syntax | html %]');
279 $("#encoding").val('[% server.encoding | html %]');
280 $("#recordtype").val('[% server.recordtype | html %]');
282 $( "#serverentry" ).validate({
284 servername: { required: true },
285 host: { required: true },
290 db: { required: true },
291 rank: { number: true },
292 timeout: { number: true }
295 $("#serverentry").submit(function( event ) {
296 // first test if show_sru_fields exists
297 if( $('#show_sru_fields').length && $('#show_sru_fields').val()=='' && !confirm( _("No SRU search field mappings have been defined. This means that all field searches will go through the whole record. Continue?"))) {
300 // copy show_sru_fields to hidden counterpart
301 $('#sru_fields').val( $('#show_sru_fields').val() );
302 // enable recordtype to include field in post
303 $('#recordtype').prop('disabled',false);
305 $("#servername").on("blur",function(){
308 $("#modify_sru_fields").on("click",function(){
312 function ModMapping () {
313 var map= $('#show_sru_fields').val();
314 var type= $('#recordtype').val();
315 window.open('/cgi-bin/koha/admin/sru_modmapping.pl?mapping='+map + '&type=' + type,'popup','width=800,height=400,resizable=yes,toolbar=false,scrollbars=yes,top');
318 $(document).ready(function() {
319 $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
321 { "targets": [-1], "orderable": false, "searchable": false },
325 $(".delete").on("click",function(e){
326 var servername = $(this).data("servername");
327 if( confirm( _("Are you sure you want to delete server %s?").format(servername) ) ) {
337 [% INCLUDE 'intranet-bottom.inc' %]