From 0e7b449ca8596fe38ac9c32048c07324e5f5ea13 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 18 Jan 2019 13:05:55 +0000 Subject: [PATCH] Bug 22134: (follow-up) Simplify check for expired patron This patch move the check for "is_expired" to the template and removes unnecessary code from the script. The page now correctly handles messages for patrons who are about to expire, as defined in the NotifyBorrowerDeparture preference. To test, apply the patch and locate a patron record which is expired. - On the patron detail page (members/moremember.pl) you should see a message at the top of the page. - In the body of the page, next to the expiration date information, you should see similar message and links. Select a patron who will expire within the period defined in NotifyBorrowerDeparture. - On the patron detail page you should see a message at the top of the page. - In the body of the page, next to the expiration date information, you should see similar message and links. Signed-off-by: Maryse Simard Signed-off-by: Katrin Fischer Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- .../prog/en/modules/members/moremember.tt | 16 +++++++++++++--- members/moremember.pl | 11 +---------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 5430b748c4..1dda5d00a1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -133,7 +133,7 @@ [% IF ( lost ) %]
  • Patron's card has been reported lost.
  • [% END %] - [% IF ( expired ) %] + [% IF ( patron.is_expired ) %]
  • Expiration: [% IF ( patron.dateexpiry ) %] @@ -141,7 +141,13 @@ [% ELSE %] Patron's card has expired. [% END %] - Renew or Edit details + Renew or Edit details +
  • + [% ELSIF ( patron.is_going_to_expire ) %] +
  • + Expiration: Patron's card will expire soon. + Patron's card expires on [% expiry | $KohaDates %] + Renew or Edit details
  • [% END %] @@ -439,12 +445,16 @@ Expiration date: [% IF ( was_renewed ) %] [% patron.dateexpiry | $KohaDates %] - [% ELSIF ( expired ) %] + [% ELSIF ( patron.is_expired ) %] [% patron.dateexpiry | $KohaDates %] Expired Renew or Edit details + [% ELSIF ( patron.is_going_to_expire ) %] + [% patron.dateexpiry | $KohaDates %] + Patron expires soon + Renew or Edit details [% ELSE %] [% patron.dateexpiry | $KohaDates %] [% END %] diff --git a/members/moremember.pl b/members/moremember.pl index e76dcd019b..faaa95e613 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -309,17 +309,8 @@ my ( $subtag, $region ) = split '-', $patron->lang; my $translated_language = C4::Languages::language_get_description( $subtag, $subtag, 'language' ); # if the expiry date is before today ie they have expired -if ( $patron->is_expired ) { +if ( $patron->is_expired || $patron->is_going_to_expire ) { $template->param( - expired => "1", - flagged => 1 - ); -} -# check for NotifyBorrowerDeparture -elsif ( $patron->is_going_to_expire ) { - # borrower card soon to expire warn librarian - $template->param( - "warndeparture" => $patron->dateexpiry, flagged => 1 ); } -- 2.39.5