Bugzilla – Attachment 165242 Details for
Bug 23781
Recalls notices and messaging preferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23781: SMS notices and messaging preferences for recalls
Bug-23781-SMS-notices-and-messaging-preferences-fo.patch (text/plain), 6.97 KB, created by
Aleisha Amohia
on 2024-04-21 23:15:03 UTC
(
hide
)
Description:
Bug 23781: SMS notices and messaging preferences for recalls
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2024-04-21 23:15:03 UTC
Size:
6.97 KB
patch
obsolete
>From 00021113b58b71a34c983dff0bd2819131dff1fd Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Sun, 21 Apr 2024 23:13:33 +0000 >Subject: [PATCH] Bug 23781: SMS notices and messaging preferences for recalls > >This patch adds recalls notices (pick up a waiting recall or return a >requested recall) to the messaging preferences. > >To test: >1) Apply Bug 19532 >2) Apply this bug >3) Update database, restart services >4) Ensure UseRecalls syspref is enabled and values have been set in the >circulation rules for recalls >5) Go to a borrower (Person A) account page in the Intranet or the OPAC >6) Go to messaging preferences >7) Notice there are now preferences for two recalls notices >8) Select email as a preference >9) Find a different borrower (Person B) and set their messaging >preferences to SMS >10) Check out any item to Person B >11) Go to the OPAC logged in as Person A and find that item >12) Recall the item >13) In the terminal, look at the message_queue in the database. There >should be a 'RETURN_RECALLED_ITEM' recall notice sent to Person B via SMS >14) Go back to the Intranet and check in the item. Confirm the recall >when checking in >15) Look at the message_queue in the database again. There should be a >'PICKUP_RECALLED_ITEM' recall notice sent to Person A via email. >16) Confirm tests pass >t/db_dependent/Koha/Recall.t >t/db_dependent/Koha/Recalls.t >17) Confirm that 'Unknown' doesn't show in the the staff and OPAC messaging preferences tables when UseRecalls syspref is disabled > >Sponsored-by: Toi Ohomai Institute of Technology >--- > Koha/Recall.pm | 6 +++++- > Koha/Recalls.pm | 7 ++++++- > .../prog/en/includes/messaging-preference-form.inc | 3 +++ > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt | 3 +++ > 4 files changed, 17 insertions(+), 2 deletions(-) > >diff --git a/Koha/Recall.pm b/Koha/Recall.pm >index 6f3678f691f..a060a5bf3a0 100644 >--- a/Koha/Recall.pm >+++ b/Koha/Recall.pm >@@ -358,7 +358,11 @@ sub set_waiting { > }, > ); > >- C4::Message->enqueue($letter, $self->patron, 'email'); >+ my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences( >+ { borrowernumber => $self->patron_id, message_name => 'Recall_Waiting' } ); >+ while ( my ( $transport, $letter_code ) = each %{ $messaging_preferences->{transports} } ) { >+ C4::Message->enqueue( $letter, $self->patron, $transport ); >+ } > > return $self; > } >diff --git a/Koha/Recalls.pm b/Koha/Recalls.pm >index 29be68ce05a..9f6d14e3640 100644 >--- a/Koha/Recalls.pm >+++ b/Koha/Recalls.pm >@@ -167,7 +167,12 @@ sub add_recall { > }, > ); > >- C4::Message->enqueue( $letter, $checkout->patron, 'email' ); >+ my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences( >+ { borrowernumber => $checkout->borrowernumber, message_name => 'Recall_Requested' } ); >+ >+ while ( my ( $transport, $letter_code ) = each %{ $messaging_preferences->{transports} } ) { >+ C4::Message->enqueue( $letter, $checkout->patron, $transport ); >+ } > > $item = Koha::Items->find( $itemnumber ); > # add to statistics table >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >index 6e08c2ee160..b3cadaa4355 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc >@@ -18,6 +18,7 @@ > [% FOREACH messaging_preference IN messaging_preferences %] > [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] > [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %] >+ [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %] > <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]"> > <td>[% IF ( messaging_preference.Item_Due ) %]<span>Item due</span> > [% ELSIF ( messaging_preference.Advance_Notice ) %]<span>Advance notice</span> >@@ -34,6 +35,8 @@ > [% ELSIF ( messaging_preference.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span> > [% ELSIF ( messaging_preference.Ill_update ) %]<span>Interlibrary loan updated</span> > [% ELSIF ( messaging_preference.Auto_Renewals ) %]<span>Auto renewal</span> >+ [% ELSIF ( messaging_preference.Recall_Waiting ) %]<span>Recall awaiting pickup</span> >+ [% ELSIF ( messaging_preference.Recall_Requested ) %]<span>Return recalled item</span> > [% ELSE %]<span>Unknown</span> > [% END %] > </td> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >index 1fa2975e9f6..fe6405aa759 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >@@ -60,6 +60,7 @@ > [% FOREACH messaging_preference IN messaging_preferences %] > [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] > [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %] >+ [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %] > <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]"> > <td>[% IF ( messaging_preference.Item_Due ) %]<span>Item due</span> > [% ELSIF ( messaging_preference.Advance_Notice ) %]<span>Advance notice</span> >@@ -76,6 +77,8 @@ > [% ELSIF ( messaging_preference.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span> > [% ELSIF ( messaging_preference.Ill_update ) %]<span>Interlibrary loan updated</span> > [% ELSIF ( messaging_preference.Auto_Renewals ) %]<span>Auto renewal</span> >+ [% ELSIF ( messaging_preference.Recall_Waiting ) %]<span>Recall awaiting pickup</span> >+ [% ELSIF ( messaging_preference.Recall_Requested ) %]<span>Return recalled item</span> > [% ELSE %]<span>Unknown</span> [% END %]</td> > [% IF ( messaging_preference.takes_days ) %] > <td><select class="input-mini" name="[% messaging_preference.message_attribute_id | html %]-DAYS" aria-label="Choose how many days in advance you wish to receive the message"> >-- >2.30.2
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 23781
:
93905
|
104984
|
131702
|
132044
|
140242
|
140244
|
147107
|
148248
|
148260
|
150430
|
150441
|
155346
|
158696
|
158697
|
158698
|
159013
|
159014
|
159015
|
162377
|
162378
|
162379
|
162380
|
165240
|
165241
|
165242
|
165593
|
165614
|
165615
|
165616
|
165617
|
169201
|
169202
|
169203
|
169204
|
169205