Bug 12089: Remove use of dt_add_type_uk_date() - Circulation
authorOwen Leonard <oleonard@myacpl.org>
Tue, 15 Apr 2014 18:04:33 +0000 (14:04 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 28 Apr 2014 18:40:29 +0000 (18:40 +0000)
This patch removes instances of dt_add_type_uk_date() from there
circulation templates and updates the sorting configuration according to
current guidelines.

To test, enable the UseTablesortForCirc system preference and open a
patron for circulation who has multiple items checked out. Confirm that
sorting by due date, title, and checkout date work correctly.

Locate a patron who is guarantor to another or is guaranteed by another.
One or both patrons should have checkouts. The "relatives checkouts" tab
on the checkout page should sort correctly on due date, title, and
checkout date.

On the transfers to receive report, confirm that sorting by date of
transfer and title work correctly for all tables.

On the holds awaiting pickup report the "available since" and title
columns should sort correctly for tables in both tabs (waiting and
over).

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt

index 6154c9d..6805126 100644 (file)
@@ -23,7 +23,6 @@
 //<![CDATA[
 var MSG_ADD_MESSAGE = _("Add a new message");
 var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
-[% IF ( UseTablesortForCirc && dateformat == 'metric' ) %]dt_add_type_uk_date();[% END %]
 [% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
 [% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
         $(document).ready(function() {
@@ -42,10 +41,9 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
             "sDom": 't',
             "aaSorting": [],
             "aoColumnDefs": [
-                { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false }
-            ],
-            "aoColumns": [
-                { "sType": "title-string" },{ "sType": "anti-the" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %]
+                { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false },
+                { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
+                { "sType": "title-string", "aTargets" : [ "title-string" ] }
             ],
             "bPaginate": false
         }));
@@ -53,8 +51,10 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
         $("#relissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
             "sDom": 't',
             "aaSorting": [],
-            "aoColumns": [
-                { "sType": "title-string" },{ "sType": "anti-the" },null,{ "sType": "title-string" },null,null,null,null,{ "sType": "html" }
+            "aoColumnDefs": [
+                { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
+                { "sType": "title-string", "aTargets" : [ "title-string" ] },
+                { "sType": "html", "aTargets" : [ "html-content" ] }
             ],
             "bPaginate": false
         }));
@@ -724,10 +724,10 @@ No patron matched <span class="ex">[% message %]</span>
     <input type="hidden" name="branch" value="[% branch %]" />
         <table id="issuest">
     <thead><tr>
-        <th scope="col">Due date</th>
-        <th scope="col">Title</th>
+        <th scope="col" class="title-string">Due date</th>
+        <th scope="col" class="anti-the">Title</th>
         <th scope="col">Item type</th>
-        <th scope="col">Checked out on</th>
+        <th scope="col" class="title-string">Checked out on</th>
         <th scope="col">Checked out from</th>
         <th scope="col">Call no</th>
         <th scope="col">Charge</th>
@@ -973,15 +973,15 @@ No patron matched <span class="ex">[% message %]</span>
     <table id="relissuest">
     <thead>
     <tr>
-        <th scope="col">Due date</th>
-        <th scope="col">Title</th>
+        <th scope="col" class="title-string">Due date</th>
+        <th scope="col" class="anti-the">Title</th>
         <th scope="col">Item type</th>
-        <th scope="col">Checked out on</th>
+        <th scope="col" class="title-string">Checked out on</th>
         <th scope="col">Checked out from</th>
         <th scope="col">Call no</th>
         <th scope="col">Charge</th>
         <th scope="col">Price</th>
-        <th scope="col">Patron</th>
+        <th scope="col" class="html-content">Patron</th>
     </tr>
     </thead>
 [% IF ( relissues ) %] <tbody>
index d3cc93b..e1cc760 100644 (file)
@@ -6,17 +6,13 @@
 [% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
-[% IF (dateformat == 'metric') %]
-dt_add_type_uk_date();
-[% END %]
 $(document).ready(function() {
     [% FOREACH branchesloo IN branchesloop %]
     $("#transferst[% branchesloo.branchcode %]").dataTable($.extend(true, {}, dataTablesDefaults, {
         "aoColumnDefs": [
             { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
-        ],
-        "aoColumns": [
-            { "sType": "title-string" },{ "sType": "anti-the" },null,null,null,null
+            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
+            { "sType": "title-string", "aTargets" : [ "title-string" ] }
         ],
         "sDom": 't',
         "bPaginate": false
@@ -48,8 +44,8 @@ $(document).ready(function() {
             <table style="width: 100%" id="transferst[% branchesloo.branchcode %]">
             <caption>Coming from [% branchesloo.branchname %]</caption>
             <thead><tr>
-                <th>Date of transfer</th>
-                <th>Title</th>
+                <th class="title-string">Date of transfer</th>
+                <th class="anti-the">Title</th>
                 <th>On hold for</th>
                 <th>Home library</th>
                 <th>Call no.</th>
index 6edfd85..7ba913a 100644 (file)
@@ -6,18 +6,14 @@
 [% INCLUDE 'datatables.inc' %]
 <script type="text/javascript">
 //<![CDATA[
-[% IF (dateformat == 'metric') %]
-dt_add_type_uk_date();
-[% END %]
      $(document).ready(function() {
          $('#resultlist').tabs();
          $("th a").hide();
         $("#holdst,#holdso").dataTable($.extend(true, {}, dataTablesDefaults, {
             "aoColumnDefs": [
                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
-            ],
-            "aoColumns": [
-                { "sType": "title-string" },{ "sType": "anti-the" },null,null,null,null,null
+                { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
+                { "sType": "title-string", "aTargets" : [ "title-string" ] }
             ],
             "sPaginationType": "four_button"
         }));
@@ -81,8 +77,8 @@ dt_add_type_uk_date();
             [% IF ( reserveloop ) %]
                <table id="holdst">
                <thead><tr>
-                    <th>Available since</th>
-                    <th>Title</th>
+                    <th class="title-string">Available since</th>
+                    <th class="anti-the">Title</th>
                     <th>Patron</th>
                     <th>Location</th>
                     <th>Copy number</th>
@@ -141,8 +137,8 @@ dt_add_type_uk_date();
                <br/>
                <table id="holdso">
                <thead><tr>
-                    <th>Available since</th>
-                    <th>Title</th>
+                    <th class="title-string">Available since</th>
+                    <th class="anti-the">Title</th>
                     <th>Patron</th>
                     <th>Location</th>
                     <th>Copy number</th>