1 [% INCLUDE 'doc-head-open.inc' %]
4 [% IF (server.servertype||type) == 'sru' %]
6 [% ELSIF (server.servertype||type) == 'zed' %]
11 <title>Koha › Administration › Z39.50/SRU servers
12 [% IF op == 'edit' %] › Modify [% PROCESS ServerType %] server [% server.servername %][% END %]
13 [% IF op == 'add' %] › New [% PROCESS ServerType %] server[% END %]
15 [% INCLUDE 'doc-head-close.inc' %]
18 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
19 [% INCLUDE 'datatables.inc' %]
22 <script type="text/javascript">
25 $(document).ready(function(){
26 // Update selects for syntax, encoding and recordtype
28 $("#syntax").val('[% server.syntax %]');
29 $("#encoding").val('[% server.encoding %]');
30 $("#recordtype").val('[% server.recordtype %]');
32 // Disable recordtype (and default to bib) for non-Z3950 servers until auth is supported
33 [% UNLESS (server.servertype||type) == 'zed' %]
34 $("#recordtype").prop('disabled',true);
36 $( "#serverentry" ).validate({
38 servername: { required: true },
39 host: { required: true },
44 db: { required: true },
45 rank: { number: true },
46 timeout: { number: true }
49 $("#serverentry").submit(function( event ) {
50 // copy show_sru_fields to hidden counterpart
51 $('#sru_fields').val( $('#show_sru_fields').val() );
52 // enable recordtype to include field in post
53 $('#recordtype').prop('disabled',false);
56 function ModMapping () {
57 var map= $('#show_sru_fields').val();
58 window.open('/cgi-bin/koha/admin/sru_modmapping.pl?mapping='+map,'popup','width=800,height=400,resizable=no,toolbar=false,scrollbars=no,top');
61 $(document).ready(function() {
62 $("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
64 { "aTargets": [2,3,4,7,8,9,10,11], "bSortable": false, "bSearchable": false },
66 "sPaginationType": "four_button"
69 function ConfirmDelete(name,id) {
70 if( confirm( _("Choose OK if you really want to delete server ")+
72 window.location="[% script_name %]?op=delete_confirmed&id="+id;
81 <body id="admin_z3950servers" class="admin">
82 [% INCLUDE 'header.inc' %]
83 [% INCLUDE 'z3950-admin-search.inc' %]
85 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> ›
86 <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a>
87 [% IF op == 'edit' %]› Modify [% PROCESS ServerType %] server [% server.servername %][% END %]
88 [% IF op == 'add' %]› New [% PROCESS ServerType %] server[% END %]
91 <div id="doc3" class="yui-t2">
97 <div class="dialog alert">Z39.50/SRU server deleted ([% msg_add %])</div>
98 [% ELSIF msg_updated %]
99 <div class="dialog message">Z39.50/SRU server updated ([% msg_add %])</div>
100 [% ELSIF msg_added %]
101 <div class="dialog message">Z39.50/SRU server added ([% msg_add %])</div>
102 [% ELSIF msg_notfound %]
103 <div class="dialog alert">Error: Server with id [% msg_add %] not found</div>
106 [% IF ( add_form ) %]
107 <form action="[% script_name %]" name="Aform" method="post" id="serverentry">
108 <input type="hidden" name="op" value="add_validated" />
109 <input type="hidden" name="servertype" value="[% server.servertype||type||'zed' %]"/>
110 [% IF op == 'edit' %]
111 <h1>Modify [% PROCESS ServerType %] server</h1>
112 <input type="hidden" name="id" value="[% server.id %]" />
114 <h1>New [% PROCESS ServerType %] server</h1>
116 <fieldset class="rows">
118 <li><label for="name">Server name: </label><input type="text" name="servername" id="servername" size="65" maxlength="100" onblur="toUC(this)" value="[% server.servername | html %]"/></li>
120 <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>
121 [% IF (server.servertype||type) == 'sru' %]
122 <div class="hint">Includes the domain part, but the path part of the URL should go into Database.</div>
125 <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>
127 <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>
129 <li><label for="userid">Userid: </label> <input type="text" name="userid" id="userid" value="[% server.userid %]" />
131 <li><label for="password">Password: </label> <input type="text" name="password" id="password" value="[% server.password %]" />
133 <li><label for="checked">Preselected (searched by default): </label>
134 [% IF ( server.checked ) %]
135 <input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
137 <input type="checkbox" name="checked" id="checked" value="1" />
140 <li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
143 <li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>
144 <select name="syntax" id="syntax">
145 <option value="UNIMARC">UNIMARC</option>
146 <option value="INTERMARC">INTERMARC</option>
147 <option value="CCF">CCF</option>
148 <option value="USMARC">MARC21/USMARC</option>
149 <option value="UKMARC">UKMARC</option>
150 <option value="NORMARC">NORMARC</option>
151 <option value="LIBRISMARC">LIBRISMARC</option>
152 <option value="DANMARC">DANMARC</option>
153 <option value="FINMARC">FINMARC</option>
154 <option value="CANMARC">CANMARC</option>
155 <option value="SBN">SBN</option>
156 <option value="PICAMARC">PICAMARC</option>
157 <option value="AUSMARC">AUSMARC</option>
158 <option value="IBERMARC">IBERMARC</option>
159 <option value="CATMARC">CATMARC</option>
160 <option value="MALMARC">MALMARC</option>
164 <li><label for="encoding">Encoding (z3950 can send<br /> records in various encodings. Choose one): </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 %]">[% enc %]</option>
172 <li><label for="timeout">Timeout (0 its like not set): </label>
173 <input type="text" name="timeout" id="timeout" size="4" value="[% server.timeout %]" /> seconds
175 <li><label for="recordtype">Record type: </label>
176 <select name="recordtype" id="recordtype">
177 <option value="biblio">Bibliographic</option>
178 <option value="authority">Authority</option>
181 [% IF (server.servertype||type) == 'sru' %]
183 <label for="sru_options">Additional SRU options: </label>
184 <input type="text" name="sru_options" id="sru_options" size="50" value="[% server.sru_options %]"/>
185 <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>
188 <label for="sru_fields">SRU Search fields mapping: </label>
189 <input type="hidden" name="sru_fields" id="sru_fields" value="[% server.sru_fields %]" />
190 <input type="text" name="show_sru_fields" id="show_sru_fields" size="100" value="[% server.sru_fields %]" disabled/> <input type="button" value="Modify" onclick="ModMapping()" />
194 <label for="add_xslt">XSLT File(s) for transforming results: </label>
195 <input type="text" name="add_xslt" id="add_xslt" size="100" value="[% server.add_xslt %]"/>
196 <div class="hint">Separate multiple filenames by commas.</span>
202 <fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset>
206 [% IF op == 'list' %]
207 <div id="toolbar" class="btn-toolbar">
208 <a id="newserver" class="btn btn-small" href="/cgi-bin/koha/admin/z3950servers.pl?op=add&type=zed"><i class="icon-plus"></i> New Z39.50 server</a>
209 <a id="newserver" class="btn btn-small" href="/cgi-bin/koha/admin/z3950servers.pl?op=add&type=sru"><i class="icon-plus"></i> New SRU server</a>
211 <h3>Z39.50/SRU servers administration</h3>
213 You searched for record [% id %]
214 [% ELSIF searchfield %]
215 You searched for [% searchfield %]
217 <table id="serverst">
218 <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>Options</th>
221 [% FOREACH loo IN loop %]
223 <td><a href="[% loo.script_name %]?op=edit&id=[% loo.id %]">[% loo.servername %]</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>
224 <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td>
225 <td>[% IF ( loo.recordtype == 'biblio' ) %]
226 <span>Bibliographic</span>
227 [% ELSIF ( loo.recordtype == 'authority' ) %]
228 <span>Authority</span>
231 <td><a href="[% loo.script_name %]?op=edit&id=[% loo.id %]">Edit</a> <a href="[% loo.script_name %]?op=add&id=[% loo.id %]">Copy</a> <a href="javascript:void(0);" onclick="ConfirmDelete('[% loo.servername | replace("['\"]","") %]','[% loo.id %]');">Delete</a></td>
241 [% INCLUDE 'admin-menu.inc' %]
244 [% INCLUDE 'intranet-bottom.inc' %]