@@ -, +, @@ OPAC depending on if patron was discharged --- Koha/Patron.pm | 16 ++++++++++++++++ koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) --- a/Koha/Patron.pm +++ a/Koha/Patron.pm @@ -39,6 +39,7 @@ use Koha::Holds; use Koha::Old::Checkouts; use Koha::Patron::Attributes; use Koha::Patron::Categories; +use Koha::Patron::Discharge; use Koha::Patron::HouseboundProfile; use Koha::Patron::HouseboundRole; use Koha::Patron::Images; @@ -693,6 +694,21 @@ sub is_going_to_expire { return 0; } +=head3 is_discharged + +my $is_discharged = $patron->is_discharged; + +Returns if the patron is currently discharged (1) or not (0). + +=cut + +sub is_discharged { + my ($self) = @_; + + my $is_discharged = Koha::Patron::Discharge->is_discharged( { borrowernumber => $self->borrowernumber } ); + return $is_discharged; +} + =head3 set_password $patron->set_password({ password => $plain_text_password [, skip_validation => 1 ] }); --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc @@ -119,7 +119,11 @@ [% ELSE %]
  • [% END %] - ask for a discharge
  • + [% IF ( logged_in_user.is_discharged ) %] + download discharge confirmation + [% ELSE %] + ask for a discharge + [% END %] [% END %] [% IF Koha.Preference( 'ILLModule' ) == 1 %] --