Bugzilla – Attachment 24557 Details for
Bug 11244
notices ignoring the dateformat preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11244: notices ignoring the dateformat preference
Bug-11244-notices-ignoring-the-dateformat-preferen.patch (text/plain), 2.00 KB, created by
David Cook
on 2014-01-20 03:00:14 UTC
(
hide
)
Description:
Bug 11244: notices ignoring the dateformat preference
Filename:
MIME Type:
Creator:
David Cook
Created:
2014-01-20 03:00:14 UTC
Size:
2.00 KB
patch
obsolete
>From b683c13a42847a2df4601df9eb165e061901629d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 28 Nov 2013 15:01:55 +0100 >Subject: [PATCH] Bug 11244: notices ignoring the dateformat preference > >Overdue notices are using the MySQL date format and not the dateformat >in the system preferences. > >Test Plan: >1) Enable checkout notices for a patron, make sure the date due is in > the notice. >2) Check out an item to that patron, note the date is in the mysql > datetime format >3) Apply this patch >4) Check out another item to the patron, not the date is now in the > preferred date format. > >Signed-off-by: David Cook <dcook@prosentient.com.au> > >I love this patch! It is the best solution to this problem that I've >seen. I think it is set up to perfectly handle dates in the notices. > >Unfortunately, the $dateonly flag is backwards, so the time is stripped >from timestamps and 00:00:00 is added to dates without times. > >I'm adding a follow-up to reverse the setting of this flag. >--- > C4/Letters.pm | 8 ++++++++ > 1 files changed, 8 insertions(+), 0 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 2595369..0afd344 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -638,6 +638,14 @@ sub _parseletter { > #but excludes items. Removed unneeded global and lookahead. > > my $replacedby = defined ($val) ? $val : ''; >+ if ( $replacedby and $replacedby =~ m|^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$| ) { >+ # If the value is XXXX-YY-ZZ[ AA:BB:CC] we assume it is a date >+ my $dateonly = defined $1 ? 1 : 0; >+ eval { >+ $replacedby = output_pref({ dt => dt_from_string( $replacedby ), dateonly => $dateonly }); >+ }; >+ warn "$replacedby seems to be a date but an error occurs on generating it ($@)" if $@; >+ } > ($letter->{title} ) and do { > $letter->{title} =~ s/$replacetablefield/$replacedby/g; > $letter->{title} =~ s/$replacefield/$replacedby/g; >-- >1.7.7.4
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 11244
:
22912
|
22963
|
23213
|
23711
|
23965
|
24557
|
24558
|
29650
|
29651
|
30126
|
30127
|
31030