View | Details | Raw Unified | Return to bug 5670
Collapse All | Expand All

(-)a/Koha/Patrons.pm (-4 / +4 lines)
Lines 37-49 Koha::Patron - Koha Patron Object class Link Here
37
37
38
=cut
38
=cut
39
39
40
=head3 housebound_choosers
40
=head3 search_housebound_choosers
41
41
42
Returns all Patrons which are Housebound choosers.
42
Returns all Patrons which are Housebound choosers.
43
43
44
=cut
44
=cut
45
45
46
sub housebound_choosers {
46
sub search_housebound_choosers {
47
    my ( $self ) = @_;
47
    my ( $self ) = @_;
48
    my $cho = $self->_resultset->search
48
    my $cho = $self->_resultset->search
49
        ->search_related('borrower_attributes', {
49
        ->search_related('borrower_attributes', {
Lines 53-65 sub housebound_choosers { Link Here
53
    return Koha::Patrons->_new_from_dbic($cho);
53
    return Koha::Patrons->_new_from_dbic($cho);
54
}
54
}
55
55
56
=head3 housebound_deliverers
56
=head3 search_housebound_deliverers
57
57
58
Returns all Patrons which are Housebound deliverers.
58
Returns all Patrons which are Housebound deliverers.
59
59
60
=cut
60
=cut
61
61
62
sub housebound_deliverers {
62
sub search_housebound_deliverers {
63
    my ( $self ) = @_;
63
    my ( $self ) = @_;
64
    my $del = $self->_resultset->search
64
    my $del = $self->_resultset->search
65
        ->search_related('borrower_attributes', {
65
        ->search_related('borrower_attributes', {
(-)a/members/housebound.pl (-2 / +2 lines)
Lines 117-124 if ( $method eq 'updateconfirm' and $houseboundprofile ) { Link Here
117
    $method = undef;
117
    $method = undef;
118
} elsif ( $method eq 'visit_update_or_create' ) {
118
} elsif ( $method eq 'visit_update_or_create' ) {
119
    # We want to edit, edit a visit, so we must pass its details.
119
    # We want to edit, edit a visit, so we must pass its details.
120
    $deliverers = Koha::Patrons->new->housebound_deliverers;
120
    $deliverers = Koha::Patrons->new->search_housebound_deliverers;
121
    $choosers = Koha::Patrons->new->housebound_choosers;
121
    $choosers = Koha::Patrons->new->search_housebound_choosers;
122
    $houseboundvisit = $visit;
122
    $houseboundvisit = $visit;
123
} elsif ( $method eq 'visit_delete' and $visit ) {
123
} elsif ( $method eq 'visit_delete' and $visit ) {
124
    # We want ot delete a specific visit.
124
    # We want ot delete a specific visit.
(-)a/t/db_dependent/Patron/Housebound.t (-8 / +7 lines)
Lines 37-44 is( Link Here
37
# patron_choosers and patron_deliverers Tests
37
# patron_choosers and patron_deliverers Tests
38
38
39
# Current Patron Chooser / Deliverer count
39
# Current Patron Chooser / Deliverer count
40
my $orig_del_count = Koha::Patrons->housebound_deliverers->count;
40
my $orig_del_count = Koha::Patrons->search_housebound_deliverers->count;
41
my $orig_cho_count = Koha::Patrons->housebound_choosers->count;
41
my $orig_cho_count = Koha::Patrons->search_housebound_choosers->count;
42
42
43
# We add one, just in case the above is 0, so we're guaranteed one of each.
43
# We add one, just in case the above is 0, so we're guaranteed one of each.
44
my $patron_chooser = $builder->build({ source => 'Borrower' });
44
my $patron_chooser = $builder->build({ source => 'Borrower' });
Lines 63-74 $builder->build({ Link Here
63
    },
63
    },
64
});
64
});
65
65
66
# Test housebound_choosers
66
# Test search_housebound_choosers
67
is(Koha::Patrons->housebound_choosers->count, $orig_cho_count + 1, "Correct count of choosers.");
67
is(Koha::Patrons->search_housebound_choosers->count, $orig_cho_count + 1, "Correct count of choosers.");
68
is(Koha::Patrons->housebound_deliverers->count, $orig_del_count + 1, "Correct count of deliverers");
68
is(Koha::Patrons->search_housebound_deliverers->count, $orig_del_count + 1, "Correct count of deliverers");
69
69
70
isa_ok(Koha::Patrons->housebound_choosers->next, "Koha::Patron");
70
isa_ok(Koha::Patrons->search_housebound_choosers->next, "Koha::Patron");
71
isa_ok(Koha::Patrons->housebound_deliverers->next, "Koha::Patron");
71
isa_ok(Koha::Patrons->search_housebound_deliverers->next, "Koha::Patron");
72
72
73
$schema->storage->txn_rollback;
73
$schema->storage->txn_rollback;
74
74
75
- 

Return to bug 5670