Bugzilla – Attachment 25181 Details for
Bug 11736
Use new DataTables include in Koha news templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11736 - Use new DataTables include in Koha news templates
Bug-11736---Use-new-DataTables-include-in-Koha-new.patch (text/plain), 4.54 KB, created by
Owen Leonard
on 2014-02-10 19:21:43 UTC
(
hide
)
Description:
Bug 11736 - Use new DataTables include in Koha news templates
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-02-10 19:21:43 UTC
Size:
4.54 KB
patch
obsolete
>From eefe413ef59350e7f0eb8e38fd2db4dff45cc6a5 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 10 Feb 2014 14:13:11 -0500 >Subject: [PATCH] Bug 11736 - Use new DataTables include in Koha news > 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 the Koha >news page. > >To test you should have existing news items with varying creation and >expiration dates. Apply the patch and confirm that table sorting works >correctly for all settings of the dateformat system preference. > >C4::NewsChannels.pm has been modified so that it now passes an >unformatted date to the template, where the KohaDates plugin is used to >apply the correct formatting. Sorting is based on the unformatted date. > >Also corrected: Capitalization errors. >--- > C4/NewsChannels.pm | 2 -- > .../prog/en/modules/tools/koha-news.tt | 17 +++++++++-------- > 2 files changed, 9 insertions(+), 10 deletions(-) > >diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm >index 0201729..7c34239 100644 >--- a/C4/NewsChannels.pm >+++ b/C4/NewsChannels.pm >@@ -116,8 +116,6 @@ sub get_opac_news { > my $count = 0; > while (my $row = $sth->fetchrow_hashref) { > if ((($limit) && ($count < $limit)) || (!$limit)) { >- $row->{'newdate'} = format_date($row->{'newdate'}); >- $row->{'expirationdate'} = format_date($row->{'expirationdate'}); > push @opac_news, $row; > } > $count++; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >index b92f63a..411ab1f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tt >@@ -1,20 +1,21 @@ >+[% USE KohaDates %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › News</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] > [% IF ( opac_news_count ) %] >- <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" /> >- <script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script> >- [% INCLUDE 'datatables-strings.inc' %] >- <script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script> >+ <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+ [% INCLUDE 'datatables.inc' %] > <script type="text/javascript">//<![CDATA[ >- [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %] > $(document).ready(function() { > $("#newst").dataTable($.extend(true, {}, dataTablesDefaults, { > "sDom": 't', > "aoColumnDefs": [ > { "aTargets": [ 0,-1,-2 ], "bSortable": false, "bSearchable": false } > ], >+ "aoColumns": [ >+ null,null,null,{ "sType": "title-string" },{ "sType": "title-string" },null,null,null >+ ], > "bPaginate": false > })); > }); >@@ -52,7 +53,7 @@ tinyMCE.init({ > [% INCLUDE 'cat-search.inc' %] > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF ( add_form ) %]<a href="/cgi-bin/koha/tools/koha-news.pl">News</a> › [% IF ( id ) %] >-Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div> >+Edit news item[% ELSE %]Add news item[% END %][% ELSE %]News[% END %]</div> > > [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %] > <div id="bd"> >@@ -165,8 +166,8 @@ Edit News Item[% ELSE %]Add News Item[% END %][% ELSE %]News[% END %]</div> > </td> > > <td>[% opac_new.number %]</td> >- <td>[% opac_new.newdate %]</td> >- <td>[% opac_new.expirationdate %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</td> >+ <td><span title="[% opac_new.newdate %]">[% opac_new.newdate | $KohaDates %]</span></td> >+ <td><span title="[% opac_new.expirationdate %]">[% opac_new.expirationdate | $KohaDates %] [% IF ( opac_new.expired ) %](<span class="expired">expired</span>)[% END %]</span></td> > <td>[% opac_new.title %]</td> > <td> > [% opac_new.new %] >-- >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 11736
:
25181
|
25591
|
25605