Bug 14033: Capitalization: confirmation message on deleting an authority type
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / marctagstructure.tt
index c889820..fc8f463 100644 (file)
@@ -1,50 +1,37 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Administration &rsaquo;
-[% IF ( add_form ) %]MARC Frameworks &rsaquo; [% action %] [% searchfield %][% END %]
-[% IF ( delete_confirm ) %]MARC Frameworks &rsaquo; Confirm Deletion of Tag '[% searchfield %]'[% END %]
-[% IF ( delete_confirmed ) %]MARC Frameworks &rsaquo;  Data Deleted[% END %]
-[% IF ( else ) %]MARC Frameworks[% END %]</title>
+[% IF ( add_form ) %]MARC frameworks &rsaquo; [% action %] [% searchfield %][% END %]
+[% IF ( delete_confirm ) %]MARC frameworks &rsaquo; Confirm deletion of tag '[% searchfield %]'[% END %]
+[% IF ( delete_confirmed ) %]MARC frameworks &rsaquo;  Data deleted[% END %]
+[% IF ( else ) %]MARC frameworks[% 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_marctagstructure").tablesorter({
-               sortList: [[0,0]],
-               headers: { 5: { sorter: false},6: { sorter: false},7: { sorter: false}}
-       }).tablesorterPager({container: $("#pagertable_marctagstructure"),positionFixed: false,size: 20});
-}); </script>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min.js"></script>
+
 <script type="text/javascript">
 //<![CDATA[
-function Check(f) {
-    var _alertString="";
-    var alertString2;
-    if (f.tagfield.value.length==0) {
-        _alertString += "\n- " + _("tag number missing");
-    }
-    if (_alertString.length==0) {
-        document.Aform.submit();
-    } else {
-        alertString2  = _("Form not submitted because of the following problem(s)");
-        alertString2 += "\n------------------------------------------------------------------------------------\n";
-        alertString2 += _alertString;
-        alert(alertString2);
-    }
-}
 
 $(document).ready(function() {
-    new YAHOO.widget.Button("addtag");
+    $("#table_marctagstructure").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
+        ],
+        "sPaginationType": "four_button"
+    }));
 });
+
 //]]>
 </script>
 </head>
-<body>
+<body id="admin_marctagstructure" 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; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC Frameworks</a>
+&rsaquo; <a href="/cgi-bin/koha/admin/biblio_framework.pl">MARC frameworks</a>
 [% IF ( add_form ) %]
 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
 &rsaquo; [% action %] [% searchfield %]
