Bugzilla – Attachment 184923 Details for
Bug 27934
Table sorting using title-string option is obsolete
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27934: Remove title-string to order by dates
Bug-27934-Remove-title-string-to-order-by-dates.patch (text/plain), 7.47 KB, created by
Owen Leonard
on 2025-07-31 12:13:35 UTC
(
hide
)
Description:
Bug 27934: Remove title-string to order by dates
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2025-07-31 12:13:35 UTC
Size:
7.47 KB
patch
obsolete
>From 2743cac718c5a0946e848226736a047267e960a0 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 31 Jul 2025 12:54:40 +0200 >Subject: [PATCH] Bug 27934: Remove title-string to order by dates > >We must now use data-order to order dates, not title-string. > >This patch adjusts the few occurrences that were using it and remove >the function from datatables.js to prevent new occurrences. > >Test plan: >Create some recalls, go to the "Recalls to pull" and "Recalls awaiting >pickup" pages and confirm that the dates are ordered correctly when you >sort by dates. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > .../en/modules/recalls/recalls_to_pull.tt | 5 ++-- > .../en/modules/recalls/recalls_waiting.tt | 8 +++--- > koha-tmpl/intranet-tmpl/prog/js/datatables.js | 28 ------------------- > koha-tmpl/intranet-tmpl/prog/js/recalls.js | 1 - > 4 files changed, 6 insertions(+), 36 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >index 9d84e5840cd..dba569bc1df 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_to_pull.tt >@@ -53,7 +53,7 @@ > <th class="recall-enumeration">Available enumeration</th> > <th class="recall-itemtypes">Available item types</th> > <th class="recall-locations">Available locations</th> >- <th class="recall-date title-string">Earliest recall date</th> >+ <th class="recall-date">Earliest recall date</th> > <th class="recall-action no-sort"> </th> > </tr> > </thead> >@@ -117,7 +117,7 @@ > </ul> > </td> > <td class="recall-date"> >- <span title="[% recall.first_recall.created_date | html %]">[% recall.first_recall.created_date | $KohaDates %] in [% recall.first_recall.library.branchname | html %]</span> >+ <span data-order="[% recall.first_recall.created_date | html %]">[% recall.first_recall.created_date | $KohaDates %] in [% recall.first_recall.library.branchname | html %]</span> > </td> > <td class="recall-action"> > <form action="/cgi-bin/koha/recalls/recalls_to_pull.pl" method="post"> >@@ -152,7 +152,6 @@ > <script> > $(document).ready(function () { > $("#recalls-table").kohaTable({ >- columnDefs: [{ type: "title-string", targets: ["title-string"] }], > pagingType: "full_numbers", > }); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >index b289fa6b3ed..b17717d23de 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/recalls/recalls_waiting.tt >@@ -47,7 +47,7 @@ > <table id="recallswaiting-table"> > <thead > ><tr> >- <th class="recall-waitingdate title-string">Available since</th> >+ <th class="recall-waitingdate">Available since</th> > <th class="recall-title anti-the">Title</th> > <th class="recall-patron">Requested by</th> > <th class="recall-library">Pickup location</th> >@@ -57,7 +57,7 @@ > <tbody> > [% FOREACH recall IN recalls %] > <tr> >- <td class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td> >+ <td data-order="[% recall.waiting_date | html %]" class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td> > <td class="recall-title"> > <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% recall.biblio_id | uri %]"> > [% recall.biblio.title | html %] >@@ -100,7 +100,7 @@ > <table id="recallsover-table"> > <thead > ><tr> >- <th class="recall-waitingdate title-string">Available since</th> >+ <th class="recall-waitingdate">Available since</th> > <th class="recall-title anti-the">Title</th> > <th class="recall-patron">Requested by</th> > <th class="recall-library">Pickup location</th> >@@ -110,7 +110,7 @@ > <tbody> > [% FOREACH recall IN over %] > <tr> >- <td class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td> >+ <td data-order="[% recall.waiting_date | html %]" class="recall-waitingdate">[% recall.waiting_date | $KohaDates %]</td> > <td class="recall-title"> > [% INCLUDE 'biblio-title.inc' biblio=recall.biblio link = 1 %] > [% IF recall.biblio.author %]by [% recall.biblio.author | html %][% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >index 28d1cf5eee8..3ef80a1114d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js >@@ -222,34 +222,6 @@ $.fn.dataTableExt.oSort["num-html-desc"] = function (a, b) { > }); > })(); > >-/* Plugin to allow sorting on data stored in a span's title attribute >- * >- * Ex: <td><span title="[% ISO_date %]">[% formatted_date %]</span></td> >- * >- * In DataTables config: >- * "data": [ >- * { "type": "title-string" }, >- * ] >- * http://datatables.net/plug-ins/sorting#hidden_title_string >- */ >-jQuery.extend(jQuery.fn.dataTableExt.oSort, { >- "title-string-pre": function (a) { >- var m = a.match(/title="(.*?)"/); >- if (null !== m && m.length) { >- return m[1].toLowerCase(); >- } >- return ""; >- }, >- >- "title-string-asc": function (a, b) { >- return a < b ? -1 : a > b ? 1 : 0; >- }, >- >- "title-string-desc": function (a, b) { >- return a < b ? 1 : a > b ? -1 : 0; >- }, >-}); >- > (function () { > /* Plugin to allow text sorting to ignore articles > * >diff --git a/koha-tmpl/intranet-tmpl/prog/js/recalls.js b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >index 1da935810a9..5c6255b23d4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/recalls.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/recalls.js >@@ -128,7 +128,6 @@ $(document).ready(function () { > }); > > $("#recalls-table").kohaTable({ >- columnDefs: [{ type: "title-string", targets: ["title-string"] }], > order: [[1, "asc"]], > pagingType: "full_numbers", > }); >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27934
:
118182
|
118206
|
184921
| 184923