4 [% INCLUDE 'doc-head-open.inc' %]
7 [% IF (server.servertype||type) == 'sru' %]
9 [% ELSIF (server.servertype||type) == 'zed' %]
16 Modify [% PROCESS ServerType %] server [% server.servername | html %] › [% END %]
19 New [% PROCESS ServerType %] 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 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
35 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
38 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
43 <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a>
46 <a href="#" aria-current="page">
47 Modify [% PROCESS ServerType %] server [% server.servername | html %]
51 [% ELSIF op == 'add' %]
53 <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a>
56 <a href="#" aria-current="page">
57 New [% PROCESS ServerType %] server
63 <a href="#" aria-current="page">
73 <div class="main container-fluid">
75 <div class="col-sm-10 col-sm-push-2">
79 <div class="dialog alert">Z39.50/SRU server deleted ([% msg_add | html %])</div>
80 [% ELSIF msg_updated %]
81 <div class="dialog message">Z39.50/SRU server updated ([% msg_add | html %])</div>
83 <div class="dialog message">Z39.50/SRU server added ([% msg_add | html %])</div>
84 [% ELSIF msg_notfound %]
85 <div class="dialog alert">Error: Server with id [% msg_add | html %] not found</div>
89 <form action="[% script_name | html %]" name="Aform" method="post" id="serverentry">
90 <input type="hidden" name="op" value="add_validated" />
91 <input type="hidden" name="servertype" value="[% server.servertype||type||'zed' | html %]"/>
93 <h1>Modify [% PROCESS ServerType %] server</h1>
94 <input type="hidden" name="id" value="[% server.id | html %]" />
96 <h1>New [% PROCESS ServerType %] server</h1>
98 <fieldset class="rows">
100 <li><label for="name" class="required">Server name: </label>
101 <input type="text" name="servername" id="servername" size="65" maxlength="100" value="[% server.servername | html %]" required="required" /> <span class="required">Required</span>
104 <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>
105 [% IF (server.servertype||type) == 'sru' %]
106 <div class="hint">Includes the domain part, but the path part of the URL should go into Database.</div>
109 <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>
111 <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>
113 <li><label for="userid">Userid: </label> <input type="text" name="userid" id="userid" value="[% server.userid | html %]" />
115 <li><label for="password">Password: </label> <input type="text" name="password" id="password" value="[% server.password | html %]" />
118 <label for="checked">Preselected: </label>
119 [% IF ( server.checked ) %]
120 <input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
122 <input type="checkbox" name="checked" id="checked" value="1" />
124 <span class="hint">Searched by default.</span>
127 <label for="rank">Rank: </label>
128 <input type="text" name="rank" id="rank" size="4" value="[% server.rank | html %]" />
129 <div class="hint">Display order.</div>
131 [% IF (server.servertype||type) == 'zed' %]
133 <label for="attributes">Attributes: </label>
134 <input type="text" name="attributes" id="attributes" size="30" value="[% server.attributes | html %]" />
135 <div class="hint">Additional PQF attributes added to each query.</div>
140 <label for="syntax">Syntax: </label>
141 <select name="syntax" id="syntax">
142 <option value="UNIMARC">UNIMARC</option>
143 <option value="INTERMARC">INTERMARC</option>
144 <option value="CCF">CCF</option>
145 <option value="USMARC">MARC21/USMARC</option>
146 <option value="UKMARC">UKMARC</option>
147 <option value="NORMARC">NORMARC</option>
148 <option value="LIBRISMARC">LIBRISMARC</option>
149 <option value="DANMARC">DANMARC</option>
150 <option value="FINMARC">FINMARC</option>
151 <option value="CANMARC">CANMARC</option>
152 <option value="SBN">SBN</option>
153 <option value="PICAMARC">PICAMARC</option>
154 <option value="AUSMARC">AUSMARC</option>
155 <option value="IBERMARC">IBERMARC</option>
156 <option value="CATMARC">CATMARC</option>
157 <option value="MALMARC">MALMARC</option>
159 <div class="hint">Z39.50 can send records in various formats. Choose one.</div>
163 <label for="encoding">Encoding: </label>
164 <select name="encoding" id="encoding">
165 [% FOREACH enc IN [ 'utf8' 'EUC-KR' 'ISO_5426' 'ISO_6937' 'ISO_8859-1' 'MARC-8' ] %]
166 <option value="[% enc | html %]">[% enc | html %]</option>
169 <div class="hint">Z39.50 can send records in various encodings. Choose one.</div>
173 <label for="timeout">Timeout: </label>
174 <input type="text" name="timeout" id="timeout" size="4" value="[% server.timeout | html %]" /> seconds
175 <div class="hint">Enter 0 to disable.</div>
177 <li><label for="recordtype">Record type: </label>
178 <select name="recordtype" id="recordtype">
179 <option value="biblio">Bibliographic</option>
180 <option value="authority">Authority</option>
183 [% IF (server.servertype||type) == 'sru' %]
185 <label for="sru_options">Additional SRU options: </label>
186 <input type="text" name="sru_options" id="sru_options" size="50" value="[% server.sru_options | html %]"/>
187 <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>
190 <label for="sru_fields">SRU Search fields mapping: </label>
191 <input type="hidden" name="sru_fields" id="sru_fields" value="[% server.sru_fields | html %]" />
192 <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" />
196 <label for="add_xslt">XSLT File(s) for transforming results: </label>
197 <input type="text" name="add_xslt" id="add_xslt" size="100" value="[% server.add_xslt | html %]"/>
198 <div class="hint">Separate multiple filenames by commas.</div>
204 <fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset>
208 [% IF op == 'list' %]
209 <div id="toolbar" class="btn-toolbar">
210 <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>
211 <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>
213 <h1>Z39.50/SRU servers administration</h1>
215 You searched for record [% id | html %]
216 [% ELSIF searchfield %]
217 You searched for [% searchfield | html %]
220 <div class="page-section">
221 <table id="serverst">
223 <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>
226 [% FOREACH loo IN loop %]
228 <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>
229 <td>[% loo.syntax | html %]</td><td>[% loo.encoding | html %]</td><td>[% loo.timeout | html %]</td>
230 <td>[% IF ( loo.recordtype == 'biblio' ) %]
231 <span>Bibliographic</span>
232 [% ELSIF ( loo.recordtype == 'authority' ) %]
233 <span>Authority</span>
236 <td>[% loo.attributes | html %]</td>
238 <div class="btn-group dropup">
239 <a class="btn btn-default btn-xs dropdown-toggle" id="reportactions[% savedreport.id | html %]" role="button" data-toggle="dropdown" href="#">
240 Actions <b class="caret"></b>
242 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id | html %]">
243 <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=edit&id=[% loo.id | uri %]"><i class="fa fa-pencil"></i> Edit</a></li>
244 <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=add&id=[% loo.id | uri %]"><i class="fa fa-copy"></i> Copy</a></li>
245 <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>
253 </div> <!-- /.page-section -->
257 </div> <!-- /.col-sm-10.col-sm-push-2 -->
259 <div class="col-sm-2 col-sm-pull-10">
261 [% INCLUDE 'admin-menu.inc' %]
263 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
264 </div> <!-- /.row -->
266 [% MACRO jsinclude BLOCK %]
267 [% Asset.js("js/admin-menu.js") | $raw %]
268 [% IF op == 'list' %]
269 [% INCLUDE 'datatables.inc' %]
273 [% IF ( add_form ) %]
274 $(document).ready(function(){
275 // Update selects for syntax, encoding and recordtype
277 $("#syntax").val('[% server.syntax | html %]');
278 $("#encoding").val('[% server.encoding | html %]');
279 $("#recordtype").val('[% server.recordtype | html %]');
281 $( "#serverentry" ).validate({
283 servername: { required: true },
284 host: { required: true },
289 db: { required: true },
290 rank: { number: true },
291 timeout: { number: true }
294 $("#serverentry").submit(function( event ) {
295 // first test if show_sru_fields exists
296 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?"))) {
299 // copy show_sru_fields to hidden counterpart
300 $('#sru_fields').val( $('#show_sru_fields').val() );
301 // enable recordtype to include field in post
302 $('#recordtype').prop('disabled',false);
304 $("#servername").on("blur",function(){
307 $("#modify_sru_fields").on("click",function(){
311 function ModMapping () {
312 var map= $('#show_sru_fields').val();
313 var type= $('#recordtype').val();
314 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');
317 $(document).ready(function() {
318 $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
320 { "aTargets": [-1], "bSortable": false, "bSearchable": false },
322 "sPaginationType": "full"
324 $(".delete").on("click",function(e){
325 var servername = $(this).data("servername");
326 if( confirm( _("Are you sure you want to delete server %s?").format(servername) ) ) {
336 [% INCLUDE 'intranet-bottom.inc' %]