From 067c649ddb4f8a85a819175d1a42fdc15c424d4b Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 7 Feb 2014 14:06:50 -0500 Subject: [PATCH] Bug 11711 - Use new DataTables include in circ templates Content-Type: text/plain; charset="utf-8" Bug 10649 introduced a new include file for adding DataTables-related JavaScript assets. This patch adds use of this include file to all circ-related pages which use DataTables. Apply the patch and test the following pages to confirm that table sorting works correctly: - Circulation - The UseTablesortForCirc system preference must be enabled. - Check out to a patron with existing checkouts. Choose a patron who is a guarantor to another patron with checkouts in order to test the relatives' checkouts table. - The checkouts and relatives' checkouts tables have been modified to exclude articles when sorting of titles. - Hold ratios - The title column has been configured to exclude articles from sorting - Transfer to receive - Holds queue - The title column has been configured to exclude articles when sorting - The date column has been modified to use the title-string filter for sorting. An unformatted date is now passed from C4::HoldsQueue.pm to the template, where the KohaDates filter is used for formatting. Sorting is based on the unformatted date. - Holds awaiting pickup - The "available since" column has been configured for sorting on an unformatted date. waitingreserves.pl now passes the unformatted date to the template, and formatting is done using the KohaDates filter. - The title column has been configured to exclude articles when sorting. Edit: Rebased on current master following commit of Bug 11605 --- C4/HoldsQueue.pm | 1 - circ/waitingreserves.pl | 2 +- .../prog/en/modules/circ/circulation.tt | 8 +++----- .../prog/en/modules/circ/reserveratios.tt | 7 +++---- .../prog/en/modules/circ/transferstoreceive.tt | 6 ++---- .../prog/en/modules/circ/view_holdsqueue.tt | 20 +++++++++----------- .../prog/en/modules/circ/waitingreserves.tt | 14 ++++++++------ 7 files changed, 26 insertions(+), 32 deletions(-) diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm index 6c36402..63f159a 100755 --- a/C4/HoldsQueue.pm +++ b/C4/HoldsQueue.pm @@ -135,7 +135,6 @@ sub GetHoldsQueueItems { $sth->execute(@bind_params); my $items = []; while ( my $row = $sth->fetchrow_hashref ){ - $row->{reservedate} = format_date($row->{reservedate}); my $record = GetMarcBiblio($row->{biblionumber}); if ($record){ $row->{subtitle} = GetRecordValue('subtitle',$record,'')->[0]->{subfield}; diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index 1ec6b2d..fb7a3d1 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -105,7 +105,7 @@ foreach my $num (@getreserves) { $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'}; my $getborrower = GetMember(borrowernumber => $num->{'borrowernumber'}); my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} ); # using the fixed up itype/itemtype - $getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} ); + $getreserv{'waitingdate'} = $num->{'waitingdate'}; my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'}); ( $waiting_year, $waiting_month, $waiting_day ) = Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index e667bc3..1c536b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -14,9 +14,7 @@ [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'calendar.inc' %] [% IF ( UseTablesortForCirc ) %] - -[% INCLUDE 'datatables-strings.inc' %] -[% END %] +[% INCLUDE 'datatables.inc' %][% END %] [% INCLUDE 'timepicker.inc' %] @@ -47,7 +45,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false } ], "aoColumns": [ - { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %] + { "sType": "title-string" },{ "sType": "anti-the" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %] ], "bPaginate": false })); @@ -56,7 +54,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); "sDom": 't', "aaSorting": [], "aoColumns": [ - { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,{ "sType": "html" } + { "sType": "title-string" },{ "sType": "anti-the" },null,{ "sType": "title-string" },null,null,null,null,{ "sType": "html" } ], "bPaginate": false })); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt index 521a8d8..7672c26 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt @@ -3,9 +3,7 @@ [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'calendar.inc' %] - -[% INCLUDE 'datatables-strings.inc' %] - +[% INCLUDE 'datatables.inc' %] -[% INCLUDE 'datatables-strings.inc' %] - + +[% INCLUDE 'datatables.inc' %] -[% INCLUDE 'datatables-strings.inc' %] - + +[% INCLUDE 'datatables.inc' %] -[% INCLUDE 'datatables-strings.inc' %] - + +[% INCLUDE 'datatables.inc' %]