my $self = shift;
my $ctx = $self->ctx;
my $user = $self->ctx->{user};
+ my $e = new_editor(xact => 1);
#check for INVALID_PATRON_ADDRESS
- my $searchpenalty_address = new_editor()->search_actor_user_standing_penalty({
+ my $findpenalty_address = $e->search_config_standing_penalty({name => 'INVALID_PATRON_ADDRESS'})->[0];
+ my $searchpenalty_address = $e->search_actor_user_standing_penalty({
usr => $user->id,
- standing_penalty => 29,
+ standing_penalty => $findpenalty_address->id,
'-or' => [
{stop_date => undef},
{stop_date => {'>' => 'now'}}
});
#check for INVALID_PATRON_DAY_PHONE
- my $searchpenalty_phone = new_editor()->search_actor_user_standing_penalty({
+ my $findpenalty_phone = $e->search_config_standing_penalty({name => 'INVALID_PATRON_DAY_PHONE'})->[0];
+ my $searchpenalty_phone = $e->search_actor_user_standing_penalty({
usr => $user->id,
- standing_penalty => 32,
+ standing_penalty => $findpenalty_phone->id,
'-or' => [
{stop_date => undef},
{stop_date => {'>' => 'now'}}
});
#check for PATRON_IN_COLLECTIONS
- my $searchpenalty_coll = new_editor()->search_actor_user_standing_penalty({
+ my $findpenalty_coll = $e->search_config_standing_penalty({name => 'PATRON_IN_COLLECTIONS'})->[0];
+ my $searchpenalty_coll = $e->search_actor_user_standing_penalty({
usr => $user->id,
- standing_penalty => 30,
+ standing_penalty => $findpenalty_coll->id,
'-or' => [
{stop_date => undef},
{stop_date => {'>' => 'now'}}
});
#check for alerting block
- my $searchpenalty_alertblock = new_editor()->search_actor_user_standing_penalty({
+ my $findpenalty_alertblock = $e->search_config_standing_penalty({name => 'STAFF_CHR'})->[0];
+ my $searchpenalty_alertblock = $e->search_actor_user_standing_penalty({
usr => $user->id,
- standing_penalty => 25,
+ standing_penalty => $findpenalty_alertblock->id,
'-or' => [
{stop_date => undef},
{stop_date => {'>' => 'now'}}
});
#check for PATRON_TEMP_RENEWAL
- my $findpenalty = new_editor()->search_config_standing_penalty({name => 'PATRON_TEMP_RENEWAL'})->[0];
- my $penaltyid = $findpenalty->id;
- my $searchpenalty_temp = new_editor()->search_actor_user_standing_penalty({
+ my $findpenalty_temp = $e->search_config_standing_penalty({name => 'PATRON_TEMP_RENEWAL'})->[0];
+ my $searchpenalty_temp = $e->search_actor_user_standing_penalty({
usr => $user->id,
- standing_penalty => $penaltyid,
+ standing_penalty => $findpenalty_temp->id,
'-or' => [
{stop_date => undef},
{stop_date => {'>' => 'now'}}
#determine which message to show (if any)
if ($ctx->{hastemprenew} eq 1) { #user already has active temp renewal
- $ctx->{account_renew_message} = '<div style="border:2px solid green;padding:5px;">Your account could only be temporarily renewed because your
- address changed. Please visit your nearest PINES library with your current proof of address
- to complete your account renewal.</div>';
+ $ctx->{account_renew_message} = '<div style="border:2px solid green;padding:5px;">Your account
+ could only be temporarily renewed because your address changed. Please visit your nearest PINES
+ library with your current proof of address to complete your account renewal.</div>';
} elsif (DateTime->today->add(days=>30) lt $ctx->{user}->expire_date) {
#expiration date is too far in future - don't show message
$ctx->{account_renew_message} = '';
} elsif ($ctx->{hasproblem} eq 1 or $ctx->{eligible_permgroup} eq 0) { #see other problems above
- $ctx->{account_renew_message} = 'Your account is due for renewal, but it is not eligible for online renewal. Please visit your nearest PINES library with your current ID and proof of address to renew your account.';
+ $ctx->{account_renew_message} = '<div style="border:2px solid green;padding:5px;">Your account is
+ due for renewal, but it cannot be renewed online. Please visit your nearest PINES
+ library with your current ID and proof of address to update and renew your account.</div>';
} elsif ($ctx->{user_stats}->{fines}->{balance_owed} gt 0) { #user has fines
- $ctx->{account_renew_message} = 'Your account expiration date is coming up soon. Please pay your outstanding fines in order to renew your account.';
+ $ctx->{account_renew_message} = '<div style="border:2px solid green;padding:5px;">Your account
+ is due for renewal. Please pay your outstanding fines in order to renew your account.</div>';
} else {
- $ctx->{account_renew_message} = '<span class="light_border"><a class="btn btn-sm btn-action" href="/eg/opac/renew-account"><i class="fas fa-user-cog"></i>Click here to renew your account</a></span>';
+ $ctx->{account_renew_message} = '<span class="light_border"><a class="btn btn-sm btn-action"
+ href="/eg/opac/renew-account"><i class="fas fa-user-cog"></i>Click here to renew your account</a></span>';
}
return;