Bugzilla – Attachment 15845 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]
[SIGNED-OFF] Bug 9456 - Add callnumber column to the cart
Bug-9456---Add-callnumber-column-to-the-cart.patch (text/plain), 6.14 KB, created by
Kyle M Hall (khall)
on 2013-03-04 13:57:22 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 9456 - Add callnumber column to the cart
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-03-04 13:57:22 UTC
Size:
6.14 KB
patch
obsolete
>From 994f3d1eddb335fb4e3672d7bdfba2b6ba22ed33 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 25 Jan 2013 09:57:30 -0500 >Subject: [PATCH] Bug 9456 - Add callnumber column to the cart > >This patch adds call-number sorting to the staff client cart. Sortining 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. > >Signed-off-by: Delaye Stephane <stephane.delaye@biblibre.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../intranet-tmpl/prog/en/modules/basket/basket.tt | 102 ++++++++++++++++---- > 1 files changed, 84 insertions(+), 18 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 cb1f573..5719c68 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >@@ -9,9 +9,35 @@ > @import url([% themelang %]/css/print.css); > </style> > [% ELSE %][% INCLUDE 'doc-head-close.inc' %] >+ <style type="text/css"> >+ td table { >+ font-size: 85%; >+ border: 0; >+ } >+ td table th:first-child, >+ td table th.sorting:first-child, >+ td table th.sorting_asc:first-child, >+ td table th.sorting_desc:first-child { >+ border-right : 1px solid #99BEC9; >+ } >+ td table th, >+ td table th.sorting, >+ td table th.sorting_asc, >+ td table th.sorting_desc { >+ background-color: #E6F0F2; >+ border-color: #99BEC9; >+ border-width: 0px 0px 1px 0px; >+ } >+ td table td { >+ border-width: 0px 0px 1px 0px; >+ border-color: #B8D7E0; >+ } >+ </style> > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> >- <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script> >- <script type="text/javascript"> >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> >+[% INCLUDE 'datatables-strings.inc' %] >+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> <script type="text/javascript"> > //<![CDATA[ > > function placeHold () { >@@ -63,9 +89,52 @@ function placeHold () { > $(".hold").text(_("Place Hold")); > $("#downloadcartc").empty(); > yuiToolbar(); >- $("#itemst").tablesorter({ >- headers: { 0: { sorter: false }} >- }); >+ >+ /* 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 ], "bSortable": false, "bSearchable": false }, >+ { "aTargets": [ 3 ], "sType": 'callnumbers' }, >+ ], >+ "aaSorting": [[ 1, "asc" ]], >+ "bPaginate": false >+ })); >+ > }); > //]]> > </script> >@@ -287,15 +356,11 @@ function placeHold () { > [% UNLESS ( print_basket ) %]<th> </th>[% END %] > <th>Title</th> > <th>Item type</th> >- <th>Location</th> >+ <th>Items</th> > </tr></thead> > > [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %] >- [% IF ( BIBLIO_RESULT.even ) %] >- <tr class="highlight"> >- [% ELSE %] > <tr> >- [% END %] > [% UNLESS ( print_basket ) %]<td> > <input type="checkbox" value="[% BIBLIO_RESULT.biblionumber %]" name="bib[% BIBLIO_RESULT.biblionumber %]" id="bib[% BIBLIO_RESULT.biblionumber %]" onclick="selRecord(value,checked);" /> > >@@ -317,14 +382,15 @@ function placeHold () { > > </td> > <td>[% BIBLIO_RESULT.description %]</td> >- <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %][% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] >- <p> >- [% ITEM_RESULT.branchname %] [% ITEM_RESULT.location_description %] >- [% IF ( ITEM_RESULT.itemcallnumber ) %] >- ([% ITEM_RESULT.itemcallnumber %]) >- [% END %] >- </p> >- [% END %][% ELSE %]This record has no items.[% END %]</td> >+ <td> >+ [% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %] >+ [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %] >+ <span>[% ITEM_RESULT.itemcallnumber %] [% ITEM_RESULT.branchname %] <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span></span> >+ [% END %] >+ [% ELSE %] >+ This record has no items. >+ [% END %] >+ </td> > </tr> > [% END %] > </table></form> >-- >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