@@ -52,10 +39,10 @@ $(document).ready(function() {
 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% IF ( frameworkcode ) %][% frameworktext %] ([% frameworkcode %])[% ELSE %]Default MARC framework[% END %]</a>
 [% ELSIF ( delete_confirm ) %]
 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
-&rsaquo; Confirm Deletion of Tag '[% searchfield %]'
+&rsaquo; Confirm deletion of tag '[% searchfield %]'
 [% ELSIF ( delete_confirmed ) %]
 &rsaquo; <a href="/cgi-bin/koha/admin/marctagstructure.pl?frameworkcode=[% frameworkcode %]">[% frameworktext %] ([% frameworkcode %])</a>
-&rsaquo; Data Deleted
+&rsaquo; Data deleted
 [% END %]
 </div>
 
@@ -65,29 +52,61 @@ $(document).ready(function() {
       <div class="yui-b">
 
 [% IF ( else ) %]
-<div id="toolbar">
-       <ul class="toolbar">
-       <li><a id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&amp;frameworkcode=[% frameworkcode %]">New Tag</a></li>
-</ul></div>[% END %]
+<div id="toolbar" class="btn-toolbar">
+    <a class="btn btn-small" id="addtag" href="/cgi-bin/koha/admin/marctagstructure.pl?op=add_form&amp;frameworkcode=[% frameworkcode %]"><i class="icon-plus"></i> New tag</a>
+</div>[% END %]
 
 <h1>MARC Framework for [% IF ( frameworkcode ) %][% frameworktext %] ([% frameworkcode %])[% ELSE %]default MARC framework[% END %]</h1>
 
 [% IF ( add_form ) %]
 
-    <form action="[% script_name %]" name="Aform" method="post">
+    <form action="[% script_name %]" name="Aform" method="post" class="validated">
        
       <fieldset class="rows"><legend>[% IF ( use_heading_flags_p ) %][% IF ( heading_modify_tag_p ) %]Modify tag <input type="hidden" name="modif" value="1" />[% searchfield %][% END %][% IF ( heading_add_tag_p ) %]Add tag[% END %][% ELSE %][% action %][% END %]</legend>  <input type="hidden" name="op" value="add_validate" />
        <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
 
-       <ol> <li><label for="tagfield">Tag: </label><input id="tagfield" type="text" name="tagfield" value="[% searchfield %]" maxlength="3" size="3" /></li>    
+        <ol>
+            <li>
+                [% IF ( heading_modify_tag_p ) %]
+                    <input type="hidden" name="tagfield" value="[% searchfield %]" />
+                    <span class="label">Tag:</span>
+                    [% searchfield %]
+                [% ELSE %]
+                    <label for="tagfield" class="required">Tag: </label>
+                    <input id="tagfield" type="text" name="tagfield" value="[% searchfield %]" maxlength="3" size="3" required="required" class="required" />
+                    <span class="required">Required</span>
+                [% END %]
+            </li>
     <li><label for="liblibrarian">Label for lib: </label><input type="text" id="liblibrarian" name="liblibrarian" value="[% liblibrarian |html %]" size="40" maxlength="100" /></li>
     <li><label for="libopac">Label for opac: </label><input type="text" id="libopac" name="libopac" value="[% libopac |html %]" size="40" maxlength="100" /></li>
-    <li><label for="repeatable">Repeatable: </label>[% repeatable %]</li>
-    <li><label for="mandatory">Mandatory: </label>[% mandatory %]</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="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>
+        [% 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>
+        <select name="authorised_value" id="authorised_value" size="1">
+        [% FOREACH value IN authorised_value.values %]
+        [% IF ( value == authorised_value.default ) %]
+            <option value="[% value %]" selected="selected">[% value %]</option>
+        [% ELSE %]
+            <option value="[% value %]">[% value %]</option>
+        [% END %]
+        [% END %]
+        </select>
+        (if you select a value here, the indicators will be limited to the authorized value list)</li>
 </ol></fieldset> 
     <fieldset class="action">
-        <input type="submit" value="Save Changes" onclick="Check(this.form)" />
+        <input type="submit" value="Save changes" />
         <a class="cancel" href="[% script_name %]?frameworkcode=[% frameworkcode %]">Cancel</a>
     </fieldset>
     </form>
@@ -96,20 +115,20 @@ $(document).ready(function() {
 
 [% IF ( delete_confirm ) %]
 
-<div class="dialog alert"><h3>Confirm Deletion of Tag <span class="ex">'[% searchfield %]'</span>?</h3>
+<div class="dialog alert"><h3>Confirm deletion of tag <span class="ex">'[% searchfield %]'</span>?</h3>
     <p>Tag: [% searchfield %]</p>
     <p>Description: [% liblibrarian %]</p>
     <form action="[% script_name %]" method="post">
        <input type="hidden" name="op" value="delete_confirmed" />
        <input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
-       <input type="submit" class="approve" value="Yes, Delete this Tag" /></form>
+    <input type="submit" class="approve" value="Yes, delete this tag" /></form>
        
-       <form action="[% script_name %]" method="get"><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /><input type="submit" value="No, Do Not Delete" class="deny" /></form></div>
+    <form action="[% script_name %]" method="get"><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" /><input type="submit" value="No, do not delete" class="deny" /></form></div>
 [% END %]
 
 [% IF ( delete_confirmed ) %]
 
-    <div class="dialog message"><h3>Tag Deleted</h3>
+    <div class="dialog message"><h3>Tag deleted</h3>
     <form action="[% script_name %]" method="post"><input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
     <input type="submit" value="OK" class="approve" />
     </form></div>
@@ -149,19 +168,18 @@ $(document).ready(function() {
             [% END %]
         </select>
     <input type="submit" value="Search" />
-<p>        <label for="select_display">Display only used Tags/Subfields</label>
+<p>        <label for="select_display">Display only used tags/subfields</label>
         [% IF ( select_display ) %]
-            <input type="checkbox" name="select_display" id="select_display" value="True" checked="checked"  onchange="this.form.submit();" />
+            <input type="checkbox" name="select_display" id="select_display" value="True" checked="checked"  onchange="$.cookie('marctagstructure_selectdisplay', 0); this.form.submit();" />
         [% ELSE %]
-            <input type="checkbox" name="select_display" id="select_display" value="True" onchange="this.form.submit();" />
+            <input type="checkbox" name="select_display" id="select_display" value="True" onchange="$.cookie('marctagstructure_selectdisplay', 1); this.form.submit();" />
         [% END %]</p>
 </fieldset>
 </form>
-<div id="pagertable_marctagstructure">
-[% INCLUDE 'table-pager.inc' perpage='20' %]
-</div>
+
     <table id="table_marctagstructure">
     <thead>
+        <tr>
         <th>Tag</th>
         <th>Lib</th>
         <th>Repeatable</th>
@@ -170,13 +188,22 @@ $(document).ready(function() {
         <th>Subfields</th>
         <th>Edit</th>
         <th>Delete</th>
-       </thead>
-
+        </tr>
+    </thead>
+    <tbody>
     [% IF ( select_display ) %]
         [% FOREACH loo IN loop %]
-            [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
+        <tr>
             <td>[% loo.tagfield %]</td>
-            <td>[% loo.liblibrarian %]</td>
+            <td>
+                [% loo.liblibrarian %]
+                [% FOREACH subfield IN loo.subfields %]
+                    <p>
+                        Tab:[% subfield.tab %] | $[% subfield.tagsubfield %]
+                        [% subfield.liblibrarian %] [% IF ( subfield.kohafield ) %][% subfield.kohafield %][% END %][% IF ( subfield.repeatable ) %], repeatable[% END %][% IF ( subfield.mandatory ) %], Mandatory[% END %][% IF ( subfield.seealso ) %], See [% subfield.seealso %][% END %][% IF ( subfield.authorised_value ) %], [% subfield.authorised_value %][% END %][% IF ( subfield.authtypecode ) %], [% subfield.authtypecode %][% END %][% IF ( subfield.value_builder ) %], [% subfield.value_builder %][% END %]
+                    </p>
+                [% END %]
+            </td>
             <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
             <td>[% IF ( loo.mandatory ) %]Yes[% ELSE %]No[% END %]</td>
             <td>[% loo.authorised_value %]</td>
@@ -184,20 +211,10 @@ $(document).ready(function() {
             <td><a href="[% loo.edit %]">Edit</a></td>
             <td><a href="[% loo.delete %]">Delete</a></td>
         </tr>
-      [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
-            <td>&nbsp;</td>
-            <td colspan="7">
-                [% FOREACH subfield IN loo.subfields %]
-                    <p>        Tab:[% subfield.tab %] | $[% subfield.tagsubfield %]
-                            [% subfield.liblibrarian %] [% IF ( subfield.kohafield ) %][% subfield.kohafield %][% END %][% IF ( subfield.repeatable ) %], repeatable[% END %][% IF ( subfield.mandatory ) %], Mandatory[% END %][% IF ( subfield.seealso ) %], See [% subfield.seealso %][% END %][% IF ( subfield.authorised_value ) %], [% subfield.authorised_value %][% END %][% IF ( subfield.authtypecode ) %], [% subfield.authtypecode %][% END %][% IF ( subfield.value_builder ) %], [% subfield.value_builder %][% END %]
-                    </p>
-                [% END %]
-            </td>
-        </tr>
         [% END %]
     [% ELSE %]
     [% FOREACH loo IN loop %]
-    [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
+    <tr>
         <td>[% loo.tagfield %]</td>
         <td>[% loo.liblibrarian %]</td>
         <td>[% IF ( loo.repeatable ) %]Yes[% ELSE %]No[% END %]</td>
@@ -209,6 +226,7 @@ $(document).ready(function() {
     </tr>
     [% END %]
     [% END %]
+    </tbody>
     </table>