Bugzilla – Attachment 49473 Details for
Bug 15775
Show message on OPAC summary if holds are blocked due to fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15775 - User should know when they are blocked from checkouts on OPAC + Translatability fixes for OPAC Summary page
Bug-15775---User-should-know-when-they-are-blocked.patch (text/plain), 12.45 KB, created by
Aleisha Amohia
on 2016-03-23 22:03:56 UTC
(
hide
)
Description:
Bug 15775 - User should know when they are blocked from checkouts on OPAC + Translatability fixes for OPAC Summary page
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2016-03-23 22:03:56 UTC
Size:
12.45 KB
patch
obsolete
>From 6257c4fe89743238745f9881dedb649e318acc3b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Marc=20V=C3=A9ron?= <veron@veron.ch> >Date: Tue, 15 Dec 2015 00:11:01 +0100 >Subject: [PATCH] Bug 15775 - User should know when they are blocked from > checkouts on OPAC + Translatability fixes for OPAC Summary > page > >EDIT: Fixing merge conflicts >EDIT: Fix from Comment 11 / Comment 12 > >When a user has been blocked from checkouts in the staff client for having too many fines, they will now see a message about this in the OPAC > >To test: >- This patch will be easiest to test if you keep three tabs open - system preferences, a patron detail page, and OPAC summary page >- Set some system preferences: > - OPACFineNoRenewals = 2 > - noissuescharge = 4 > - OpacRenewalAllowed = Allow >- Set up a patron with fines of $3 >- Log in to the OPAC and verify the message from patch from Bug 15374, saying the user cannot renew books. Confirm link to accounts page works. >- Set OpacRenewalAllowed = Don't allow >- Refresh OPAC Summary and confirm the message disappears >- Set OpacRenewalAllowed = Allow >- Give the patron total fines of $5 (add $2) >- Refresh OPAC Summary and verify message appears saying user is BLOCKED from checkouts. Confirm link to accounts page works >- Set OpacRenewalAllowed = Don't allow >- Refresh OPAC Summary and confirm message is still there > >Translability tests: >- Log in to OPAC > - with blocked /debarred user (with and without comment and date) > - with user who has to much fines > - with user who has his card marked as lost > - with user with an account that is about to expire > - with user with expired account > - with user with uncertain address information > - with user who has got a circulation message (from checkout page) > - with user who has a OPAC note >- Verify that information is correct and displays nicely and that links > in messages work >- Carefully examine code >- Search for regressions > >Sponsored-by: Catalyst IT >--- > .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 33 +++++++++++++------- > opac/opac-user.pl | 18 ++++++++--- > 2 files changed, 36 insertions(+), 15 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index d45222e..8141eb4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -1,6 +1,7 @@ > [% USE Koha %] > [% USE KohaDates %] > [% USE Branches %] >+[% USE Price %] > > [% INCLUDE 'doc-head-open.inc' %] > <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your library home</title> >@@ -33,7 +34,7 @@ > [% FOREACH message IN patron_messages %] > <li> > <strong>[% message.message %]</strong><br> >- <i>Written on [% message.message_date | $KohaDates %] by [% Branches.GetName(message.branchcode) %]</i> >+ <i>[% message.message_date | $KohaDates %] [% message.branchname %]</i> > </li> > [% END %] > >@@ -90,16 +91,26 @@ > <div class="alert"> > <ul> > [% IF ( userdebarred ) %] >- <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen[% IF ( BORROWER_INFO.userdebarreddate ) %] until <span id="userdebarred_date">[% BORROWER_INFO.userdebarreddate | $KohaDates %]</span>[% END %][% IF ( BORROWER_INFO.debarredcomment ) %] with the comment <span id="userdebarred_comment">"[% BORROWER_INFO.debarredcomment %]"</span>[% END %]. Usually the reason for freezing an account is old overdues or damage fees. If <a href="/cgi-bin/koha/opac-account.pl">your account page</a> shows your account to be clear, please contact the library.</li> >+ <li id="userdebarred"><strong>Please note:</strong> Your account has been frozen. >+ [% IF ( BORROWER_INFO.debarredcomment ) %] Comment: <span id="userdebarred_comment">"[% BORROWER_INFO.debarredcomment %]"</span>[% END %] >+ [% IF ( BORROWER_INFO.userdebarreddate ) %] End date: <span id="userdebarred_date">[% BORROWER_INFO.userdebarreddate | $KohaDates %]</span>[% END %] >+ <em>Usually the reason for freezing an account is old overdues or damage fees. If your account shows to be clear, please contact the library.</em> <a href="/cgi-bin/koha/opac-account.pl">Go to your account page</a></li> > [% END %] > [% IF ( BORROWER_INFO.gonenoaddress ) %] >- <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date [% UNLESS OPACPatronDetails %]<a href="/cgi-bin/koha/opac-memberentry.pl">contact information</a>[% ELSE %]contact information[% END %] on file. Please contact the library[% IF OPACPatronDetails %] or use the <a href="/cgi-bin/koha/opac-memberentry.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)[% END %].</li> >+ <li id="gonenoaddress"><strong>Please note:</strong> According to our records, we don't have up-to-date contact information. Please contact the library. >+ <a href="/cgi-bin/koha/opac-memberentry.pl">[% IF ( Koha.Preference('OPACPatronDetails') ) %]Update your contact information[% ELSE %]Go to your contact information[% END %]</a> >+ [% IF ( Koha.Preference('OPACPatronDetails') ) %]<em>(Please note: there may be a delay in restoring your account if you submit online.)</em>[% END %] >+ </li> > [% END %] > [% IF ( BORROWER_INFO.lost ) %] >- <li id="lost"><strong>Please note: </strong> Your library card has been marked as lost or stolen. If this is an error, please contact the library.</li> >+ <li id="lost"><strong>Please note: </strong> Your library card has been marked as lost or stolen. <em>If this is an error, please contact the library.</em></li> > [% END %] >- [% IF ( renewal_blocked_fines ) && ( OpacRenewalAllowed ) %] >- <li id="renewal_blocked_fines"><strong>Please note: </strong> Since you have <a href="/cgi-bin/koha/opac-account.pl">[% IF renewal_blocked_fines != "0.00" %] more than <span id="renewal_blocked_fines_amount">[% renewal_blocked_fines %]</span> in [% END %] fines</a>, you cannot renew your books online. Please pay your fines if you wish to renew your books.</li> >+ [% IF ( checkouts_blocked_amount ) %] >+ <li id="renewal_blocked_fines"><strong>Please note: </strong>Your account has been BLOCKED from checkouts. Reason: [% IF ( checkouts_blocked_amount ) > 0 %]Your fines exceed <span id="renewal_blocked_fines_amount">[% checkouts_blocked_amount | $Price %]</span>.[% END %] >+ <em>Please pay your fines if you wish to check out books.</em> <a href="/cgi-bin/koha/opac-account.pl">Go to your account page</a></li> >+ [% ELSIF ( renewal_blocked_fines.defined ) && ( OpacRenewalAllowed ) %] >+ <li id="renewal_blocked_fines"><strong>Please note: </strong>You cannot renew your books online. Reason: [% IF ( renewal_blocked_fines ) > 0 %]Your fines exceed <span id="renewal_blocked_fines_amount">[% renewal_blocked_fines | $Price %]</span>.[% ELSE %]You have fines.[% END %] >+ <em>Please pay your fines if you wish to renew your books.</em> <a href="/cgi-bin/koha/opac-account.pl">Go to your account page</a></li> > [% END %] > </ul> > </div> >@@ -114,9 +125,9 @@ > [% IF relatives %]<li><a href="#opac-user-relative-issues">Relatives' checkouts</a></li>[% END %] > [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count %])</a></li>[% END %] > [% IF ( OPACFinesTab ) %] >- [% IF ( BORROWER_INFO.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INFO.amountoutstanding %])</a></li>[% END %] >- [% IF ( BORROWER_INFO.amountoverzero ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INFO.amountoutstanding %])</a></li>[% END %] >- [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% BORROWER_INFO.amountoutstanding %])</a></li>[% END %] >+ [% IF ( BORROWER_INFO.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INFO.amountoutstanding | $Price %])</a></li>[% END %] >+ [% IF ( BORROWER_INFO.amountoverzero ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INFO.amountoutstanding | $Price %])</a></li>[% END %] >+ [% IF ( BORROWER_INFO.amountlessthanzero ) %]<li><a href="#opac-user-fines">Credits ([% BORROWER_INFO.amountoutstanding | $Price %])</a></li>[% END %] > [% END %] > [% IF ( RESERVES.count ) %]<li><a href="#opac-user-holds">Holds ([% RESERVES.count %])</a></li>[% END %] > </ul> >@@ -299,7 +310,7 @@ > <tbody> > <tr> > <td>You currently owe fines and charges amounting to:</td> >- <td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INFO.amountoutstanding %]</a></td> >+ <td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INFO.amountoutstanding | $Price %]</a></td> > </tr> > </tbody> > </table> >@@ -326,7 +337,7 @@ > <thead><tr><th colspan="2">Amount</th></tr></thead> > <tbody> > <tr> >- <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INFO.amountoutstanding %]</a></td> >+ <td>You have a credit of:</td><td><a href="/cgi-bin/koha/opac-account.pl">[% BORROWER_INFO.amountoutstanding | $Price %]</a></td> > </tr> > </tbody> > </table> >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 0828739..c68f7fd 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -118,9 +118,18 @@ if ( C4::Context->preference('OpacRenewalAllowed') > $borr->{'flagged'} = 1; > $canrenew = 0; > $template->param( >- renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ), >- renewal_blocked_fines_amountoutstanding => >- sprintf( '%.02f', $borr->{amountoutstanding} ), >+ renewal_blocked_fines => $no_renewal_amt, >+ renewal_blocked_fines_amountoutstanding => $borr->{amountoutstanding}, >+ ); >+} >+ >+my $checkoutsblockedamount = C4::Context->preference( 'noissuescharge' ); >+$checkoutsblockedamount ||=0; >+if ( C4::Context->preference( 'noissuescharge' ) && $borr->{amountoutstanding} > $checkoutsblockedamount ) { >+ $borr->{'flagged'} = 1; >+ $canrenew = 0; >+ $template->param( >+ checkouts_blocked_amount => sprintf ( '%.02f', $checkoutsblockedamount ), > ); > } > >@@ -129,7 +138,8 @@ if ( $borr->{'amountoutstanding'} < 0 ) { > $borr->{'amountoutstanding'} = -1 * ( $borr->{'amountoutstanding'} ); > } > >-$borr->{'amountoutstanding'} = sprintf "%.02f", $borr->{'amountoutstanding'}; >+my @bordat; >+$bordat[0] = $borr; > > # Warningdate is the date that the warning starts appearing > if ( $borr->{'dateexpiry'} && C4::Context->preference('NotifyBorrowerDeparture') ) { >-- >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 15775
:
47831
|
47833
|
47937
|
48044
|
49434
|
49473
|
49516
|
63710
|
98540
|
98545
|
99840
|
99841