Bug 11765 - Remove unused function isDate from templates
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / auth_tag_structure.tt
index af03d1c..f8c3910 100644 (file)
@@ -1,19 +1,25 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Administration &rsaquo; Authority MARC framework [% IF ( add_form ) %][% IF ( use_heading_flags_p ) %]
-    [% IF ( heading_modify_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default Framework[% END %] &rsaquo; Modify tag[% END %]
-    [% IF ( heading_add_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default Framework[% END %] &rsaquo; New tag[% END %]
-    [% ELSE %]&rsaquo; [% action %][% END %][% END %][% IF ( delete_confirm ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default Framework[% END %] &rsaquo; Confirm Deletion[% END %][% IF ( delete_confirmed ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default Framework[% END %] &rsaquo; Data Deleted[% END %]</title>
+    [% IF ( heading_modify_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Modify tag[% END %]
+    [% IF ( heading_add_tag_p ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; New tag[% END %]
+    [% ELSE %]&rsaquo; [% action %][% END %][% END %][% IF ( delete_confirm ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Confirm deletion[% END %][% IF ( delete_confirmed ) %]&rsaquo; [% IF ( authtypecode ) %][% authtypecode %] Framework[% ELSE %]Default framework[% END %] &rsaquo; Data deleted[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
-<script type="text/javascript" id="js">$(document).ready(function() {
-       $("#table_authtagstructure").tablesorter({
-               sortList: [[0,0]],
-               headers: { 5: { sorter: false},6: { sorter: false},7: { sorter: false}}
-       }).tablesorterPager({container: $("#pagertable_authtagstructure"),positionFixed: false,size: 20});
-}); </script>
+
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
+ $(document).ready(function() {
+    $("#table_authtagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
+        ],
+        "iDisplayLength": 20,
+        "aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
+        "sPaginationType": "four_button"
+    }));
+ });
+
     /////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     function isNotNull(f,noalert) {
         if (f.value.length ==0) {
@@ -22,12 +28,6 @@ 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)) {
@@ -39,13 +39,6 @@ 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="";
@@ -65,33 +58,53 @@ return false;
     //]]>
 </script>
 </head>
-<body>
+<body id="admin_auth_tag_structure" class="admin">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-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 ( add_form ) %][% IF ( use_heading_flags_p ) %]
-    [% IF ( heading_modify_tag_p ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>[% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a>[% END %] &rsaquo; Modify tag[% END %]
-    [% IF ( heading_add_tag_p ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>[% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a>[% END %] &rsaquo; New tag[% END %]
-    [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; [% action %]
-    [% END %]
-    [% ELSE %]
-    [% IF ( delete_confirm ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo;
-    [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
-    [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default Framework</a>[% END %] &rsaquo; Confirm Deletion
+<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/authtypes.pl">Authority types</a> &rsaquo;
+    [% IF ( add_form ) %]
+        [% IF ( use_heading_flags_p ) %]
+            [% IF ( heading_modify_tag_p ) %]
+                [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
+                [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+                [% END %] &rsaquo; Modify tag
+            [% END %]
+            [% IF ( heading_add_tag_p ) %]
+                [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
+                [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+                [% END %] &rsaquo; New tag
+            [% END %]
+        [% ELSE %]
+            [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] Framework</a>
+            [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+            [% END %] &rsaquo; [% action %]
+        [% END %]
     [% ELSE %]
-    [% IF ( delete_confirmed ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Authority MARC Framework</a> &rsaquo; Data Deleted
-    [% ELSE %]Authority MARC Framework: [% IF ( authtypecode ) %][% authtypecode %] Framework
-    [% ELSE %]Default Framework[% END %]
-    [% END %]
-    [% END %]
+        [% IF ( delete_confirm ) %]
+            [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
+            [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+            [% END %] &rsaquo; Confirm deletion
+        [% ELSE %]
+            [% IF ( delete_confirmed ) %]
+                [% IF ( authtypecode ) %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl?authtypecode=[% authtypecode %]">[% authtypecode %] framework</a>
+                [% ELSE %]<a href="/cgi-bin/koha/admin/auth_tag_structure.pl">Default framework</a>
+                [% END %] &rsaquo; Data deleted
+            [% ELSE %]
+                [% IF ( authtypecode ) %][% authtypecode %] Framework</a>
+                [% ELSE %]Default framework
+                [% END %]
+            [% END %]
+        [% END %]
     [% END %]
 </div>
 
 <div id="doc3" class="yui-t2">
    
    <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
+    <div id="yui-main">
+    <div class="yui-b">
 
 <h1>Authority MARC framework for [% IF ( authtypecode ) %][% authtypecode %][% ELSE %]default framework[% END %]</h1>
 
@@ -109,24 +122,24 @@ return false;
         [% IF ( heading_modify_tag_p ) %]<input type="hidden" name="modif" value="1" />[% END %]
         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
         <fieldset class="rows"><ol>
-               <li><span class="label">Tag</span>[% searchfield %]</li>
-        <li><label for="liblibrarian">Text for librarians</label><input type="text" name="liblibrarian" id="liblibrarian" value="[% liblibrarian |html %]" size="40" maxlength="100" /></li>
-        <li><label for="libopac">Text for opac</label><input type="text" name="libopac" id="libopac" value="[% libopac |html %]" size="40" maxlength="100" /></li>
-        <li><label for="repeatable">Repeatable</label>
+        <li><span class="label">Tag: </span>[% searchfield %]</li>
+        <li><label for="liblibrarian">Text for librarians</label><input type="text" name="liblibrarian" id="liblibrarian" value="[% liblibrarian |html %]" size="40" maxlength="100" /></li>
+        <li><label for="libopac">Text for opac</label><input type="text" name="libopac" id="libopac" value="[% libopac |html %]" size="40" maxlength="100" /></li>
+        <li><label for="repeatable">Repeatable</label>
             [% IF ( repeatable ) %]
                 <input type="checkbox" name="repeatable" id="repeatable" value="1" checked="checked" />
             [% ELSE %]
                 <input type="checkbox" name="repeatable" id="repeatable" value="1" />
             [% END %]
         </li>
-        <li><label for="mandatory">Mandatory</label>
+        <li><label for="mandatory">Mandatory</label>
             [% IF ( mandatory ) %]
                 <input type="checkbox" name="mandatory" id="mandatory" value="1" checked="checked" />
             [% ELSE %]
                 <input type="checkbox" name="mandatory" id="mandatory" value="1" />
             [% END %]
             </li>
-        <li><label for="authorised_value">Authorized value</label>[% authorised_value %] (if you select a value here, the indicators will be limited to the authorized value list)</li>
+        <li><label for="authorised_value">Authorized value</label>[% authorised_value %] (if you select a value here, the indicators will be limited to the authorized value list)</li>
 </ol></fieldset>
         <p><input type="button" value="Submit" class="button" onclick="Check(this.form)" /></p>
     </form>
@@ -134,18 +147,18 @@ return false;
 
 
 [% IF ( delete_confirm ) %]
-               <div class="dialog alert">
-               <h3>Confirm Deletion</h3>
-               <form action="[% script_name %]" method="post">
-               <table>
-                       <tr><th scope="row">Tag: </th><td>[% searchfield %] [% liblibrarian %]</td></tr>
-               </table>
+        <div class="dialog alert">
+        <h3>Confirm deletion</h3>
+        <form action="[% script_name %]" method="post">
+        <table>
+            <tr><th scope="row">Tag: </th><td>[% searchfield %] [% liblibrarian %]</td></tr>
+        </table>
         <input type="hidden" name="op" value="delete_confirmed" />
         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
         <input type="hidden" name="searchfield" value="[% searchfield %]" />
-               <input type="submit" value="Yes, Delete" class="approve"></form>
-               <form action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, Do Not Delete" /></form>
-               </div>
+        <input type="submit" value="Yes, delete" class="approve"></form>
+        <form action="[% script_name %]" method="get"><input type="submit" class="deny" value="No, do not delete" /></form>
+        </div>
 [% END %]
 
 [% IF ( delete_confirmed ) %]
@@ -164,9 +177,12 @@ return false;
         <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
         Create authority framework for [% authtypecode %] using
         <select name="existingauthtypecode">
-            <option value="">Default</option>
         [% FOREACH existingauthtypeloo IN existingauthtypeloop %]
-            <option value="[% existingauthtypeloo.value %]">[% existingauthtypeloo.authtypetext %]</option>
+            [% IF existingauthtypeloo.value == "" %]
+              <option value="" selected="selected">[% existingauthtypeloo.authtypetext %]</option>
+            [% ELSE %]
+              <option value="[% existingauthtypeloo.value %]">[% existingauthtypeloo.authtypetext %]</option>
+            [% END %]
         [% END %]
         </select>
         <input type="submit" value="OK" class="submit" />
@@ -176,32 +192,19 @@ return false;
 
 [% IF ( else ) %]
 
-<div id="toolbar">
-       <script type="text/javascript">
-       //<![CDATA[
-       // prepare DOM for YUI Toolbar
-        $(document).ready(function() {
-           yuiToolbar();
-        });
-       // YUI Toolbar Functions
-       function yuiToolbar() {
-           new YAHOO.widget.Button("newtag");
-       }       //]]>
-       </script>
-       <ul class="toolbar">
-       <li><a id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode %]">New Tag</a></li>
-</ul></div>
+<div id="toolbar" class="btn-toolbar">
+    <div class="btn-group"><a class="btn btn-small" id="newtag" href="/cgi-bin/koha/admin/auth_tag_structure.pl?op=add_form&amp;authtypecode=[% authtypecode %]"><i class="icon-plus"></i> New tag</a></div>
+</div>
 
 <h2>Select an authority framework</h2>
 <form action="[% script_name %]" method="post">
     <select name="authtypecode">
-        <option value="">Default</option>
     [% FOREACH authtypeloo IN authtypeloop %]
-               [% IF ( authtypeloo.selected ) %]
+        [% IF ( authtypeloo.selected ) %]
         <option value="[% authtypeloo.value %]" selected="selected">[% authtypeloo.authtypetext %]</option>
-               [% ELSE %]
+        [% ELSE %]
         <option value="[% authtypeloo.value %]">[% authtypeloo.authtypetext %]</option>
-               [% END %]
+        [% END %]
             
     [% END %]
     </select>
@@ -209,7 +212,6 @@ return false;
     <input type="submit" value="OK" class="submit" />
 </form><br />
 <div id="pagertable_authtagstructure">
-[% INCLUDE 'table-pager.inc' perpage='20' %]
 </div>
 <table id="table_authtagstructure">
     <thead>
@@ -221,13 +223,13 @@ return false;
         <th>Subfields</th>
         <th>Edit</th>
         <th>Delete</th>
-       </thead>
+    </thead>
     [% FOREACH loo IN loop %]
-       [% UNLESS ( loop.odd ) %]
-       <tr class="highlight">
-       [% ELSE %]
-       <tr>
-       [% END %]
+    [% UNLESS ( loop.odd ) %]
+    <tr class="highlight">
+    [% ELSE %]
+    <tr>
+    [% END %]
         <td><b>[% loo.tagfield %]</b></td>
         <td>[% loo.liblibrarian %]</td>
         <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>