From bb5b39edbc0380929bb277a7c1fef56b392f867c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 10 Sep 2013 12:18:32 -0400 Subject: [PATCH] Bug 10868 - Use new DataTables include in catalog templates Bug 10649 introduced a new include file for adding DataTables-related JavaScript assets. This patch adds use of this include file to all catalog-related pages which use DataTables. The checkout history script has been altered to send unformatted dates to the template, and the template now uses the "title-string" sorting filter to enable sorting on unformatted dates. To test, view the following pages and confirm that table sorting is still working correctly: Catalog -> Biblio detail page Catalog -> Biblio detail page -> Checkout history Signed-off-by: Bernardo Gonzalez Kriegel Comment: Sorting works. No koha-qa errors. Signed-off-by: Jonathan Druart Note: On the issue history page: 1/ If the checkin on is empty (the item is currently checked out), the line is sorted in last. 2/ The Renewed column is not sorted by date. Before this patch, the sort was worse. --- catalogue/issuehistory.pl | 8 +------ .../prog/en/modules/catalogue/detail.tt | 8 +++---- .../prog/en/modules/catalogue/issuehistory.tt | 25 ++++++++++---------- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl index a5c4d0d..ffb8d02 100755 --- a/catalogue/issuehistory.pl +++ b/catalogue/issuehistory.pl @@ -26,7 +26,6 @@ use C4::Output; use C4::Circulation; # GetBiblioIssues use C4::Biblio; # GetBiblio GetBiblioFromItemNumber use C4::Search; # enabled_staff_search_views -use Koha::DateUtils; my $query = new CGI; my ( $template, $borrowernumber, $cookie ) = get_template_and_user( @@ -67,12 +66,7 @@ if ($itemnumber){ %{$biblio}, ); } -foreach (@{$issues}){ - $_->{date_due} = format_sqldatetime($_->{date_due}); - $_->{issuedate} = format_sqldatetime($_->{issuedate}); - $_->{returndate} = format_sqldatetime($_->{returndate}); - $_->{lastreneweddate} = format_sqldatetime($_->{lastreneweddate}); -} + $template->param( total => scalar @$issues, issues => $issues, 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 a9c042d..79ee4fa 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -22,7 +22,7 @@ Details for [% title |html %] [% FOREACH subtitl IN subtitle %] [% subtitl.subfield %][% END %] [% END %] -[% INCLUDE 'doc-head-close.inc' %] - - +[% INCLUDE 'datatables.inc' %] + [% INCLUDE 'browser-strings.inc' %] -[% INCLUDE 'datatables-strings.inc' %] - - -[% INCLUDE 'datatables-strings.inc' %] +[% INCLUDE 'datatables.inc' %]