4 [% INCLUDE 'doc-head-open.inc' %]
7 [% IF (server.servertype||type) == 'sru' %]
9 [% ELSIF (server.servertype||type) == 'zed' %]
16 Modify [% PROCESS ServerType | remove("</*span>") %] server [% server.servername | html %] › [% END %]
19 New [% PROCESS ServerType | remove("</*span>") %] server › [% END %]
21 Z39.50/SRU servers › Administration › Koha
23 [% INCLUDE 'doc-head-close.inc' %]
26 <body id="admin_z3950servers" class="admin">
27 [% WRAPPER 'header.inc' %]
28 [% INCLUDE 'z3950-admin-search.inc' %]
31 [% WRAPPER 'sub-header.inc' %]
32 [% WRAPPER breadcrumbs %]
33 [% WRAPPER breadcrumb_item %]
34 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
37 [% IF op == 'edit' || op == 'add' %]
38 [% WRAPPER breadcrumb_item %]
39 <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a>
44 [% WRAPPER breadcrumb_item bc_active= 1 %]
45 <span>Modify [% PROCESS ServerType %] server [% server.servername | html %]</span>
48 [% ELSIF op == 'add' %]
49 [% WRAPPER breadcrumb_item bc_active= 1 %]
50 <span>New [% PROCESS ServerType %] server</span>
54 [% WRAPPER breadcrumb_item bc_active= 1 %]
55 <span>Z39.50/SRU servers</span>
58 [% END #/ WRAPPER breadcrumbs %]
59 [% END #/ WRAPPER sub-header.inc %]
61 <div class="main container-fluid">
63 <div class="col-sm-10 col-sm-push-2">
67 <div class="dialog alert">Z39.50/SRU server deleted ([% msg_add | html %])</div>
68 [% ELSIF msg_updated %]
69 <div class="dialog message">Z39.50/SRU server updated ([% msg_add | html %])</div>
71 <div class="dialog message">Z39.50/SRU server added ([% msg_add | html %])</div>
72 [% ELSIF msg_notfound %]
73 <div class="dialog alert">Error: Server with ID [% msg_add | html %] not found</div>
77 <form action="[% script_name | html %]" name="Aform" method="post" id="serverentry">
78 <input type="hidden" name="op" value="add_validated" />
79 <input type="hidden" name="servertype" value="[% server.servertype||type||'zed' | html %]"/>
81 <h1>Modify [% PROCESS ServerType %] server</h1>
82 <input type="hidden" name="id" value="[% server.id | html %]" />
84 <h1>New [% PROCESS ServerType %] server</h1>
86 <fieldset class="rows">
88 <li><label for="name" class="required">Server name: </label>
89 [% IF server.servername %]
90 <input type="text" name="servername" id="servername" size="65" maxlength="100" value="[% server.servername | html %]" required="required" />
92 <input type="text" name="servername" id="servername" class="focus" size="65" maxlength="100" value="[% server.servername | html %]" required="required" />
94 <span class="required">Required</span>
97 <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>
98 [% IF (server.servertype||type) == 'sru' %]
99 <div class="hint">Includes the domain part, but the path part of the URL should go into Database.</div>
102 <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>
104 <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>
106 <li><label for="userid">Userid: </label> <input type="text" name="userid" id="userid" value="[% server.userid | html %]" />
108 <li><label for="password">Password: </label> <input type="text" name="password" id="password" value="[% server.password | html %]" />
111 <label for="checked">Preselected: </label>
112 [% IF ( server.checked ) %]
113 <input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
115 <input type="checkbox" name="checked" id="checked" value="1" />
117 <span class="hint">Searched by default.</span>
120 <label for="rank">Rank: </label>
121 <input type="text" name="rank" id="rank" size="4" value="[% server.rank | html %]" />
122 <div class="hint">Display order.</div>
124 [% IF (server.servertype||type) == 'zed' %]
126 <label for="attributes">Attributes: </label>
127 <input type="text" name="attributes" id="attributes" size="30" value="[% server.attributes | html %]" />
128 <div class="hint">Additional PQF attributes added to each query.</div>
133 <label for="syntax">Syntax: </label>
134 <select name="syntax" id="syntax">
135 <option value="UNIMARC">UNIMARC</option>
136 <option value="INTERMARC">INTERMARC</option>
137 <option value="CCF">CCF</option>
138 <option value="USMARC">MARC21/USMARC</option>
139 <option value="UKMARC">UKMARC</option>
140 <option value="NORMARC">NORMARC</option>
141 <option value="LIBRISMARC">LIBRISMARC</option>
142 <option value="DANMARC">DANMARC</option>
143 <option value="FINMARC">FINMARC</option>
144 <option value="CANMARC">CANMARC</option>
145 <option value="SBN">SBN</option>
146 <option value="PICAMARC">PICAMARC</option>
147 <option value="AUSMARC">AUSMARC</option>
148 <option value="IBERMARC">IBERMARC</option>
149 <option value="CATMARC">CATMARC</option>
150 <option value="MALMARC">MALMARC</option>
152 <div class="hint">Z39.50 can send records in various formats. Choose one.</div>
156 <label for="encoding">Encoding: </label>
157 <select name="encoding" id="encoding">
158 [% FOREACH enc IN [ 'utf8' 'EUC-KR' 'ISO_5426' 'ISO_6937' 'ISO_8859-1' 'MARC-8' ] %]
159 <option value="[% enc | html %]">[% enc | html %]</option>
162 <div class="hint">Z39.50 can send records in various encodings. Choose one.</div>
166 <label for="timeout">Timeout: </label>
167 <input type="text" name="timeout" id="timeout" size="4" value="[% server.timeout | html %]" /> seconds
168 <div class="hint">Enter 0 to disable.</div>
170 <li><label for="recordtype">Record type: </label>
171 <select name="recordtype" id="recordtype">
172 <option value="biblio">Bibliographic</option>
173 <option value="authority">Authority</option>
176 [% IF (server.servertype||type) == 'sru' %]
178 <label for="sru_options">Additional SRU options: </label>
179 <input type="text" name="sru_options" id="sru_options" size="50" value="[% server.sru_options | html %]"/>
180 <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>
183 <label for="sru_fields">SRU Search fields mapping: </label>
184 <input type="hidden" name="sru_fields" id="sru_fields" value="[% server.sru_fields | html %]" />
185 <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" />
189 <label for="add_xslt">XSLT File(s) for transforming results: </label>
190 <input type="text" name="add_xslt" id="add_xslt" size="100" value="[% server.add_xslt | html %]"/>
191 <div class="hint">Separate multiple filenames by commas.</div>
197 <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>
201 [% IF op == 'list' %]
202 <div id="toolbar" class="btn-toolbar">
203 <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>
204 <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>
206 <h1>Z39.50/SRU servers administration</h1>
208 You searched for record [% id | html %]
209 [% ELSIF searchfield %]
210 You searched for [% searchfield | html %]
213 <div class="page-section">
214 <table id="serverst">
216 <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>
219 [% FOREACH loo IN loop %]
221 <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>
222 <td>[% loo.syntax | html %]</td><td>[% loo.encoding | html %]</td><td>[% loo.timeout | html %]</td>
223 <td>[% IF ( loo.recordtype == 'biblio' ) %]
224 <span>Bibliographic</span>
225 [% ELSIF ( loo.recordtype == 'authority' ) %]
226 <span>Authority</span>
229 <td>[% loo.attributes | html %]</td>
231 <div class="btn-group dropup">
232 <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-toggle="dropdown" href="#">
233 Actions <b class="caret"></b>
235 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id | html %]">
236 <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=edit&id=[% loo.id | uri %]"><i class="fa fa-pencil"></i> Edit</a></li>
237 <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=add&id=[% loo.id | uri %]"><i class="fa fa-copy"></i> Copy</a></li>
238 <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"></i> Delete</a></li>
246 </div> <!-- /.page-section -->
250 </div> <!-- /.col-sm-10.col-sm-push-2 -->
252 <div class="col-sm-2 col-sm-pull-10">
254 [% INCLUDE 'admin-menu.inc' %]
256 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
257 </div> <!-- /.row -->
259 [% MACRO jsinclude BLOCK %]
260 [% Asset.js("js/admin-menu.js") | $raw %]
261 [% IF op == 'list' %]
262 [% INCLUDE 'datatables.inc' %]
266 [% IF ( add_form ) %]
267 $(document).ready(function(){
268 // Update selects for syntax, encoding and recordtype
270 $("#syntax").val('[% server.syntax | html %]');
271 $("#encoding").val('[% server.encoding | html %]');
272 $("#recordtype").val('[% server.recordtype | html %]');
274 $( "#serverentry" ).validate({
276 servername: { required: true },
277 host: { required: true },
282 db: { required: true },
283 rank: { number: true },
284 timeout: { number: true }
287 $("#serverentry").submit(function( event ) {
288 // first test if show_sru_fields exists
289 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?"))) {
292 // copy show_sru_fields to hidden counterpart
293 $('#sru_fields').val( $('#show_sru_fields').val() );
294 // enable recordtype to include field in post
295 $('#recordtype').prop('disabled',false);
297 $("#servername").on("blur",function(){
300 $("#modify_sru_fields").on("click",function(){
304 function ModMapping () {
305 var map= $('#show_sru_fields').val();
306 var type= $('#recordtype').val();
307 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');
310 $(document).ready(function() {
311 $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
313 { "aTargets": [-1], "bSortable": false, "bSearchable": false },
315 "sPaginationType": "full"
317 $(".delete").on("click",function(e){
318 var servername = $(this).data("servername");
319 if( confirm( _("Are you sure you want to delete server %s?").format(servername) ) ) {
329 [% INCLUDE 'intranet-bottom.inc' %]