Permalink
Browse files

US742 Consistently use flags not patronflags

Some confusion over which borrower entry held the flags hashref
issue used patronflags returns used flags made all consistently
use 'flags'
  • Loading branch information...
1 parent 0d49dcc commit e7493c2fae1e6acf9e22727d409a390ef7673d26 @colinsc colinsc committed with pjones9 Aug 23, 2010
Showing with 12 additions and 10 deletions.
  1. +1 −1 C4/Members.pm
  2. +11 −9 circ/circulation.pl
View
@@ -309,7 +309,7 @@ sub GetMemberDetails {
my $accessflagshash = C4::Context::getuserflags($borrower->{'flags'}, $borrowernumber); # todo : if borrower is loggedinuser, we already have this in the session.
- $borrower->{'patronflags'} = patronflags($borrower);
+ $borrower->{flags} = patronflags($borrower);
$borrower->{'authflags'} = $accessflagshash;
return ($borrower); #, $flags, $accessflagshash);
View
@@ -198,19 +198,21 @@
my @missing_perms; # override permissions this user requires but does not have for the desired transaction.
if ($borrowernumber) {
- # patron-level exceptions are contained in $borrower->{'patronflags'} .
+ # patron-level exceptions are contained in $borrower->{'flags'} .
$borrower = GetMemberDetails( $borrowernumber, 0 );
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber );
$expiry_date = C4::Dates->new($borrower->{'dateexpiry'},'iso');
# remove redundant flags.
- delete $borrower->{'patronflags'}->{'patron_has_fines'} if($borrower->{'patronflags'}->{'fines_exceed_circ_block_threshold'});
+ if($borrower->{flags}->{fines_exceed_circ_block_threshold}) {
+ delete $borrower->{flags}->{patron_has_fines};
+ }
# pass patronflags that aren't overridable
- my $staffnote = ($borrower->{'patronflags'}->{'staffnote'}) ? $borrower->{'patronflags'}->{'staffnote'}->{'info'} : undef;
- my $stats_only = ($borrower->{'patronflags'}->{'stats-only'}) ? 1 : 0;
+ my $staffnote = ($borrower->{flags}->{'staffnote'}) ? $borrower->{flags}->{'staffnote'}->{'info'} : undef;
+ my $stats_only = ($borrower->{flags}->{'stats-only'}) ? 1 : 0;
- for my $condition ( keys %{$borrower->{'patronflags'}} ){
- # FIXME: Currently, patronflags holds some flags that aren't in the circ_exceptions table.
+ for my $condition ( keys %{$borrower->{flags}} ){
+ # FIXME: Currently, flags holds some flags that aren't in the circ_exceptions table.
my $exception = circ_exception_permissions('patron',$condition);
next unless $exception;
# next if($exception->{'overridden'}); # could also send these to template to show user that there's an overridden/confirmed block.
@@ -220,9 +222,9 @@
$allow_override_patron = 0 if($exception->{'block'} && ! $exception->{'allow_override'});
$exception->{'condition'} = $condition;
$exception->{'BLOCK_' . $condition} = 1;
- # some patronflags may contain extra information in keys amount or info.
- $exception->{'info'} = $borrower->{'patronflags'}->{$condition}->{'info'};
- $exception->{'amount'} = $borrower->{'patronflags'}->{$condition}->{'amount'};
+ # some patron flags may contain extra information in keys amount or info.
+ $exception->{'info'} = $borrower->{flags}->{$condition}->{'info'};
+ $exception->{'amount'} = $borrower->{flags}->{$condition}->{'amount'};
# Gather additional information for those exceptions that have it.
if($condition eq 'patron_card_expired'){
my $renew_date = $today + C4::Dates->new(1,0,$borrower->{'enrolmentperiod'},0);

0 comments on commit e7493c2

Please sign in to comment.