@@ -, +, @@
in the OPAC
- You should see a message which says so, including a link to
the discharge notice.
- Log in to the OPAC as a patron with a manual restriction and confirm
that the correct notice is displayed.
---
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 14 ++++++++++----
opac/opac-user.pl | 6 ++++++
2 files changed, 16 insertions(+), 4 deletions(-)
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt
@@ -106,10 +106,16 @@ Using this account is not recommended because some parts of Koha will not functi
[% IF ( userdebarred ) %]
- - Please note: Your account has been frozen.
- [% IF ( BORROWER_INFO.debarredcomment ) %] Comment: [% END %]
- [% IF ( BORROWER_INFO.userdebarreddate ) %] End date: [% BORROWER_INFO.userdebarreddate | $KohaDates %][% END %]
- Usually the reason for freezing an account is old overdues or damage fees. If your account shows to be clear, please contact the library. Go to your account page
+ [% IF ( discharge_available ) %]
+ -
+ Please note: Your account is frozen because it has been discharged. Get your discharge
+
+ [% ELSE %]
+ - Please note: Your account has been frozen.
+ [% IF ( BORROWER_INFO.debarredcomment ) %] Comment: [% END %]
+ [% IF ( BORROWER_INFO.userdebarreddate ) %] End date: [% BORROWER_INFO.userdebarreddate | $KohaDates %][% END %]
+ Usually the reason for freezing an account is old overdues or damage fees. If your account shows to be clear, please contact the library. Go to your account page
+ [% END %]
[% END %]
[% IF ( BORROWER_INFO.gonenoaddress ) %]
- Please note: According to our records, we don't have up-to-date contact information. Please contact the library.
--- a/opac/opac-user.pl
+++ a/opac/opac-user.pl
@@ -38,6 +38,7 @@ use Koha::DateUtils;
use Koha::Holds;
use Koha::Database;
use Koha::Patron::Messages;
+use Koha::Patron::Discharge;
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
@@ -98,6 +99,11 @@ if ($debar) {
if ( $debar ne "9999-12-31" ) {
$borr->{'userdebarreddate'} = $debar;
}
+ my $available = Koha::Patron::Discharge::count({
+ borrowernumber => $borrowernumber,
+ validated => 1,
+ });
+ $template->param( 'discharge_available' => $available && Koha::Patron::Discharge::is_discharged({borrowernumber => $borrowernumber}) );
}
if ( $userdebarred || $borr->{'gonenoaddress'} || $borr->{'lost'} ) {
--