[Koha-patches] [PATCH] Bug 11724 - Make Funds/Status on suggestions page sortable/searchable

Owen Leonard oleonard at myacpl.org
Fri Mar 14 20:09:15 CET 2014


The fund and status columns on the suggestions page are not sortable or
searchable. This patch makes them so.

This patch also amends the DataTables configuration to use class-based
targeting for sorting types as was decided on the koha-devel list. The
table markup has been modified accordingly.

To test you must have existing suggestions. Apply the patch and go to
Acquisitions -> Suggestions. View the table of existing suggestions and
confirm that the funds and status columns are sortable and searchable.

Confirm that the title column correctly ignores articles when sorting.
---
 .../prog/en/modules/suggestion/suggestion.tt       |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
index 15c56c1..41242ad 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt
@@ -54,10 +54,8 @@ $(document).ready(function() {
     });
     $(".sorted").dataTable($.extend(true, {}, dataTablesDefaults, {
         "aoColumnDefs": [
-            { "aTargets": [ 0, -1, -2 ], "bSortable": false, "bSearchable": false },
-        ],
-        "aoColumns": [
-            null,{ "sType": "anti-the" },null,null,null,null,null
+            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
+            { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
         ],
         "sPaginationType": "four_button"
     }));
@@ -474,7 +472,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o
     <table id="[% suggestion.suggestiontype %]t" class="sorted">
         <thead>
             <tr><th> </th>
-            <th>Suggestion</th>
+            <th class="anti-the">Suggestion</th>
             <th>Suggested by - on</th>
             <th>Managed by - on</th>
             <th>Library</th>
-- 
1.7.9.5


More information about the Koha-patches mailing list