From 46607f1098153008698023b538ab1391e782a6fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Thu, 24 Mar 2016 16:06:30 +0100 Subject: [PATCH] Bug 9543 - Show patrons messaging subscription on holds notification Display an information about a patron's messaging preferences if an item is checked in where the patron has put a hold. To test: - Apply patch - Make sure that SMS driver and TalkingTech sysprefs are defined to enable SMS and Phone preferences for users (SMS driver can be a dummy value) - Place a hold for a patron - Set patron's messaging preferences to different choices (including none) - Check in the item that is on hold (it has not to be checked out for the test - Verify that below the message "Hold found (item is already waiting") an information appears about the patron's messaging preferences. Signed-off-by: Nick Clemens Signed-off-by: Chris Kirby Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher --- circ/returns.pl | 4 +++- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/circ/returns.pl b/circ/returns.pl index 49899f0c4b..380454367c 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -44,6 +44,7 @@ use C4::Reserves; use C4::Biblio; use C4::Items; use C4::Members; +use C4::Members::Messaging; use C4::Branch; # GetBranches GetBranchName use C4::Koha; # FIXME : is it still useful ? use C4::RotatingCollections; @@ -429,7 +430,7 @@ if ( $messages->{'ResFound'}) { my $reserve = $messages->{'ResFound'}; my $branchname = $branches->{ $reserve->{'branchcode'} }->{'branchname'}; my $borr = C4::Members::GetMember( borrowernumber => $reserve->{'borrowernumber'} ); - + my $holdmsgpreferences = C4::Members::Messaging::GetMessagingPreferences( { borrowernumber => $reserve->{'borrowernumber'}, message_name => 'Hold_Filled' } ); if ( $reserve->{'ResFound'} eq "Waiting" or $reserve->{'ResFound'} eq "Reserved" ) { if ( $reserve->{'ResFound'} eq "Waiting" ) { $template->param( @@ -468,6 +469,7 @@ if ( $messages->{'ResFound'}) { borrowernumber => $reserve->{'borrowernumber'}, itemnumber => $reserve->{'itemnumber'}, reservenotes => $reserve->{'reservenotes'}, + bormessagepref => $holdmsgpreferences->{'transports'}, ); } # else { ; } # error? } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 6a9f868a70..17a20d4eb9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -238,6 +238,17 @@ $(document).ready(function () { [% borcity %] [% borzip %] [% IF ( borphone ) %]
  • [% borphone %]
  • [% END %] [% IF ( boremail ) %]
  • [% boremail %]
  • [% END %] + [% IF ( bormessagepref ) %] +
  • Patron is notified: + [% FOREACH key IN bormessagepref.keys %] + [% IF ( key == 'email' ) %] Email. [% END %] + [% IF ( key == 'phone' ) %] Phone. [% END %] + [% IF ( key == 'sms' ) %] SMS. [% END %] + [% END %] +
  • + [% ELSE %] +
  • Patron is not notified
  • + [% END %] [% IF ( debarred ) %]
  • Patron is RESTRICTED
  • [% END %] [% IF ( gonenoaddress ) %]
  • Patron's address is in doubt
  • [% END %] [% IF ( transfertodo ) %] -- 2.39.5