Bugzilla – Attachment 32752 Details for
Bug 13036
Exclude control columns from sorting on staff client catalog detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13036 - Exclude control columns from sorting on staff client catalog detail page
Bug-13036---Exclude-control-columns-from-sorting-o.patch (text/plain), 4.43 KB, created by
Chris Cormack
on 2014-10-26 02:16:14 UTC
(
hide
)
Description:
Bug 13036 - Exclude control columns from sorting on staff client catalog detail page
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-10-26 02:16:14 UTC
Size:
4.43 KB
patch
obsolete
>From d1bdb75b27cce0b17d2d79eb28114922e5844ed8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 <chris@bigballofwax.co.nz> >--- > .../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() { > <table class="items_table"> > <thead> > <tr> >- [% IF (StaffDetailItemSelection) %]<th></th>[% END %] >+ [% IF (StaffDetailItemSelection) %]<th class="NoSort"></th>[% END %] > [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %] > <th>Current location</th> > <th>Home library</th> >@@ -560,7 +558,7 @@ function verify_images() { > [% IF ( hostrecords ) %]<th>Host records</th>[% END %] > [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %] > [% IF ( ShowCourseReserves ) %]<th>Course Reserves</th>[% END %] >- [% IF ( CAN_user_editcatalogue_edit_items ) %]<th>Edit</th>[% END %] >+ [% IF ( CAN_user_editcatalogue_edit_items ) %]<th class="NoSort">Edit</th>[% END %] > </tr> > </thead> > <tbody> >-- >2.1.0
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 13036
:
32038
|
32752
|
32768