Bugzilla – Attachment 15159 Details for
Bug 9329
Wrong message for already expired cards
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9329: Wrong message for already expired cards
Bug-9329-Wrong-message-for-already-expired-cards.patch (text/plain), 3.64 KB, created by
Jonathan Druart
on 2013-02-08 11:25:41 UTC
(
hide
)
Description:
Bug 9329: Wrong message for already expired cards
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-02-08 11:25:41 UTC
Size:
3.64 KB
patch
obsolete
>From fda6bee89591e6a9e9b37cc3a5e9b6af437f7f33 Mon Sep 17 00:00:00 2001 >From: Adrien Saurat <adrien.saurat@biblibre.com> >Date: Fri, 28 Dec 2012 16:37:59 +0100 >Subject: [PATCH] Bug 9329: Wrong message for already expired cards > >Previously users would see the same message whether their card was about >to expire or was already expired. This patch adds a new message to >handle cards which are about to expire, following the >NotifyBorrowerDeparture system preference. > >TEST PLAN : > >The best way to test would to have at the same time : >- a SQL client to change the expiry date of a borrower >- an OPAC session opened for the same patron. > >Case 1: expiry date is set in the future >-> no warning > >Case 2: expiry date is set in the near future (within the >"NotifyBorrowerDeparture" system preference range) >-> a warning says the card will expire on **date** > >Case 3: expiry date is set in the past >-> before patch, same warning as Case 2 >-> after patch, new warning indicating that the card has expired > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Added description to the patch and copied test plan from the bug report. >Patch passes test plan. > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 6 ++++++ > opac/opac-user.pl | 21 ++++++++++++--------- > 2 files changed, 18 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >index f9b7ba5..96f6e8d 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >@@ -92,6 +92,12 @@ $.tablesorter.addParser({ > </div> > [% END %] > >+ [% IF ( BORROWER_INF.warnexpired ) %] >+ <div class="dialog alert" id="warnexpired"> >+ <strong>Please note:</strong><span> Your card has expired. Please contact the library for more information.</span> >+ </div> >+ [% END %] >+ > [% IF ( patron_flagged ) %] > <div class="dialog alert"> > <ul> >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 2b8563c..c5a7f5a 100755 >--- a/opac/opac-user.pl >+++ b/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}, >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9329
:
14314
|
14316
| 15159