Bug 14883: Librarians are not warned if patron is restricted when placing holds
authorKyle M Hall <kyle@bywatersolutions.com>
Wed, 23 Sep 2015 14:44:20 +0000 (10:44 -0400)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 25 Sep 2015 18:37:35 +0000 (15:37 -0300)
Librarians should be warned that a patron is restricted when placing
holds, as they are warned that a patron's acount has expired.

Test Plan:
1) Apply this patch
2) Add a restriction for a patron
3) Attempt to place a hold for that patron
4) Note the notice at the top notifying you that the patron is restricted

Works as expected.
Signed-off-by: Marc VĂ©ron <veron@veron.ch>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
reserve/request.pl

index d251752..fd05887 100644 (file)
@@ -333,6 +333,10 @@ function checkMultiHold() {
     <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a>'s <strong>account has expired</strong></li>
     [% END %]
 
+    [% IF restricted %]
+    <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]#reldebarments">[% borrowerfirstname %] [% borrowersurname %]</a> <strong>has restrictions</strong></li>
+    [% END %]
+
     [% IF amount_outstanding && Koha.Preference('maxoutstanding') && amount_outstanding > Koha.Preference('maxoutstanding') %]
     <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a> <strong>owes [% amount_outstanding | format('%.2f') %]</strong></li>
     [% END %]
index fefe4b0..4544ad2 100755 (executable)
@@ -44,6 +44,7 @@ use C4::Utils::DataTables::Members;
 use C4::Members;
 use C4::Search;                # enabled_staff_search_views
 use Koha::DateUtils;
+use Koha::Borrower::Debarments qw(IsDebarred);
 
 my $dbh = C4::Context->dbh;
 my $sth;
@@ -176,6 +177,7 @@ if ($borrowernumber_hold && !$action) {
                 diffbranch          => $diffbranch,
                 messages            => $messages,
                 warnings            => $warnings,
+                restricted          => IsDebarred($borrowerinfo->{'borrowernumber'}),
                 amount_outstanding  => GetMemberAccountRecords($borrowerinfo->{borrowernumber}),
     );
 }