Bug 20109: (follow-up) Use double quote instead of simple-quote
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / z3950servers.tt
index 18f92fc..fba1ffd 100644 (file)
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Administration &rsaquo; [% IF ( else ) %]Z39.50 servers[% END %]
-[% IF ( add_form ) %] Z39.50 servers &rsaquo; [% IF ( searchfield ) %]Modify Z39.50 server [% searchfield %][% ELSE %]New Z39.50 server[% END %][% END %]
-[% IF ( delete_confirm ) %]Z39.50 servers &rsaquo; Confirm deletion[% END %]
-[% IF ( add_validate ) %]Z39.50 servers &rsaquo; Z39.50 server added[% END %]
-[% IF ( delete_confirmed ) %]Z39.50 servers &rsaquo; Z39.50 server deleted[% END %]</title>
-[% INCLUDE 'doc-head-close.inc' %]
-[% IF ( else ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
-[% INCLUDE 'datatables-strings.inc' %]
-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
-[% END %]
-[% IF ( add_form ) %]
-<script type="text/javascript">
-//<![CDATA[
-        //
-        function isNotNull(f,noalert) {
-                if (f.value.length ==0) {
-                    return false;
-                }
-                return true;
-        }
-        //
-        function toUC(f) {
-                var x=f.value.toUpperCase();
-                f.value=x;
-                return true;
-        }
-        //
-        function isNum(v,maybenull) {
-        var n = new Number(v.value);
-        if (isNaN(n)) {
-                return false;
-                }
-        if (maybenull==0 && v.value=='') {
-                return false;
-        }
-        return true;
-        }
-        //
-        function isDate(f) {
-                var t = Date.parse(f.value);
-                if (isNaN(t)) {
-                       return false;                       
-                }
-        }
-        //
-        function Check(f) {
-                var ok=1;
-                var _alertString="";
-                var alertString2;
-                if (f.searchfield.value.length==0) {_alertString += "- target name missing\n";
-                }
-                if (f.host.value.length==0) {_alertString += "- host missing\n";
-                }
-                if (f.port.value.length==0) {_alertString += "- port missing\n";
-                }
-                if (f.db.value.length==0) {_alertString += "- database missing\n";
-                }
-                if (isNaN(f.port.value)) {_alertString += "- port must be a number\n";
-                }
-                if (isNaN(f.rank.value)) {_alertString += "- rank must be a number\n";
-                }
-                if (_alertString.length==0) {document.Aform.submit();
-                } else {alertString2 = "Form not submitted because of the following problem(s)\n";alertString2 += "------------------------------------------------------------------------------------\n\n";alertString2 += _alertString;alert(alertString2);
-                }
-        }
-        //]]>
-</script>
-[% END %]
-[% IF ( else ) %]
-    <script type="text/javascript">
-    //<![CDATA[
-     $(document).ready(function() {
-        [% IF ( loop ) %]$("#serverst").dataTable($.extend(true, {}, dataTablesDefaults, {
-            "aoColumnDefs": [
-                { "aTargets": [ 2,3,4,7,8,9,10,11 ], "bSortable": false, "bSearchable": false },
-            ],
-            "iDisplayLength": 20,
-            "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
-            "sPaginationType": "four_button"
-        }));[% END %]
-     });
-    //]]>
-    </script>
+
+[% 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="[% interface %]/[% theme %]/css/datatables.css" />
+[% END %]
 </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; [% IF ( else ) %]Z39.50 servers[% END %]
-[% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; [% IF ( searchfield ) %]Modify Z39.50 server [% searchfield %][% ELSE %]New Z39.50 server[% END %][% END %]
-[% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; Confirm deletion[% END %]
-[% IF ( add_validate ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; Z39.50 server added[% END %]
-[% IF ( delete_confirmed ) %] <a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 servers</a> &rsaquo; Z39.50 server deleted[% END %]</div>
+<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">
+<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">
-        <input type="hidden" name="op" value="add_validate" />
-[% IF ( searchfield ) %]
-                <h1>Modify Z39.50 server</h1>
+    <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 Z39.50 server</h1>
-        [% END %]                
+            <h1>New [% PROCESS ServerType %] server</h1>
+        [% END %]
         <fieldset class="rows">
-        <ol>[% IF ( searchfield ) %]
-                <li><span class="label">Z39.50 server: </span>        <input type="hidden" name="searchfield" value="[% searchfield %]" />[% searchfield %]</li>
+        <ol>
+        <li><label for="name" class="required">Server name: </label>
+            <input type="text" name="servername" id="servername" size="65" maxlength="100" value="[% server.servername | html %]" required="required" /> <span class="required">Required</span>
+        </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 %]
-                <li><label for="searchfield">Z39.50 server: </label>        <input type="text" name="searchfield" id="searchfield" size="65" maxlength="100" onblur="toUC(this)" /></li>
+            <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="host">Hostname: </label>        <input type="text" name="host" id="host" size="30" value="[% host %]" />
-               </li>
-               <li><label for="port">Port: </label>    <input type="text" name="port" id="port" size="5" value="[% port %]" onblur="isNum(this)" />
-               </li>
-               <li><label for="db">Database: </label>  <input type="text" name="db" id="db" value="[% db %]" />
-               </li>
-               <li><label for="userid">Userid: </label>        <input type="text" name="userid" id="userid" value="[% userid %]" />
-               </li>
-               <li><label for="password">Password: </label>    <input type="text" name="password" id="password" value="[% password %]" />
-               </li>
-               <li><label for="checked">Checked (searched by default): </label>
-                        [% IF ( 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="[% rank %]" onblur="isNum(this)" />
-               </li>   
-               <li><label for="syntax">Syntax (z3950 can send<br /> records in various format. Choose one): </label>   
-<select name="syntax">
-[% IF ( syntaxUNIMARC ) %]
-<option value="UNIMARC" selected="selected">UNIMARC</option>
-[% ELSE %]
-<option value="UNIMARC">UNIMARC</option>
-[% END %]
-[% IF ( syntaxINTERMARC ) %]
-<option value="INTERMARC" selected="selected">INTERMARC</option>
-[% ELSE %]
-<option value="INTERMARC">INTERMARC</option>
-[% END %]
-[% IF ( syntaxCCF ) %]
-<option value="CCF" selected="selected">CCF</option>
-[% ELSE %]
-<option value="CCF">CCF</option>
-[% END %]
-[% IF ( syntaxUSMARC ) %]
-<option value="USMARC" selected="selected">MARC21/USMARC</option>
-[% ELSE %]
-<option value="USMARC">MARC21/USMARC</option>
-[% END %]
-[% IF ( syntaxUKMARC ) %]
-<option value="UKMARC" selected="selected">UKMARC</option>
-[% ELSE %]
-<option value="UKMARC">UKMARC</option>
-[% END %]
-[% IF ( syntaxNORMARC ) %]
-<option value="NORMARC" selected="selected">NORMARC</option>
-[% ELSE %]
-<option value="NORMARC">NORMARC</option>
-[% END %]
-[% IF ( syntaxLIBRISMARC ) %]
-<option value="LIBRISMARC" selected="selected">LIBRISMARC</option>
-[% ELSE %]
-<option value="LIBRISMARC">LIBRISMARC</option>
-[% END %]
-[% IF ( syntaxDANMARC ) %]
-<option value="DANMARC" selected="selected">DANMARC</option>
-[% ELSE %]
-<option value="DANMARC">DANMARC</option>
-[% END %]
-[% IF ( syntaxFINMARC ) %]
-<option value="FINMARC" selected="selected">FINMARC</option>
-[% ELSE %]
-<option value="FINMARC">FINMARC</option>
-[% END %]
-[% IF ( syntaxCANMARC ) %]
-<option value="CANMARC" selected="selected">CANMARC</option>
-[% ELSE %]
-<option value="CANMARC">CANMARC</option>
-[% END %]
-[% IF ( syntaxSBN ) %]
-<option value="SBN" selected="selected">SBN</option>
-[% ELSE %]
-<option value="SBN">SBN</option>
-[% END %]
-[% IF ( syntaxPICAMARC ) %]
-<option value="PICAMARC" selected="selected">PICAMARC</option>
-[% ELSE %]
-<option value="PICAMARC">PICAMARC</option>
-[% END %]
-[% IF ( syntaxAUSMARC ) %]
-<option value="AUSMARC" selected="selected">AUSMARC</option>
-[% ELSE %]
-<option value="AUSMARC">AUSMARC</option>
-[% END %]
-[% IF ( syntaxIBERMARC ) %]
-<option value="IBERMARC" selected="selected">IBERMARC</option>
-[% ELSE %]
-<option value="IBERMARC">IBERMARC</option>
-[% END %]
-[% IF ( syntaxCATMARC ) %]
-<option value="CATMARC" selected="selected">CATMARC</option>
-[% ELSE %]
-<option value="CATMARC">CATMARC</option>
-[% END %]
-[% IF ( syntaxMALMARC ) %]
-<option value="MALMARC" selected="selected">MALMARC</option>
-[% ELSE %]
-<option value="MALMARC">MALMARC</option>
-[% END %]
-</select>
-</li>
-
-    <li><label for="encoding">Encoding (z3950 can send<br /> records in various encodings. Choose one): </label>  
-<select name="encoding">
-[% FOREACH enc IN [ 'utf8' 'EUC-KR' 'ISO_5426' 'ISO_6937' 'ISO_8859-1' 'MARC-8' ] %]
-    [% IF ( encoding == enc ) %]
-    <option value="[% enc %]" selected="selected">[% enc %]</option>
-    [% ELSE %]
-    <option value="[% enc %]">[% enc %]</option>
-    [% END %]
-[% END %]
-</select>
-</li>
-    <li><label for="timeout">Timeout (0 its like not set): </label>
-               <input type="text" name="timeout" id="timeout" size="4" value="[% timeout %]" onblur="isNum(this)" /> seconds
-       </li>
-</ol>
-        </fieldset>
-               
-               <fieldset class="action"><input type="button" value="Save" onclick="Check(this.form)" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset>
-        </form>
-[% END %]
-
-[% IF ( add_validate ) %]
-<h3>Z39.50 server added</h3>
-<form action="[% script_name %]" method="post">
-        <input type="submit" value="OK" />
-        </form>
-[% END %]
-
-[% IF ( delete_confirm ) %]
-       [% reqsel %]
-<h3>Confirm deletion of server [% searchfield %]</h3>
-        <ul>
-                <li><strong>Target: </strong>        [% searchfield %]</li>
-                <li><strong>Hostname: </strong>[% host %]</li>
-                <li><strong>Port: </strong>[% port %]</li>
-                <li><strong>Database: </strong>[% db %]</li>
-                <li><strong>Userid: </strong>[% userid %]</li>
-                <li><strong>Password: </strong>[% password %]</li>
-                <li><strong>Checked: </strong>[% checked %]</li>
-                <li><strong>Rank: </strong>[% rank %]</li>
-                <li><strong>Syntax: </strong>[% syntax %]</li>
-                <li><strong>Encoding: </strong>[% encoding %]</li>
-                <li><strong>Timeout: </strong>[% timeout %]</li>
-       </ul>                <form action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="submit" value="Delete this Server" /></form>  <form action="[% script_name %]" method="post"><input type="submit" value="Do Not Delete" /></form>
+        <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="disabled" /> <input type="button" id="modify_sru_fields" value="Modify" />
+        </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>
 
-[% END %]
+        </ol>
+        </fieldset>
 
-[% IF ( delete_confirmed ) %]
-<h3>Z39.50 server deleted</h3>
-<form action="[% script_name %]" method="post">
-                <input type="submit" value="OK" />
-</form>
+        <fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/z3950servers.pl">Cancel</a></fieldset>
+    </form>
 [% END %]
 
-[% IF ( else ) %]
-
-<div id="toolbar" class="btn-toolbar">
-    <a id="newserver" class="btn btn-small" href="/cgi-bin/koha/admin/z3950servers.pl?op=add_form"><i class="icon-plus"></i> New Z39.50 server</a>
-</div>
-
-<h3>Z39.50 servers administration</h3>
-
-        [% IF ( 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>Checked</th><th>Rank</th><th>Syntax</th><th>Encoding</th><th>Timeout</th><th>&nbsp;</th><th>&nbsp;</th>
-                </tr></thead>
-                <tbody>[% FOREACH loo IN loop %]
-                [% UNLESS ( loop.odd ) %]
-                    <tr class="highlight">
-                [% ELSE %]
-                    <tr>
+[% IF op == 'list' %]
+    <div id="toolbar" class="btn-toolbar">
+        <a id="newserver" class="btn btn-default btn-sm" 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-default btn-sm" 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 |html %]
+    [% 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="/cgi-bin/koha/admin/z3950servers.pl?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><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</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><a href="[% loo.script_name %]?op=add_form&amp;searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&amp;searchfield=[% loo.name |url %]">Delete</a></td>                </tr>
-                [% END %]</tbody>
-       </table>
-
-[% IF ( offsetgtzero ) %]<form action="[% script_name %]" method="get">
-       <input type="hidden" name="offset" value="[% prevpage %]" />
-       <input type="submit" value="&lt;&lt; Previous">
-</form>[% END %]
-
-[% IF ( ltcount ) %]<form action="[% script_name %]" method="get">
-       <input type="hidden" name="offset" value="[% nextpage %]" />
-       <input type="submit" value="Next &gt;&gt;" />
-</form> [% END %]
-
+            </td>
+            <td>
+                <div class="dropdown">
+                    <a class="btn btn-default btn-xs 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="/cgi-bin/koha/admin/z3950servers.pl?op=edit&amp;id=[% loo.id %]"><i class="fa fa-pencil"></i> Edit</a></li>
+                        <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=add&amp;id=[% loo.id %]"><i class="fa fa-copy"></i> Copy</a></li>
+                        <li><a href="/cgi-bin/koha/admin/z3950servers.pl?op=delete_confirmed&amp;id=[% loo.id %]" class="delete" data-servername="[% loo.servername %]"><i class="fa fa-trash"></i> Delete</a></li>
+                    </ul>
+                </div>
+            </td>
+            </tr>
+        [% END %]
+        </tbody>
+    </table>
 [% END %]
 
 </div>
 [% INCLUDE 'admin-menu.inc' %]
 </div>
 </div>
+
+[% MACRO jsinclude BLOCK %]
+    <script type="text/javascript" src="[% interface %]/[% theme %]/js/admin-menu.js"></script>
+    [% IF op == 'list' %]
+        [% INCLUDE 'datatables.inc' %]
+    [% END %]
+
+    <script type="text/javascript">
+        [% 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);
+                });
+                $("#servername").on("blur",function(){
+                    toUC(this);
+                });
+                $("#modify_sru_fields").on("click",function(){
+                    ModMapping();
+                });
+            });
+            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=yes,toolbar=false,scrollbars=yes,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"
+                }));
+                $(".delete").on("click",function(e){
+                    var servername = $(this).data("servername");
+                    if( confirm( _("Are you sure you want to delete server %s?").format(servername) ) ) {
+                        return true;
+                    } else {
+                        e.preventDefault();
+                    }
+                });
+            });
+        [% END %]
+    </script>
+[% END %]
 [% INCLUDE 'intranet-bottom.inc' %]