|
Lines 137-154
number.
Link Here
|
| 137 |
|
137 |
|
| 138 |
C<$borrower> is a reference-to-hash whose keys are the fields of the |
138 |
C<$borrower> is a reference-to-hash whose keys are the fields of the |
| 139 |
borrowers table in the Koha database. In addition, |
139 |
borrowers table in the Koha database. In addition, |
| 140 |
C<$borrower-E<gt>{flags}> is a hash giving more detailed information |
|
|
| 141 |
about the patron. Its keys act as flags : |
| 142 |
|
| 143 |
if $borrower->{flags}->{LOST} { |
| 144 |
# Patron's card was reported lost |
| 145 |
} |
| 146 |
|
| 147 |
If the state of a flag means that the patron should not be |
| 148 |
allowed to borrow any more books, then it will have a C<noissues> key |
| 149 |
with a true value. |
| 150 |
|
| 151 |
See patronflags for more details. |
| 152 |
|
140 |
|
| 153 |
=cut |
141 |
=cut |
| 154 |
|
142 |
|
|
Lines 189-197
sub GetMemberDetails {
Link Here
|
| 189 |
my $borrower = $sth->fetchrow_hashref; |
177 |
my $borrower = $sth->fetchrow_hashref; |
| 190 |
return unless $borrower; |
178 |
return unless $borrower; |
| 191 |
|
179 |
|
| 192 |
my $flags = patronflags( $borrower); |
|
|
| 193 |
$borrower->{'flags'} = $flags; |
| 194 |
|
| 195 |
$borrower->{'is_expired'} = 0; |
180 |
$borrower->{'is_expired'} = 0; |
| 196 |
$borrower->{'is_expired'} = 1 if |
181 |
$borrower->{'is_expired'} = 1 if |
| 197 |
defined($borrower->{dateexpiry}) && |
182 |
defined($borrower->{dateexpiry}) && |
|
Lines 500-506
sub ModMember {
Link Here
|
| 500 |
my $schema = Koha::Database->new()->schema; |
485 |
my $schema = Koha::Database->new()->schema; |
| 501 |
my @columns = $schema->source('Borrower')->columns; |
486 |
my @columns = $schema->source('Borrower')->columns; |
| 502 |
my $new_borrower = { map { join(' ', @columns) =~ /$_/ ? ( $_ => $data{$_} ) : () } keys(%data) }; |
487 |
my $new_borrower = { map { join(' ', @columns) =~ /$_/ ? ( $_ => $data{$_} ) : () } keys(%data) }; |
| 503 |
delete $new_borrower->{flags}; |
|
|
| 504 |
|
488 |
|
| 505 |
$new_borrower->{dateofbirth} ||= undef if exists $new_borrower->{dateofbirth}; |
489 |
$new_borrower->{dateofbirth} ||= undef if exists $new_borrower->{dateofbirth}; |
| 506 |
$new_borrower->{dateenrolled} ||= undef if exists $new_borrower->{dateenrolled}; |
490 |
$new_borrower->{dateenrolled} ||= undef if exists $new_borrower->{dateenrolled}; |