From ee90821226ec54501d3be89b311c0e16549d3ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Tue, 26 Jan 2016 15:37:55 +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 checke 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. --- circ/returns.pl | 3 +++ koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/circ/returns.pl b/circ/returns.pl index f7fb52c..308998f 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; @@ -415,6 +416,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" ) { @@ -454,6 +456,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 5895b60..33eb2ad 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -212,6 +212,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 ) %] -- 1.7.10.4