Bugzilla – Attachment 14903 Details for
Bug 9456
Add callnumber column to the cart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9456 [Alternate] Add callnumber column to the cart - Followup - Sort by callnumbers
Bug-9456-Alternate-Add-callnumber-column-to-the-ca.patch (text/plain), 4.38 KB, created by
Kyle M Hall (khall)
on 2013-01-28 19:40:42 UTC
(
hide
)
Description:
Bug 9456 [Alternate] Add callnumber column to the cart - Followup - Sort by callnumbers
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-01-28 19:40:42 UTC
Size:
4.38 KB
patch
obsolete
>From 06baabf220c30a4c490a97bd342038adf66439be Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 28 Jan 2013 14:37:42 -0500 >Subject: [PATCH] Bug 9456 [Alternate] Add callnumber column to the cart - Followup - Sort by callnumbers > >This patch removes the sub-tables for callnumber/location, and simple >surrounds them with a span tag. Sorting is enabled on the 'Items' column >which uses a custom sorting routine to sort the callnumbers. If the sort >is ascending, each column will be sorted by the highest ordered callnumber >for that row. Likewise, if the sort is descending the table will be sorted >by the lowest valued callnumber for that row. >--- > .../intranet-tmpl/prog/en/modules/basket/basket.tt | 67 +++++++++++++------- > 1 files changed, 44 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >index 85bfa20..d7ddd76 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >@@ -91,18 +91,51 @@ function placeHold () { > $(".hold").text(_("Place Hold")); > $("#downloadcartc").empty(); > yuiToolbar(); >+ >+ /* Define two custom functions (asc and desc) for string sorting */ >+ jQuery.fn.dataTableExt.oSort['callnumbers-asc'] = function(x,y) { >+ var x_array = x.split("<span>"); >+ var y_array = y.split("<span>"); >+ >+ /* Pop the first elements, they are empty strings */ >+ x_array.shift(); >+ y_array.shift(); >+ >+ x_array.sort(); >+ y_array.sort(); >+ >+ x = x_array.shift(); >+ y = y_array.shift(); >+ >+ return ((x < y) ? -1 : ((x > y) ? 1 : 0)); >+ }; >+ >+ jQuery.fn.dataTableExt.oSort['callnumbers-desc'] = function(x,y) { >+ var x_array = x.split("<span>"); >+ var y_array = y.split("<span>"); >+ >+ /* Pop the first elements, they are empty strings */ >+ x_array.shift(); >+ y_array.shift(); >+ >+ x_array.sort(); >+ y_array.sort(); >+ >+ x = x_array.pop(); >+ y = y_array.pop(); >+ >+ return ((x < y) ? 1 : ((x > y) ? -1 : 0)); >+ }; >+ > $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, { > "sDom": 't', > "aoColumnDefs": [ >- { "aTargets": [ 0,3 ], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [ 3 ], "sType": 'callnumbers' }, > ], > "aaSorting": [[ 1, "asc" ]], > "bPaginate": false > })); >- $(".itemstable").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sDom": 't', >- "bPaginate": false >- })); > > }); > >@@ -383,26 +416,14 @@ function yuiToolbar() { > > </td> > <td>[% BIBLIO_RESULT.description %]</td> >- <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %] >- <table class="itemstable"> >- <thead> >- <th>Location</th> >- <th>Call number</th> >- </thead> >- <tbody> >+ <td> >+ [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %] > [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] >- <tr> >- <td>[% ITEM_RESULT.branchname %] <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span></td> >- <td> >- [% IF ( ITEM_RESULT.itemcallnumber ) %] >- ([% ITEM_RESULT.itemcallnumber %]) >- [% END %] >- </td> >- </tr> >+ <span>[% ITEM_RESULT.itemcallnumber %] [% ITEM_RESULT.branchname %] <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span></span> > [% END %] >- </tbody> >- </table> >- [% ELSE %]This record has no items.[% END %] >+ [% ELSE %] >+ This record has no items. >+ [% END %] > </td> > </tr> > [% END %] >-- >1.7.2.5
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 9456
:
14779
|
14780
|
14782
|
14783
|
14861
|
14903
|
14904
|
15542
|
15544
|
15727
|
15728
|
15759
|
15760
|
15813
|
15844
|
15845
|
15846
|
15847
|
15848
|
15937
|
15938
|
15941
|
15943
|
15944
|
15949
|
15950
|
16630
|
16631
|
16734
|
17994
|
17995
|
17996
|
17997
|
19123
|
19124
|
19125
|
19126
|
19146
|
19844
|
19845
|
19846
|
19847
|
19848
|
19849
|
20341
|
20385
|
20386
|
20387
|
20388
|
20389
|
20390