Bugzilla – Attachment 16909 Details for
Bug 9479
The member notices page does not display dates in the syspref format
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 9479: The member notices page doesn't display dates in the syspref format
PASSED-QA-Bug-9479-The-member-notices-page-doesnt-.patch (text/plain), 3.04 KB, created by
Katrin Fischer
on 2013-03-26 22:02:48 UTC
(
hide
)
Description:
[PASSED QA] Bug 9479: The member notices page doesn't display dates in the syspref format
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2013-03-26 22:02:48 UTC
Size:
3.04 KB
patch
obsolete
>From da83027f2cd7fa1699072a06a33189252226b325 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 24 Jan 2013 11:50:08 +0100 >Subject: [PATCH] [PASSED QA] Bug 9479: The member notices page doesn't > display dates in the syspref format > >In order to let the KohaDates plugin display a datetime, this patch >modify this plugin. >Now it uses Koha::DateUtils instead of C4::Dates. > >Test plan: >- check that the date format on the member notices page > (members/notices.pl) is displayed according your syspref dateformat. >- check that existing dates are always in the good format (without the > hours) e.g. acqui/histsearch.pl, acqui/basket.pl, etc. >- Modify your syspref and recheck the previous pages > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >This is a nice addition, and works according to the test plan. A nice >follow-up would be to create a system pref for formatting times >(12/24hr). > >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Fixed a tab in notices.tt to make QA script happy. >--- > Koha/Template/Plugin/KohaDates.pm | 23 ++++++++++++-------- > .../prog/en/modules/members/notices.tt | 3 ++- > 2 files changed, 16 insertions(+), 10 deletions(-) > >diff --git a/Koha/Template/Plugin/KohaDates.pm b/Koha/Template/Plugin/KohaDates.pm >index 00656fa..884c3e5 100644 >--- a/Koha/Template/Plugin/KohaDates.pm >+++ b/Koha/Template/Plugin/KohaDates.pm >@@ -17,21 +17,26 @@ package Koha::Template::Plugin::KohaDates; > # with Koha; if not, write to the Free Software Foundation, Inc., > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >-use strict; >-use warnings; >+use Modern::Perl; > > use Template::Plugin::Filter; > use base qw( Template::Plugin::Filter ); >-use warnings; >-use strict; > >-use C4::Dates; >+use Koha::DateUtils; >+our $DYNAMIC = 1; >+ >+sub init { >+ my $self = shift; >+ $self->{ _DYNAMIC } = 1; >+ return $self; >+} > > sub filter { >- my ($self,$text) = @_; >- return "" if not $text; >- my $date = C4::Dates->new( $text, 'iso' ); >- return $date->output("syspref"); >+ my ( $self, $text, $args, $config ) = @_; >+ return "" unless $text; >+ $config->{with_hours} //= 0; >+ my $dt = dt_from_string( $text, 'iso' ); >+ return output_pref( $dt, undef, !$config->{with_hours} ); > } > > 1; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >index 59848c2..1d7ec31 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >@@ -1,3 +1,4 @@ >+[% USE KohaDates %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Sent notices for [% INCLUDE 'patron-title.inc' %]</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -72,7 +73,7 @@ > [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted > [% ELSE %][% QUEUED_MESSAGE.status %][% END %] > </td> >- <td>[% QUEUED_MESSAGE.time_queued %]</td> >+ <td>[% QUEUED_MESSAGE.time_queued | $KohaDates with_hours => 1 %]</td> > </tr> > [% END %] > </tbody> >-- >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 9479
:
14811
|
14859
|
16722
| 16909 |
16910