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

(-)a/tools/cleanborrowers.pl (-8 / +11 lines)
Lines 85-93 if ( $step == 2 ) { Link Here
85
85
86
    my $patrons_to_delete;
86
    my $patrons_to_delete;
87
    if ($patron_list_id) {
87
    if ($patron_list_id) {
88
        my @patron_list_patrons =
88
        my @patron_list = GetPatronLists( {patron_list_id=>$patron_list_id});
89
          Koha::Database->new()->schema()->resultset('PatronListPatron')
89
        my @patron_list_patrons = $patron_list[0]->patron_list_patrons();
90
          ->search( { patron_list_id => $patron_list_id } );
91
        $patrons_to_delete = \@patron_list_patrons;
90
        $patrons_to_delete = \@patron_list_patrons;
92
    }
91
    }
93
    else {
92
    else {
Lines 125-133 elsif ( $step == 3 ) { Link Here
125
    if ($do_delete) {
124
    if ($do_delete) {
126
        my $patrons_to_delete;
125
        my $patrons_to_delete;
127
        if ($patron_list_id) {
126
        if ($patron_list_id) {
128
            my @patron_list_patrons =
127
            my @patron_lists = GetPatronLists( { patron_list_id => $patron_list_id } );
129
              Koha::Database->new()->schema()->resultset('PatronListPatron')
128
            my @patron_list_patrons = $patron_lists[0]->patron_list_patrons();
130
              ->search( { patron_list_id => $patron_list_id } );
131
            $patrons_to_delete = \@patron_list_patrons;
129
            $patrons_to_delete = \@patron_list_patrons;
132
        }
130
        }
133
        else {
131
        else {
Lines 170-176 elsif ( $step == 3 ) { Link Here
170
        testrun => ( $radio eq "testrun" ) ? 1: 0,
168
        testrun => ( $radio eq "testrun" ) ? 1: 0,
171
    );
169
    );
172
} else { # $step == 1
170
} else { # $step == 1
173
    $template->param( patron_lists => [ GetPatronLists() ] );
171
    my @all_lists = GetPatronLists();
172
    my @non_empty_lists;
173
    foreach my $list (@all_lists){
174
    my @patrons = $list->patron_list_patrons();
175
        if( scalar @patrons ) { push(@non_empty_lists,$list) }
176
    }
177
    $template->param( patron_lists => [ @non_empty_lists ] );
174
}
178
}
175
179
176
$template->param(
180
$template->param(
177
- 

Return to bug 10612