- translation issues
- wording issues
Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
$borrower->{'showname'} = $borrower->{'firstname'};
}
$borrower->{'showname'} = $borrower->{'firstname'};
}
+ # Handle setting the true behavior for BlockExpiredPatronOpacActions
+ $borrower->{'BlockExpiredPatronOpacActions'} =
+ C4::Context->preference('BlockExpiredPatronOpacActions')
+ if ( $borrower->{'BlockExpiredPatronOpacActions'} == -1 );
+
+ $borrower->{'is_expired'} =
+ Date_to_Days( Today() ) >
+ Date_to_Days( split /-/, $borrower->{'dateexpiry'} );
+
return ($borrower); #, $flags, $accessflagshash);
}
return ($borrower); #, $flags, $accessflagshash);
}
</li>
<li><label for="block_expired">Block expired patrons</label>
<select name="block_expired" id="block_expired">
</li>
<li><label for="block_expired">Block expired patrons</label>
<select name="block_expired" id="block_expired">
- <option value="-1" [% IF ( BlockExpiredPatronOpacActions == -1 ) %] selected="selected" [% END %]> Follow system preference BlockExpiredPatronOpacActions </option>
- <option value="1" [% IF ( BlockExpiredPatronOpacActions == 1 ) %] selected="selected" [% END %]> Block </option>
- <option value="0" [% IF ( BlockExpiredPatronOpacActions == 0 ) %] selected="selected" [% END %]> Don't block </option>
+ [% IF ( BlockExpiredPatronOpacActions == -1 ) %]
+ <option value="-1" selected="selected"> Follow system preference BlockExpiredPatronOpacActions </option>
+ [% ELSE %]
+ <option value="-1"> Follow system preference BlockExpiredPatronOpacActions </option>
+ [% END %]
+
+ [% IF ( BlockExpiredPatronOpacActions == 1 ) %]
+ <option value="1" selected="selected"> Block </option>
+ [% ELSE %]
+ <option value="1"> Block </option>
+ [% END %]
+
+ [% IF ( BlockExpiredPatronOpacActions == 0 ) %]
+ <option value="0" selected="selected"> Don't block </option>
+ [% ELSE %]
+ <option value="0"> Don't block </option>
+ [% END %]
</select>
Should patrons of this category be blocked from opac actions such as renew and reserve when their cards have expired.
</li>
</select>
Should patrons of this category be blocked from opac actions such as renew and reserve when their cards have expired.
</li>
[% IF ( BORROWER_INF.warnexpired ) %]
<div class="dialog alert" id="warnexpired">
[% 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>
+ <strong>Please note:</strong><span> Your account has expired. Please contact the library for more information.</span>
</div>
[% ELSIF ( BORROWER_INF.warnexpired ) %]
<div class="dialog alert">
</div>
[% ELSIF ( BORROWER_INF.warnexpired ) %]
<div class="dialog alert">
- <string>Please note:</string><span> You card has expired as of [% BORROWER_INF.warnexpired %]. Please contact the library if you wish to renew your subscription.</span>
+ <strong>Please note:</strong><span> You account has expired as of [% BORROWER_INF.warnexpired %]. Please contact the library if you wish to renew your account.</span>
</div>
[% END %]
[% IF ( RENEW_ERROR ) %]
<div class="dialog alert">
</div>
[% END %]
[% IF ( RENEW_ERROR ) %]
<div class="dialog alert">
- <string>Please note:</string><span> You're renew failed with the following error: [% RENEW_ERROR %]</span>
+ <string>Please note:</string>
+ <span>
+ 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 %]
+ </span>
use CGI;
use C4::Circulation;
use C4::Auth;
use CGI;
use C4::Circulation;
use C4::Auth;
use C4::Items;
use C4::Members;
use Date::Calc qw( Today Date_to_Days );
use C4::Items;
use C4::Members;
use Date::Calc qw( Today Date_to_Days );
my $errorstring='';
my $member_details = GetMemberDetails($borrowernumber);
my $errorstring='';
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';
-} else {
- for my $itemnumber ( @items ) {
- my ($status,$error) = CanBookBeRenewed( $borrowernumber, $itemnumber );
+
+if ( $member_details->{'BlockExpiredPatronOpacActions'}
+ && $member_details->{'is_expired'} )
+{
+ $errorstring = 'card_expired';
+}
+else {
+ for my $itemnumber (@items) {
+ my ( $status, $error ) =
+ CanBookBeRenewed( $borrowernumber, $itemnumber );
if ( $status == 1 && $opacrenew == 1 ) {
my $renewalbranch = C4::Context->preference('OpacRenewalBranch');
my $branchcode;
if ( $status == 1 && $opacrenew == 1 ) {
my $renewalbranch = C4::Context->preference('OpacRenewalBranch');
my $branchcode;
- if ($renewalbranch eq 'itemhomebranch'){
+ if ( $renewalbranch eq 'itemhomebranch' ) {
my $item = GetItem($itemnumber);
my $item = GetItem($itemnumber);
- $branchcode=$item->{'homebranch'};
+ $branchcode = $item->{'homebranch'};
- elsif ($renewalbranch eq 'patronhomebranch'){
+ elsif ( $renewalbranch eq 'patronhomebranch' ) {
my $borrower = GetMemberDetails($borrowernumber);
$branchcode = $borrower->{'branchcode'};
}
my $borrower = GetMemberDetails($borrowernumber);
$branchcode = $borrower->{'branchcode'};
}
- elsif ($renewalbranch eq 'checkoutbranch'){
+ elsif ( $renewalbranch eq 'checkoutbranch' ) {
my $issue = GetOpenIssue($itemnumber);
$branchcode = $issue->{'branchcode'};
}
my $issue = GetOpenIssue($itemnumber);
$branchcode = $issue->{'branchcode'};
}
- elsif ($renewalbranch eq 'NULL'){
- $branchcode='';
+ elsif ( $renewalbranch eq 'NULL' ) {
+ $branchcode = '';
- $branchcode='OPACRenew'
+ $branchcode = 'OPACRenew';
- AddRenewal( $borrowernumber, $itemnumber, $branchcode);
+ AddRenewal( $borrowernumber, $itemnumber, $branchcode );
- $errorstring .= $error ."|";
+ $errorstring .= $error . "|";
my ( $borr ) = GetMemberDetails( $borrowernumber );
# check if this user can place a reserve, -1 means use sys pref, 0 means dont block, 1 means block
my ( $borr ) = GetMemberDetails( $borrowernumber );
# check if this user can place a reserve, -1 means use sys pref, 0 means dont block, 1 means block
-if( $borr->{'BlockExpiredPatronOpacActions'} == -1 ? C4::Context->preference("BlockExpiredPatronOpacActions") : $borr->{'BlockExpiredPatronOpacActions'} ) {
+if ( $borr->{'BlockExpiredPatronOpacActions'} ) {
+
+ if ( $borr->{'is_expired'} ) {
- if( Date_to_Days( Today() ) > Date_to_Days( split /-/, $borr->{'dateexpiry'} ) ){
# cannot reserve, their card has expired and the rules set mean this is not allowed
# cannot reserve, their card has expired and the rules set mean this is not allowed
- $template->param( message=>1, expired_patron=>1 );
- get_out($query, $cookie, $template->output);
+ $template->param( message => 1, expired_patron => 1 );
+ get_out( $query, $cookie, $template->output );
}
# pass on any renew errors to the template for displaying
}
# 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,
$template->param( BORROWER_INFO => \@bordat,
borrowernumber => $borrowernumber,
OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0,
surname => $borr->{surname},
showname => $borr->{showname},
OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0,
surname => $borr->{surname},
showname => $borr->{showname},
+ RENEW_ERROR => $renew_error,
);
#get issued items ....
);
#get issued items ....