Bugzilla – Attachment 14429 Details for
Bug 9348
Format dates in HOLD notices consistently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 9348 - Format dates in HOLD notices consistently
SIGNED-OFF-Bug-9348---Format-dates-in-HOLD-notices.patch (text/plain), 2.95 KB, created by
Owen Leonard
on 2013-01-04 17:23:15 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 9348 - Format dates in HOLD notices consistently
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-01-04 17:23:15 UTC
Size:
2.95 KB
patch
obsolete
>From bb466694c69649222ad3211402e4ba7fb3b9e5eb Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Fri, 4 Jan 2013 08:04:25 -0500 >Subject: [PATCH] [SIGNED-OFF] Bug 9348 - Format dates in HOLD notices > consistently >Content-Type: text/plain; charset="utf-8" > >Right now notices for holds awaiting pickup read something like this: > >You have a hold available for pickup as of 2011-02-12. >This hold will expire if it is not picked up before: 02/22/2011. >If you no longer need this item or have any questions please contact us > >Both dates should be formatting based on the dateformat system preference. > >Test Plan: >1) Apply patch >2) Set the HOLD notice to the following: > <<reserves.waitingdate>> / <<reserves.expirationdate>> >3) Place a hold for a patron >4) Enable the HOLD notice via email for that patron ( requires EnhancedMessaging ) >5) Check the item in >6) Go to the borrower's Notices tab, check the body of the new HOLD notice, > it should have two dates separated by a '/' in the format set by the dateformat > system preference. > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Patch works as advertised according to the test plan. >--- > C4/Letters.pm | 23 ++++++++--------------- > 1 file changed, 8 insertions(+), 15 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 36e6213..8873c46 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -29,6 +29,8 @@ use C4::Branch; > use C4::Log; > use C4::SMS; > use C4::Debug; >+use Koha::DateUtils; >+ > use Date::Calc qw( Add_Delta_Days ); > use Encode; > use Carp; >@@ -600,17 +602,15 @@ my %columns = (); > sub _parseletter { > my ( $letter, $table, $values ) = @_; > >- # TEMPORARY hack until the expirationdate column is added to reserves > if ( $table eq 'reserves' && $values->{'waitingdate'} ) { > my @waitingdate = split /-/, $values->{'waitingdate'}; > >- $values->{'expirationdate'} = C4::Dates->new( >- sprintf( >- '%04d-%02d-%02d', >- Add_Delta_Days( @waitingdate, C4::Context->preference( 'ReservesMaxPickUpDelay' ) ) >- ), >- 'iso' >- )->output(); >+ my $dt = dt_from_string(); >+ $dt->add( days => C4::Context->preference('ReservesMaxPickUpDelay') ); >+ $values->{'expirationdate'} = output_pref( $dt, undef, 1 ); >+ >+ $values->{'waitingdate'} = output_pref( dt_from_string( $values->{'waitingdate'} ), undef, 1 ); >+ > } > > if ($letter->{content} && $letter->{content} =~ /<<today>>/) { >@@ -619,13 +619,6 @@ sub _parseletter { > $letter->{content} =~ s/<<today>>/$todaysdate/go; > } > >- # and get all fields from the table >-# my $columns = $columns{$table}; >-# unless ($columns) { >-# $columns = $columns{$table} = C4::Context->dbh->selectcol_arrayref("SHOW COLUMNS FROM $table"); >-# } >-# foreach my $field (@$columns) { >- > while ( my ($field, $val) = each %$values ) { > my $replacetablefield = "<<$table.$field>>"; > my $replacefield = "<<$field>>"; >-- >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 9348
:
14412
|
14429
|
14565