Lines 52-57
use Koha::Patron::Messages;
Link Here
|
52 |
use Koha::Patron::Modifications; |
52 |
use Koha::Patron::Modifications; |
53 |
use Koha::Patron::Relationships; |
53 |
use Koha::Patron::Relationships; |
54 |
use Koha::Patrons; |
54 |
use Koha::Patrons; |
|
|
55 |
use Koha::List::Patron qw( GetListsWithPatron GetPatronLists ); |
55 |
use Koha::Plugins; |
56 |
use Koha::Plugins; |
56 |
use Koha::Recalls; |
57 |
use Koha::Recalls; |
57 |
use Koha::Result::Boolean; |
58 |
use Koha::Result::Boolean; |
Lines 1049-1055
sub can_request_article {
Link Here
|
1049 |
|
1050 |
|
1050 |
my $count = Koha::ArticleRequests->search( |
1051 |
my $count = Koha::ArticleRequests->search( |
1051 |
[ { borrowernumber => $self->borrowernumber, status => [ 'REQUESTED', 'PENDING', 'PROCESSING' ] }, |
1052 |
[ { borrowernumber => $self->borrowernumber, status => [ 'REQUESTED', 'PENDING', 'PROCESSING' ] }, |
1052 |
{ borrowernumber => $self->borrowernumber, status => 'COMPLETED', updated_on => { '>=' => \'CAST(NOW() AS DATE)' } }, |
1053 |
{ borrowernumber => $self->borrowernumber, status => 'COMPLETED', updated_on => { '>=' => 'CAST(NOW() AS DATE)' } }, |
1053 |
] |
1054 |
] |
1054 |
)->count; |
1055 |
)->count; |
1055 |
return $count < $limit ? 1 : 0; |
1056 |
return $count < $limit ? 1 : 0; |
Lines 1436-1441
sub get_enrollable_clubs {
Link Here
|
1436 |
return Koha::Clubs->get_enrollable($params); |
1437 |
return Koha::Clubs->get_enrollable($params); |
1437 |
} |
1438 |
} |
1438 |
|
1439 |
|
|
|
1440 |
=head3 get_patron_lists |
1441 |
|
1442 |
=cut |
1443 |
|
1444 |
sub get_patron_lists { |
1445 |
my ( $self ) = @_; |
1446 |
|
1447 |
return GetListsWithPatron({borrowernumber => $self->borrowernumber()}); |
1448 |
} |
1449 |
|
1450 |
=head3 get_joinable_patron_lists |
1451 |
|
1452 |
=cut |
1453 |
|
1454 |
sub get_joinable_patron_lists { |
1455 |
my ( $self ) = @_; |
1456 |
|
1457 |
my @lists = GetPatronLists(); |
1458 |
my %joined_lists = map { $_->patron_list_id => 1 } GetListsWithPatron({borrowernumber => $self->borrowernumber()})->as_list; |
1459 |
my @offsets; |
1460 |
|
1461 |
for ( my $i = 0; $i < $#lists; $i++ ) { |
1462 |
my $list = $lists[$i]; |
1463 |
my $id = $list->patron_list_id(); |
1464 |
if ( $joined_lists{$id} ) { |
1465 |
unshift @offsets, $i; |
1466 |
} |
1467 |
} |
1468 |
for my $i (@offsets) { |
1469 |
splice @lists, $i, 1; |
1470 |
} |
1471 |
|
1472 |
return @lists; |
1473 |
} |
1474 |
|
1439 |
=head3 account_locked |
1475 |
=head3 account_locked |
1440 |
|
1476 |
|
1441 |
my $is_locked = $patron->account_locked |
1477 |
my $is_locked = $patron->account_locked |