From 7641b8c31b2772aa407a76b2c05d660ef6698421 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 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. Signed-off-by: Tomas Cohen Arazi --- .../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 89ddb87f2d..4395aff8b1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -205,24 +205,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'); } @@ -260,23 +259,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 @@ -551,7 +549,7 @@ function verify_images() { - [% IF (StaffDetailItemSelection) %][% END %] + [% IF (StaffDetailItemSelection) %][% END %] [% IF ( item_level_itypes ) %][% END %] @@ -569,7 +567,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 %] -- 2.39.5
Item typeCurrent location Home libraryHost recordsUsed inCourse ReservesEditEdit