From 475abae5800aae177b4bc6f24a5a6648db2a79ee Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 7 Oct 2014 09:38:38 -0400 Subject: [PATCH] [PASSED QA] Bug 13036 - Exclude control columns from sorting on staff client catalog detail page The checkbox and "edit" column in the table of holdings on the staff client detail page should be excluded from sorting since there is no useful data to sort. This patch does so. To test, view the detail page for a title which has multiple items. Confirm that sorting works correctly. Test under the following conditions: - with the StaffDetailItemSelection system preference enabled and disabled. - as users who do and do not have cataloging item edit privileges Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Works as desrcibed, no problems found. --- .../prog/en/modules/catalogue/detail.tt | 30 ++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index e10d95f..63c64d8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -196,24 +196,23 @@ function verify_images() { browser.show(); function activate_filters(id) { - table = $("#" + id + " table"); + var table = $("#" + id + " table"); if (table.length == 1) { filters_row = table.find('thead tr.filters_row'); - [% IF StaffDetailItemSelection %] var aoColumns = []; filters_row.find('th').each(function() { - aoColumns.push('text'); + if(this.className === "NoSort"){ + aoColumns.push(null); + } else { + aoColumns.push('text'); + } }); - aoColumns[0] = null; - [% END %] if (table.find('thead tr.columnFilter').length == 0) { table.dataTable().columnFilter({ 'sPlaceHolder': 'head:after' - [% IF StaffDetailItemSelection %] , 'aoColumns': aoColumns - [% END %] }); filters_row.addClass('columnFilter'); } @@ -251,23 +250,22 @@ function verify_images() { var ids = ['holdings', 'otherholdings']; for (var i in ids) { var id = ids[i]; - table = $('#' + id + ' table'); + var table = $('#' + id + ' table'); // Duplicate the table header row for columnFilter thead_row = table.find('thead tr'); clone = thead_row.clone().addClass('filters_row'); + clone.find("th.NoSort").html(''); thead_row.before(clone); // Enable sorting table.dataTable($.extend(true, {}, dataTablesDefaults, { 'sDom': 't', 'bPaginate': false, - 'bAutoWidth': false - [% IF StaffDetailItemSelection %] - , "aoColumnDefs": [ - { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false } - ] - [% END %] + 'bAutoWidth': false, + "aoColumnDefs": [ + { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] } + ] })); // Show a link to activate filtering @@ -542,7 +540,7 @@ function verify_images() { - [% IF (StaffDetailItemSelection) %][% END %] + [% IF (StaffDetailItemSelection) %][% END %] [% IF ( item_level_itypes ) %][% END %] @@ -560,7 +558,7 @@ function verify_images() { [% IF ( hostrecords ) %][% END %] [% IF ( analyze ) %][% END %] [% IF ( ShowCourseReserves ) %][% END %] - [% IF ( CAN_user_editcatalogue_edit_items ) %][% END %] + [% IF ( CAN_user_editcatalogue_edit_items ) %][% END %] -- 1.9.1
Item typeCurrent location Home libraryHost recordsUsed inCourse ReservesEditEdit