Bugzilla – Attachment 20389 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 - Add callnumber column to the cart - QA Followup 2 - Sort on callnumber only
Bug-9456---Add-callnumber-column-to-the-cart---QA-.patch (text/plain), 3.21 KB, created by
Jonathan Druart
on 2013-08-16 07:33:13 UTC
(
hide
)
Description:
Bug 9456 - Add callnumber column to the cart - QA Followup 2 - Sort on callnumber only
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-08-16 07:33:13 UTC
Size:
3.21 KB
patch
obsolete
>From 4a065be964752858d1beaff47bfb0659f2c98fdb Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Mon, 22 Jul 2013 07:43:13 -0400 >Subject: [PATCH] Bug 9456 - Add callnumber column to the cart - QA Followup 2 > - Sort on callnumber only > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 30 ++++++++++++++++++++ > .../intranet-tmpl/prog/en/modules/basket/basket.tt | 2 +- > 2 files changed, 31 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js >index 0ff05c4..d90de2d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js >@@ -548,12 +548,22 @@ jQuery.fn.dataTableExt.oSort['callnumbers-asc'] = function(x,y) { > x_array.shift(); > y_array.shift(); > >+ x_array = jQuery.map( x_array, function( a ) { >+ return parse_callnumber( a ); >+ }); >+ y_array = jQuery.map( y_array, function( a ) { >+ return parse_callnumber( a ); >+ }); >+ > x_array.sort(); > y_array.sort(); > > x = x_array.shift(); > y = y_array.shift(); > >+ if ( !x ) { x = ""; } >+ if ( !y ) { y = ""; } >+ > return ((x < y) ? -1 : ((x > y) ? 1 : 0)); > }; > >@@ -565,11 +575,31 @@ jQuery.fn.dataTableExt.oSort['callnumbers-desc'] = function(x,y) { > x_array.shift(); > y_array.shift(); > >+ x_array = jQuery.map( x_array, function( a ) { >+ return parse_callnumber( a ); >+ }); >+ y_array = jQuery.map( y_array, function( a ) { >+ return parse_callnumber( a ); >+ }); >+ > x_array.sort(); > y_array.sort(); > > x = x_array.pop(); > y = y_array.pop(); > >+ if ( !x ) { x = ""; } >+ if ( !y ) { y = ""; } >+ > return ((x < y) ? 1 : ((x > y) ? -1 : 0)); > }; >+ >+function parse_callnumber ( html ) { >+ var array = html.split('<span class="callnumber">'); >+ if ( array[1] ) { >+ array = array[1].split('</span>'); >+ return array[0]; >+ } else { >+ return ""; >+ } >+} >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 38270f1..9743bf1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >@@ -326,7 +326,7 @@ function placeHold () { > <td> > [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %] > [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] >- <div><span class="nowrap"><strong>[% ITEM_RESULT.itemcallnumber %]</strong> [% ITEM_RESULT.branchname %] <span class="shelvingloc inline">[% ITEM_RESULT.location_description %]</span></span></div> >+ <div><span class="nowrap"><strong><span class="callnumber">[% ITEM_RESULT.itemcallnumber %]</span></strong> [% ITEM_RESULT.branchname %] <span class="shelvingloc inline">[% ITEM_RESULT.location_description %]</span></span></div> > [% END %] > [% ELSE %] > This record has no items. >-- >1.7.10.4
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