From fc8dcafaff3ed3cdf323c9645eb763ca0019897c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 12 Mar 2013 13:46:41 -0400 Subject: [PATCH 2/2] Bug 6739 - expired patrons not blocked from opac actions - Followup --- .../prog/en/modules/admin/categorie.tt | 20 +++++++++++++++++--- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 18 +++++++++++++++--- opac/opac-renew.pl | 2 +- opac/opac-user.pl | 3 ++- 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt index 7ad6795..796d136 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt @@ -207,9 +207,23 @@
  • Should patrons of this category be blocked from opac actions such as renew and reserve when their cards have expired.
  • 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 9a12685..7186407 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -94,17 +94,29 @@ $.tablesorter.addParser({ [% IF ( BORROWER_INF.warnexpired ) %]
    - Please note: Your card has expired. Please contact the library for more information. + Please note: Your account has expired. Please contact the library for more information.
    [% ELSIF ( BORROWER_INF.warnexpired ) %]
    - Please note: You card has expired as of [% BORROWER_INF.warnexpired %]. Please contact the library if you wish to renew your subscription. + Please note: You account has expired as of [% BORROWER_INF.warnexpired %]. Please contact the library if you wish to renew your account.
    [% END %] [% IF ( RENEW_ERROR ) %]
    - Please note: You're renew failed with the following error: [% RENEW_ERROR %] + Please note: + + Your account renewal failed because of the following: + [% FOREACH error IN RENEW_ERROR.split('|') %] + [% IF error == 'card_expired' %] + Your account has expired. Please contact the library for more information. + [% ELSIF error == 'too_many' %] + You have renewed this item the maximum number of times allowed. + [% ELSIF error == 'on_reserve' %] + This item is on hold for another patron. + [% END %] + [% END %] +
    [% END %] diff --git a/opac/opac-renew.pl b/opac/opac-renew.pl index 9c6511a..7d1a851 100755 --- a/opac/opac-renew.pl +++ b/opac/opac-renew.pl @@ -51,7 +51,7 @@ my $member_details = GetMemberDetails($borrowernumber); # BlockExpiredPatronOpacActions syspref 0 is false, 1 is true. BlockExpiredPatronOpacActions for categories (from GetMemberDetails) -1 means use syspref, 0 is false, 1 is true (where false means dont block, true means block) if( ($member_details->{'BlockExpiredPatronOpacActions'} == -1 ? C4::Conext->preference('BlockExpiredPatronOpacActions') : $member_details->{'BlockExpiredPatronOpacActions'}) && Date_to_Days( Today() ) > Date_to_Days( split /-/, $member_details->{'dateexpiry'} ) ){ - $errorstring='unable to renew as your card has expired'; + $errorstring = 'card_expired'; } else { for my $itemnumber ( @items ) { my ($status,$error) = CanBookBeRenewed( $borrowernumber, $itemnumber ); diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 7cbdca4..efa2525 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -136,7 +136,7 @@ if ( $borr->{'dateexpiry'} && C4::Context->preference('NotifyBorrowerDeparture') } # pass on any renew errors to the template for displaying -$template->param( RENEW_ERROR => $query->param('renew_error') ) if $query->param('renew_error'); +my $renew_error = $query->param('renew_error'); $template->param( BORROWER_INFO => \@bordat, borrowernumber => $borrowernumber, @@ -144,6 +144,7 @@ $template->param( BORROWER_INFO => \@bordat, OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0, surname => $borr->{surname}, showname => $borr->{showname}, + RENEW_ERROR => $renew_error, ); #get issued items .... -- 1.7.10.4