From 631e218e992ab1fe41bd21832b6f55fabcd09271 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 7 Oct 2014 09:38:38 -0400 Subject: [PATCH] Bug 13036 - Exclude control columns from sorting on staff client catalog detail page Content-Type: text/plain; charset="utf-8" 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 --- .../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.7.9.5
Item typeCurrent location Home libraryHost recordsUsed inCourse ReservesEditEdit