From 486298a80efd55418a618dd89d388f1d0e123bf3 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Mon, 13 Apr 2020 21:29:37 +0000 Subject: [PATCH] Bug 14262: [DOES NOT WORK] Change discharge tab heading in 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(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 9948f8c35c..0711a61a01 100644 --- a/Koha/Patron.pm +++ b/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 ] }); diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc index f1cdfa5ab2..86e6f099f9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ b/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 %] -- 2.11.0