Bugzilla – Attachment 5854 Details for
Bug 6978
Notify the user on his account page when it is almost expired.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Corrected patch
0001-Notify-the-user-on-his-account-page-when-his-account.patch (text/plain), 3.09 KB, created by
Frédérick Capovilla
on 2011-10-12 14:16:25 UTC
(
hide
)
Description:
Corrected patch
Filename:
MIME Type:
Creator:
Frédérick Capovilla
Created:
2011-10-12 14:16:25 UTC
Size:
3.09 KB
patch
obsolete
>From 087b8188a25fb28540a60a8cc4df8d9fceb46a4d Mon Sep 17 00:00:00 2001 >From: =?utf-8?q?Fr=C3=A9d=C3=A9rick=20Capovilla?= <frederick.capovilla@libeo.com> >Date: Wed, 5 Oct 2011 15:12:04 -0400 >Subject: [PATCH] Notify the user on his account page when his account is almost expired > >--- > koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 6 ++++++ > opac/opac-user.pl | 21 +++++++++++++++++++++ > 2 files changed, 27 insertions(+), 0 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 9ba6c05..4d33bd4 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt >@@ -79,6 +79,12 @@ $.tablesorter.addParser({ > > [% IF ( patronupdate ) %]<div class="dialog message"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %] > >+ [% IF ( BORROWER_INF.warndeparture ) %] >+ <div class="dialog alert"> >+ <strong>Please note:</strong><span> Your card will expire on [% BORROWER_INF.warndeparture %]. Please contact the library if you wish to renew your subscription.</span> >+ [% IF ( BORROWER_INF.returnbeforeexpiry ) %]<span> Also note that you must return all checked out items before your card expires.</span>[% END %] >+ </div> >+ [% END %] > > [% IF ( BORROWER_INF.flagged ) %] > <div class="dialog alert"> >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index e99e557..03c9e81 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -38,6 +38,12 @@ use C4::Branch; # GetBranches > > use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE'; > >+use Date::Calc qw( >+ Today >+ Add_Delta_Days >+ Date_to_Days >+); >+ > my $query = new CGI; > > BEGIN { >@@ -64,6 +70,9 @@ my $patronupdate = $query->param('patronupdate'); > # get borrower information .... > my ( $borr ) = GetMemberDetails( $borrowernumber ); > >+my ( $today_year, $today_month, $today_day) = Today(); >+my ($warning_year, $warning_month, $warning_day) = split /-/, $borr->{'dateexpiry'}; >+ > for (qw(dateenrolled dateexpiry dateofbirth)) { > ($borr->{$_}) and $borr->{$_} = format_date($borr->{$_}); > } >@@ -99,6 +108,18 @@ $borr->{'amountoutstanding'} = sprintf "%.02f", $borr->{'amountoutstanding'}; > my @bordat; > $bordat[0] = $borr; > >+# Warningdate is the date that the warning starts appearing >+if ( 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.5.6.5 >
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 6978
:
5722
|
5854
|
5856