Bugzilla – Attachment 20969 Details for
Bug 10868
Use new DataTables include in catalog templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10868 - Use new DataTables include in catalog templates
Bug-10868---Use-new-DataTables-include-in-catalog-.patch (text/plain), 6.58 KB, created by
Owen Leonard
on 2013-09-10 16:29:32 UTC
(
hide
)
Description:
Bug 10868 - Use new DataTables include in catalog templates
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-09-10 16:29:32 UTC
Size:
6.58 KB
patch
obsolete
>From 366d0d291b885a3b6cce322b43933e0a7c039112 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 10 Sep 2013 12:18:32 -0400 >Subject: [PATCH] Bug 10868 - Use new DataTables include in catalog 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 >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 >--- > 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 %] > </title> >-[% INCLUDE 'doc-head-close.inc' %]<script type="text/JavaScript" language="JavaScript"> >+[% INCLUDE 'doc-head-close.inc' %]<script type="text/JavaScript"> > //<![CDATA[ > // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html > function verify_images() { >@@ -63,15 +63,13 @@ function verify_images() { > //]]> > </script> > <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> >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> >+[% INCLUDE 'datatables.inc' %] >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js"></script> > [% INCLUDE 'browser-strings.inc' %] > <!--[if lt IE 9]> > <script type="text/javascript" src="[% interface %]/lib/shims/json2.min.js"></script> > <![endif]--> > <script type="text/javascript" src="[% interface %]/js/browser.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> > <script type="text/javascript"> > //<![CDATA[ > var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >index 5f8da2e..4cd11ff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt >@@ -1,16 +1,15 @@ >+[% USE KohaDates %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Catalog › Checkout history for [% title |html %]</title> > [% INCLUDE 'doc-head-close.inc' %] > <link rel="stylesheet" href="[% themelang %]/css/datatables.css" /> >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> >-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >+[% INCLUDE 'datatables.inc' %] > <script type="text/javascript" id="js"> > $(document).ready(function() { >- [% IF (dateformat == 'metric') %] >- dt_add_type_uk_date(); >- [% END %] > $("#table_issues").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumns": [ >+ null,null,null,null,{ "sType": "title-string" },{ "sType": "title-string" },{ "sType": "title-string" } >+ ], > "aaSorting": [[ 4, "desc" ]] > }) > ); >@@ -61,25 +60,25 @@ $(document).ready(function() { > > [% END %]</td> > <td>[% IF ( issue.renewals ) %] >- Yes[% IF ( issue.lastreneweddate ) %], <small>last on: [% issue.lastreneweddate %]</small> >+ Yes[% IF ( issue.lastreneweddate ) %], <small>last on: [% issue.lastreneweddate |$KohaDates with_hours => 1 %]</small> > [% END %] > [% ELSE %] > No > [% END %]</td> > <td>[% IF ( issue.issuedate ) %] >- [% issue.issuedate %] >+ <span title="[% issue.issuedate %]">[% issue.issuedate |$KohaDates with_hours => 1 %]</span> > [% ELSE %] >- >+ <span title="0000-00-00"></span> > [% END %]</td> > <td>[% IF ( issue.date_due ) %] >- [% issue.date_due %] >+ <span title="[% issue.date_due %]">[% issue.date_due |$KohaDates with_hours => 1 %]</span> > [% ELSE %] >- >+ <span title="0000-00-00"></span> > [% END %]</td> > <td>[% IF ( issue.returndate ) %] >- [% issue.returndate %] >+ <span title="[% issue.returndate %]">[% issue.returndate |$KohaDates with_hours => 1 %]</span> > [% ELSE %] >- >+ <span title="0000-00-00"></span> > [% END %]</td> > </tr> > [% END %] >-- >1.7.9.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 10868
:
20969
|
21260
|
21271