Koha/koha-tmpl/intranet-tmpl/prog/en/modules/admin/z3950servers.tt
Kyle M Hall a8942c2884 Revert bug 13618 - "Prevent XSS in the Staff Client and the OPAC" due to performance issues
Revert "DBRev to make notes of the XSS patches and the new important dependency."

This reverts commit e140603a59.

Revert "Bug 13618: Specific for branches.opac_info"

This reverts commit 06e4a50f00.

Revert "Bug 13618: (follow-up) Specific for other prefs"

This reverts commit d6475a111f.

Revert "Bug 13618: Fix for debarredcomment and patron messages"

This reverts commit dd98c9df92.

Revert "Bug 13618: Do not display html tags in patron's notices"

This reverts commit a065b243fe.

Revert "Bug 13618: Do not display   and html tags in item fields content"

This reverts commit baeeaffbf8.

Revert "Bug 13618: Fix for system preference description"

This reverts commit a967a09261.

Revert "Bug 13618: Remove html filters for newly pushed code"

This reverts commit 0e98662b10.

Revert "Bug 13618: (follow-up) add missing lines for opac-shelves"

This reverts commit fc2fb605e5.

Revert "Bug 13618: (follow-up) Specific for ColumnsSettings"

This reverts commit bc308fdd9c.

Revert "Bug 13618: Fix for edit biblios and items"

This reverts commit 811c4e8402.

Revert "Bug 13618: followup to remove tabs"

This reverts commit ca8e8c397c.

Revert "Bug 13618: Fix last occurrences recently introduced to master"

This reverts commit bb417b256b.

Revert "Bug 13618: Fix for news"

This reverts commit ae5b98020a.

Revert "Bug 13618: Fix escape on sending baskets or shelves by email"

This reverts commit a7731ffe25.

Revert "Bug 13618: Specific for XSLTBloc"

This reverts commit 11fa38dc29.

Revert "Bug 13618: Specific for Salutation on editing a patron"

This reverts commit 36c07ad6d3.

Revert "Bug 13618: Specific for other prefs"

This reverts commit e6ea281a3b.

Revert "Bug 13618 - memberentrygen.tt errors Not a GLOB reference"

This reverts commit 7824874557.

Revert "Bug 13618: Specific for ColumnsSettings"

This reverts commit 1834da3da3.

Revert "Bug 13618: Specific for IntranetUser* and OPACUser* prefs"

This reverts commit 21ae62b253.

Revert "Bug 13618: Fix error 'Not a GLOB reference'"

This reverts commit 602bdbab4c.

Revert "Bug 13618: Specific for the ISBD view"

This reverts commit d254362435.

Revert "Bug 13618: Specific for pagination_bar"

This reverts commit 8837a8ae68.

Revert "Bug 13618: Specific places where we don't need to escape variables - intra"

This reverts commit 00eff140b3.

Revert "Bug 13618: Remove html filters at the intranet"

This reverts commit 7db851ff03.

Revert "Bug 13618: Specific places where we don't need to escape variables"

This reverts commit 49a3738b8d.

Revert "Bug 13618: Remove html filters at the OPAC"

This reverts commit cedaa0e23e.

Revert "Bug 13618: Use Template::Stash::AutoEscaping to use the html filter"

This reverts commit 01b38d3b13.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com
2016-02-11 19:39:53 +00:00

