Bugzilla – Attachment 22752 Details for
Bug 11209
Multi transport types: same messages are sent for a patron
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11209: Don't sent the same message for the same user the same day
Bug-11209-Dont-sent-the-same-message-for-the-same-.patch (text/plain), 1.84 KB, created by
Jonathan Druart
on 2013-11-06 14:27:04 UTC
(
hide
)
Description:
Bug 11209: Don't sent the same message for the same user the same day
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-11-06 14:27:04 UTC
Size:
1.84 KB
patch
obsolete
>From cb8870145287216eeb86cf7e73407884810b9dab Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 6 Nov 2013 14:56:35 +0100 >Subject: [PATCH] Bug 11209: Don't sent the same message for the same user the > same day > >For PREDUE messages, one message is sent to the message_queue table for >each items in advanced. >So the patron will receive the same message. > >The sms part for DUE and PREDUE should not contain dynamic parts, only a >standard message. >--- > C4/Letters.pm | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index faaf582..3db113e 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -1019,6 +1019,21 @@ $content > EOS > } > >+sub _is_duplicate { >+ my ( $message ) = @_; >+ my $dbh = C4::Context->dbh; >+ my $count = $dbh->selectrow_array(q| >+ SELECT COUNT(*) >+ FROM message_queue >+ WHERE message_transport_type = ? >+ AND borrowernumber = ? >+ AND letter_code = ? >+ AND CAST(time_queued AS date) = CAST(? AS date) >+ AND status="sent" >+ |, {}, $message->{message_transport_type}, $message->{borrowernumber}, $message->{letter_code}, $message->{time_queued} ); >+ return $count; >+} >+ > sub _send_message_by_sms { > my $message = shift or return; > my $member = C4::Members::GetMember( 'borrowernumber' => $message->{'borrowernumber'} ); >@@ -1029,6 +1044,12 @@ sub _send_message_by_sms { > return; > } > >+ if ( _is_duplicate( $message ) ) { >+ _set_message_status( { message_id => $message->{'message_id'}, >+ status => 'failed' } ); >+ return; >+ } >+ > my $success = C4::SMS->send_sms( { destination => $member->{'smsalertnumber'}, > message => $message->{'content'}, > } ); >-- >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 11209
:
22752
|
22762
|
23255
|
27827
|
27828
|
27919
|
27937
|
27938
|
27939