Bugzilla – Attachment 42346 Details for
Bug 12426
Allow resending of emails from the notices tab in the patron account
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 12426: Allow resending of messages from the notices tab in the patron account
Signed-off-Bug-12426-Allow-resending-of-messages-f.patch (text/plain), 3.74 KB, created by
Marc Véron
on 2015-09-03 15:34:42 UTC
(
hide
)
Description:
[Signed-off] Bug 12426: Allow resending of messages from the notices tab in the patron account
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2015-09-03 15:34:42 UTC
Size:
3.74 KB
patch
obsolete
>From 0f6a3a9db34afadf3a2fa45e9de5826151c85bce Mon Sep 17 00:00:00 2001 >From: Lari Taskula <larit@student.uef.fi> >Date: Thu, 3 Sep 2015 14:42:02 +0300 >Subject: [PATCH] [Signed-off] Bug 12426: Allow resending of messages from the > notices tab in the patron account >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch adds a link 'Resend' under a notice in 'failed' status >in the Patron's Notices tab. > >By clicking the link, we will request notices.pl with parameter >"resendnotice=XXXXX" where XXXXX is message_id. In notices.pl, >we then check whether the given message is actually in 'failed' >status. If so, we use the C4::Letters::_set_message_status() to >change the status of the message into 'pending'. This way it >will be processed again by the cronjob process_message_queue.pl. > >To test, find/create a Patron that has failed notices in message_queue: >1. Enable EnchancedMessagingPreferences system preference >2. Go to Patrons -> Notices >3. In the Notice column, click the title of the failed message >4. Observe that there is nothing for resending the failed message >5. Apply patch. >6. Reload Notices page and repeat step 3 >7. Observe that there is now a link "Resend" in the Status-column >8. Click Resend >9. Observe that the message gets into 'pending' status > >Followed test plan. Works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > .../intranet-tmpl/prog/en/modules/members/notices.tt | 4 ++-- > members/notices.pl | 14 ++++++++++++++ > 2 files changed, 16 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >index 72cb466..d46438e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt >@@ -16,7 +16,7 @@ > > $(".notice").hide(); > $(".notice-title").click(function(e){ >- $(this).next(".notice").toggle(); >+ $(this).closest("tr").children().children(".notice").toggle(); > e.preventDefault(); > }); > >@@ -70,7 +70,7 @@ > <td> > [% IF ( QUEUED_MESSAGE.status == 'sent' ) %]sent > [% ELSIF ( QUEUED_MESSAGE.status == 'pending' ) %]pending >- [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed >+ [% ELSIF ( QUEUED_MESSAGE.status == 'failed' ) %]failed <div class="notice"><a href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber %]&resendnotice=[% QUEUED_MESSAGE.message_id %]" title="Attempt to resend the notice">Resend</a></div> > [% ELSIF ( QUEUED_MESSAGE.status == 'deleted' ) %]deleted > [% ELSE %][% QUEUED_MESSAGE.status %][% END %] > </td> >diff --git a/members/notices.pl b/members/notices.pl >index be1e37c..54575f9 100755 >--- a/members/notices.pl >+++ b/members/notices.pl >@@ -53,6 +53,20 @@ $template->param( picture => 1 ) if $picture; > # Getting the messages > my $queued_messages = C4::Letters::GetQueuedMessages({borrowernumber => $borrowernumber}); > >+if ($input->param('resendnotice')) { >+ foreach my $message (@$queued_messages){ >+ if ($message->{message_id} == $input->param('resendnotice')) { >+ last unless $message->{status} eq "failed"; >+ >+ $message->{status} = 'pending' if (C4::Letters::_set_message_status( { >+ message_id => $message->{message_id}, >+ status => 'pending' >+ } ) > 0); >+ last; >+ } >+ } >+} >+ > if (C4::Context->preference('ExtendedPatronAttributes')) { > my $attributes = GetBorrowerAttributes($borrowernumber); > $template->param( >-- >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 12426
:
42295
|
42346
|
42401
|
42409
|
42418
|
42512
|
42615
|
42618
|
42620
|
42621
|
47563
|
47564
|
47565
|
47588
|
47589
|
47590
|
47956
|
47957
|
47958
|
48049
|
48570
|
48571
|
48572
|
48573