Bugzilla – Attachment 25069 Details for
Bug 11696
Multi transport types: the print notices should be processed in first
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11696: The print notices should be processed in first
Bug-11696-The-print-notices-should-be-processed-in.patch (text/plain), 2.38 KB, created by
Jonathan Druart
on 2014-02-06 10:55:42 UTC
(
hide
)
Description:
Bug 11696: The print notices should be processed in first
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-02-06 10:55:42 UTC
Size:
2.38 KB
patch
obsolete
>From ca8a98aa04267a68f24b2850dc3e42af4bcd33fa Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 6 Feb 2014 11:41:35 +0100 >Subject: [PATCH] Bug 11696: The print notices should be processed in first > >This reorder avoids to sent a print notice with an email or sms template >is no email or sms is defined. > >Test plan: >Check print, sms and email for an overdue rule >Don't define an email address and generate an overdue for a user >Define 3 templates for the notice used >Launch the cronjob script and verify the print notice is generated using >the print template. >--- > C4/Overdues.pm | 8 ++++++++ > t/db_dependent/Overdues.t | 4 +++- > 2 files changed, 11 insertions(+), 1 deletion(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index d04ce1d..01d7f17 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -23,6 +23,8 @@ use strict; > #use warnings; FIXME - Bug 2505 > use Date::Calc qw/Today Date_to_Days/; > use Date::Manip qw/UnixDate/; >+use List::MoreUtils qw( uniq ); >+ > use C4::Circulation; > use C4::Context; > use C4::Accounts; >@@ -927,6 +929,12 @@ sub GetOverdueMessageTransportTypes { > while ( my $mtt = $sth->fetchrow ) { > push @mtts, $mtt; > } >+ >+ # Put 'print' in first if exists >+ # It avoid to sent a print notice with an email or sms template is no email or sms is defined >+ @mtts = uniq( 'print', @mtts ) >+ if grep {/^print$/} @mtts; >+ > return \@mtts; > } > >diff --git a/t/db_dependent/Overdues.t b/t/db_dependent/Overdues.t >index b023cfd..1a1d5f8 100644 >--- a/t/db_dependent/Overdues.t >+++ b/t/db_dependent/Overdues.t >@@ -38,6 +38,8 @@ $dbh->do(q| > ('', 'PT', 1, 'email'), > ('', 'PT', 2, 'email'), > ('', 'PT', 2, 'sms'), >+ ('', 'PT', 3, 'sms'), >+ ('', 'PT', 3, 'email'), > ('', 'PT', 3, 'print'), > ('', 'YA', 2, 'sms') > |); >@@ -69,7 +71,7 @@ $mtts = C4::Overdues::GetOverdueMessageTransportTypes('', 'PT', 2); > is_deeply( $mtts, ['email', 'sms'], 'GetOverdueMessageTransportTypes: second overdue is by email and sms for PT (default)' ); > > $mtts = C4::Overdues::GetOverdueMessageTransportTypes('', 'PT', 3); >-is_deeply( $mtts, ['print'], 'GetOverdueMessageTransportTypes: third overdue is by print for PT (default)' ); >+is_deeply( $mtts, ['print', 'sms', 'email'], 'GetOverdueMessageTransportTypes: third overdue is by print, sms and email for PT (default). With print in first.' ); > > > done_testing; >-- >1.7.10.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 11696
:
25069
|
25070
|
27530