Bugzilla – Attachment 17828 Details for
Bug 9084
Dates in notices should be formatted according to dateformat system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9084 - Dates in notices should be formatted according to dateformat system preference
Bug-9084---Dates-in-notices-should-be-formatted-ac.patch (text/plain), 2.52 KB, created by
Mason James
on 2013-04-30 02:48:30 UTC
(
hide
)
Description:
Bug 9084 - Dates in notices should be formatted according to dateformat system preference
Filename:
MIME Type:
Creator:
Mason James
Created:
2013-04-30 02:48:30 UTC
Size:
2.52 KB
patch
obsolete
>From 218d7d846fb273d20c41ff0b979b76645fdd52dc Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Tue, 30 Apr 2013 14:45:53 +1200 >Subject: [PATCH] Bug 9084 - Dates in notices should be formatted according to dateformat system preference >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit >Content-Type: text/plain; charset="utf-8" > >to test⦠> >- apply patch > >- choose a patron to checkout item > >- in 'Patron messaging preferences' section, of patrons 'details' page - tick 'email' box for 'Item checkout' >---------------------------------------- >Patron messaging preferences > Days in advance Email >Item checkout - x <==== >Hold filled - - >Item due - - >Item check-in - - >---------------------------------------- > >- cut/paste below notice, for CHECKOUT, in 'Home ⺠Tools ⺠Notices & Slips ⺠Modify notice' > >bib: <<biblio.title>> due: <<issues.date_due>> issue: <<issues.issuedate>> return: <<issues.returndate>> > >- delete issues and message_queue tables, before test >mysql> truncate issues; >mysql> truncate message_queue; > >- issue a test item to patron > >- check message_queue table for notice, with correctly formatted dates, with stripped time > >mysql> select content from message_queue\G >content: bib: TESTAMENTS OF LOVE due: 20/05/2013 issue: 30/04/2013 return: 30/04/2013 >1 row in set (0.00 sec) >--- > C4/Letters.pm | 18 +++++++++++++++++- > 1 files changed, 17 insertions(+), 1 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index b8e2722..f3f35a9 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -617,7 +617,23 @@ sub _parseletter { > $letter->{content} =~ s/<<today>>/$todaysdate/go; > } > >- while ( my ($field, $val) = each %$values ) { >+ my @dates = qq| >+ issues.date_due issues.returndate issues.issuedate issues.lastreneweddate >+ old_issues.date_due old_issues.returndate old_issues.issuedate old_issues.lastreneweddate >+ |; >+ >+ while ( my ( $field, $val ) = each %$values ) { >+ >+ # Bug 9084 - Dates in notices should be formatted >+ # according to dateformat system preference >+ my $match = "$table.$field"; >+ if ( grep /$match/, @dates ) { >+ >+ # display syspref formatted date, and strip time >+ my $dateonly = 1; >+ $val = output_pref( dt_from_string($val), undef, undef, $dateonly ); >+ } >+ > my $replacetablefield = "<<$table.$field>>"; > my $replacefield = "<<$field>>"; > $val =~ s/\p{P}$// if $val && $table=~/biblio/; >-- >1.7.2.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 9084
:
17524
|
17525
|
17526
|
17827
| 17828