Bugzilla – Attachment 22963 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]
[SIGNED-OFF] Bug 11244 - notices ignoring the dateformat preference
SIGNED-OFF-Bug-11244---notices-ignoring-the-datefo.patch (text/plain), 2.14 KB, created by
Owen Leonard
on 2013-11-15 15:54:49 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 11244 - notices ignoring the dateformat preference
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-11-15 15:54:49 UTC
Size:
2.14 KB
patch
obsolete
>From 83454a68e45198162468086d69cf733fae1f0bef Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 13 Nov 2013 11:04:42 -0500 >Subject: [PATCH] [SIGNED-OFF] Bug 11244 - notices ignoring the dateformat > preference >Content-Type: text/plain; charset="utf-8" > >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: Owen Leonard <oleonard@myacpl.org> > >This results in correctly-formatted dates, but I think we need to think >about adding time to the output since we have hourly checkouts. >--- > C4/Letters.pm | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 7125148..d76f052 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -608,6 +608,15 @@ sub _parseletter_sth { > > sub _parseletter { > my ( $letter, $table, $values ) = @_; >+ my $dbh = C4::Context->dbh; >+ my $is_date_sql = q{ >+ SELECT COUNT(*) >+ FROM INFORMATION_SCHEMA.COLUMNS >+ WHERE TABLE_NAME = ? >+ AND COLUMN_NAME = ? >+ AND TABLE_SCHEMA = ? >+ AND DATA_TYPE IN ( 'date', 'datetime', 'timestamp' ) >+ }; > > if ( $table eq 'reserves' && $values->{'waitingdate'} ) { > my @waitingdate = split /-/, $values->{'waitingdate'}; >@@ -634,6 +643,10 @@ sub _parseletter { > #but excludes items. Removed unneeded global and lookahead. > > my $replacedby = defined ($val) ? $val : ''; >+ >+ my ( $is_date ) = $dbh->selectrow_array( $is_date_sql, undef, ( $table, $field, C4::Context->config("database") ) ); >+ $replacedby = output_pref({ dt => dt_from_string( $replacedby ), dateonly => 1 }) if ( $replacedby && $is_date ); >+ > ($letter->{title} ) and do { > $letter->{title} =~ s/$replacetablefield/$replacedby/g; > $letter->{title} =~ s/$replacefield/$replacedby/g; >-- >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 11244
:
22912
|
22963
|
23213
|
23711
|
23965
|
24557
|
24558
|
29650
|
29651
|
30126
|
30127
|
31030