259 lines
12 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
[% BLOCK ServerType %]
[% IF (server.servertype||type) == 'sru' %]
SRU
[% ELSIF (server.servertype||type) == 'zed' %]
Z39.50
[% END %]
[% END %]
<title>Koha &rsaquo; Administration &rsaquo; Z39.50/SRU servers
[% IF op == 'edit' %] &rsaquo; Modify [% PROCESS ServerType %] server [% server.servername %][% END %]
[% IF op == 'add' %] &rsaquo; New [% PROCESS ServerType %] server[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
[% IF op == 'list' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'datatables.inc' %]
[% END %]
<script type="text/javascript">
//<![CDATA[
[% IF ( add_form ) %]
$(document).ready(function(){
// Update selects for syntax, encoding and recordtype
[% IF server %]
$("#syntax").val('[% server.syntax %]');
$("#encoding").val('[% server.encoding %]');
$("#recordtype").val('[% server.recordtype %]');
[% END %]
// Disable recordtype (and default to bib) for non-Z3950 servers until auth is supported
[% UNLESS (server.servertype||type) == 'zed' %]
$("#recordtype").prop('disabled',true);
[% END %]
$( "#serverentry" ).validate({
rules: {
servername: { required: true },
host: { required: true },
port: {
required: true,
number: true
},
db: { required: true },
rank: { number: true },
timeout: { number: true }
}
});
$("#serverentry").submit(function( event ) {
// first test if show_sru_fields exists
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?"))) {
return false;
}
// copy show_sru_fields to hidden counterpart
$('#sru_fields').val( $('#show_sru_fields').val() );
// enable recordtype to include field in post
$('#recordtype').prop('disabled',false);
});
});
function ModMapping () {
var map= $('#show_sru_fields').val();
window.open('/cgi-bin/koha/admin/sru_modmapping.pl?mapping='+map,'popup','width=800,height=400,resizable=no,toolbar=false,scrollbars=no,top');
}
[% ELSE %]
$(document).ready(function() {
$("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [2,3,4,7,8,9,10,11], "bSortable": false, "bSearchable": false },
],
"sPaginationType": "four_button"
}));
});
function ConfirmDelete(name,id) {
if( confirm( _("Choose OK if you really want to delete server ")+
name+'.')) {
window.location="[% script_name %]?op=delete_confirmed&id="+id;
}
return false;
}
[% END %]
//]]>
</script>
</head>
<body id="admin_z3950servers" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'z3950-admin-search.inc' %]
<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;
<a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50/SRU servers</a>
[% IF op == 'edit' %]&rsaquo; Modify [% PROCESS ServerType %] server [% server.servername %][% END %]
[% IF op == 'add' %]&rsaquo; New [% PROCESS ServerType %] server[% END %]
</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF msg_deleted %]
<div class="dialog alert">Z39.50/SRU server deleted ([% msg_add %])</div>
[% ELSIF msg_updated %]
<div class="dialog message">Z39.50/SRU server updated ([% msg_add %])</div>
[% ELSIF msg_added %]
<div class="dialog message">Z39.50/SRU server added ([% msg_add %])</div>
[% ELSIF msg_notfound %]
<div class="dialog alert">Error: Server with id [% msg_add %] not found</div>
[% END %]
[% IF ( add_form ) %]
<form action="[% script_name %]" name="Aform" method="post" id="serverentry">
<input type="hidden" name="op" value="add_validated" />
<input type="hidden" name="servertype" value="[% server.servertype||type||'zed' %]"/>
[% IF op == 'edit' %]
<h1>Modify [% PROCESS ServerType %] server</h1>
<input type="hidden" name="id" value="[% server.id %]" />
[% ELSE %]
<h1>New [% PROCESS ServerType %] server</h1>
[% END %]
<fieldset class="rows">
<ol>
<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>
<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>
[% IF (server.servertype||type) == 'sru' %]
<div class="hint">Includes the domain part, but the path part of the URL should go into Database.</div>
[% END %]
</li>
<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>
</li>
<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>
</li>
<li><label for="userid">Userid: </label> <input type="text" name="userid" id="userid" value="[% server.userid %]" />
</li>
<li><label for="password">Password: </label> <input type="text" name="password" id="password" value="[% server.password %]" />
</li>
<li><label for="checked">Preselected (searched by default): </label>
[% IF ( server.checked ) %]
<input type="checkbox" name="checked" id="checked" value="1" checked="checked" />
[% ELSE %]
<input type="checkbox" name="checked" id="checked" value="1" />
[% END %]
</li>
<li><label for="rank">Rank (display order): </label> <input type="text" name="rank" id="rank" size="4" value="[% server.rank %]" />
</li>
<li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>
<select name="syntax" id="syntax">
<option value="UNIMARC">UNIMARC</option>
<option value="INTERMARC">INTERMARC</option>
<option value="CCF">CCF</option>
<option value="USMARC">MARC21/USMARC</option>
<option value="UKMARC">UKMARC</option>
<option value="NORMARC">NORMARC</option>
<option value="LIBRISMARC">LIBRISMARC</option>
<option value="DANMARC">DANMARC</option>
<option value="FINMARC">FINMARC</option>
<option value="CANMARC">CANMARC</option>
<option value="SBN">SBN</option>
<option value="PICAMARC">PICAMARC</option>
<option value="AUSMARC">AUSMARC</option>
<option value="IBERMARC">IBERMARC</option>
<option value="CATMARC">CATMARC</option>
<option value="MALMARC">MALMARC</option>
</select>
</li>
<li><label for="encoding">Encoding (z3950 can send<br /> records in various encodings. Choose one): </label>
<select name="encoding" id="encoding">
[% FOREACH enc IN [ 'utf8' 'EUC-KR' 'ISO_5426' 'ISO_6937' 'ISO_8859-1' 'MARC-8' ] %]
<option value="[% enc %]">[% enc %]</option>
[% END %]
</select>
</li>
<li><label for="timeout">Timeout (0 its like not set): </label>
<input type="text" name="timeout" id="timeout" size="4" value="[% server.timeout %]" /> seconds
</li>
<li><label for="recordtype">Record type: </label>
<select name="recordtype" id="recordtype">
<option value="biblio">Bibliographic</option>
<option value="authority">Authority</option>
</select>
</li>
[% IF (server.servertype||type) == 'sru' %]
<li>
<label for="sru_options">Additional SRU options: </label>
<input type="text" name="sru_options" id="sru_options" size="50" value="[% server.sru_options %]"/>
<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>
</li>
<li>
<label for="sru_fields">SRU Search fields mapping: </label>
<input type="hidden" name="sru_fields" id="sru_fields" value="[% server.sru_fields %]" />
<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()" />
</li>
[% END %]
<li>
<label for="add_xslt">XSLT File(s) for transforming results: </label>
<input type="text" name="add_xslt" id="add_xslt" size="100" value="[% server.add_xslt %]"/>
<div class="hint">Separate multiple filenames by commas.</span>
</li>
</ol>
</fieldset>
<fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset>
</form>
[% END %]
[% IF op == 'list' %]
<div id="toolbar" class="btn-toolbar">
<a id="newserver" class="btn btn-small" href="/cgi-bin/koha/admin/z3950servers.pl?op=add&type=zed"><i class="fa fa-plus"></i> New Z39.50 server</a>
<a id="newserver" class="btn btn-small" href="/cgi-bin/koha/admin/z3950servers.pl?op=add&type=sru"><i class="fa fa-plus"></i> New SRU server</a>
</div>
<h3>Z39.50/SRU servers administration</h3>
[% IF id %]
You searched for record [% id %]
[% ELSIF searchfield %]
You searched for [% searchfield %]
[% END %]
<table id="serverst">
<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></th>
</tr></thead>
<tbody>
[% FOREACH loo IN loop %]
<tr>
<td><a href="[% loo.script_name %]?op=edit&amp;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>
<td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td>
<td>[% IF ( loo.recordtype == 'biblio' ) %]
<span>Bibliographic</span>
[% ELSIF ( loo.recordtype == 'authority' ) %]
<span>Authority</span>
[% END %]
</td>
<td>
<div class="dropdown">
<a class="btn btn-mini dropdown-toggle" id="reportactions[% savedreport.id %]" role="button" data-toggle="dropdown" href="#">
Actions <b class="caret"></b>
</a>
<ul class="dropdown-menu pull-right" role="menu" aria-labelledby="reportactions[% savedreport.id %]">
<li><a href="[% loo.script_name %]?op=edit&amp;id=[% loo.id %]"><i class="fa fa-pencil"></i> Edit</a></li>
<li><a href="[% loo.script_name %]?op=add&amp;id=[% loo.id %]"><i class="fa fa-copy"></i> Copy</a></li>
<li><a href="javascript:void(0);" onclick="ConfirmDelete('[% loo.servername | replace("['\"]","") %]','[% loo.id %]');"><i class="fa fa-remove"></i> Delete</a></li>
</ul>
</div>
</td>
</tr>
[% END %]
</tbody>
</table>
[% END %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'admin-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]