@@ -, +, @@
---
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 6 ++++++
opac/opac-user.pl | 21 ++++++++++++---------
2 files changed, 18 insertions(+), 9 deletions(-)
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
+++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
@@ -89,6 +89,12 @@ $.tablesorter.addParser({
[% END %]
+ [% IF ( BORROWER_INF.warnexpired ) %]
+
+ Please note: Your card has expired. Please contact the library for more information.
+
+ [% END %]
+
[% IF ( patron_flagged ) %]
--- a/opac/opac-user.pl
+++ a/opac/opac-user.pl
@@ -125,17 +125,20 @@ my @bordat;
$bordat[0] = $borr;
# Warningdate is the date that the warning starts appearing
-if ( $borr->{dateexpiry} && C4::Context->preference('NotifyBorrowerDeparture') &&
- Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
- Date_to_Days( $today_year, $today_month, $today_day ) )
-{
- # borrower card soon to expire, warn the borrower
- $borr->{'warndeparture'} = $borr->{dateexpiry};
- if (C4::Context->preference('ReturnBeforeExpiry')){
- $borr->{'returnbeforeexpiry'} = 1;
- }
+if ( $borr->{dateexpiry} && Date_to_Days( $today_year, $today_month, $today_day ) > Date_to_Days( $warning_year, $warning_month, $warning_day ) ) {
+ $borr->{'warnexpired'} = 1;
+}
+elsif ( $borr->{dateexpiry} && C4::Context->preference('NotifyBorrowerDeparture') &&
+ Date_to_Days(Add_Delta_Days($warning_year, $warning_month, $warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
+ Date_to_Days( $today_year, $today_month, $today_day ) ) {
+ # borrower card soon to expire, warn the borrower
+ $borr->{'warndeparture'} = $borr->{dateexpiry};
+ if (C4::Context->preference('ReturnBeforeExpiry')){
+ $borr->{'returnbeforeexpiry'} = 1;
+ }
}
+
$template->param( BORROWER_INFO => \@bordat,
borrowernumber => $borrowernumber,
patron_flagged => $borr->{flagged},
--