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

(-)a/C4/Members.pm (-23 / +1 lines)
Lines 78-85 BEGIN { Link Here
78
        &GetMemberAccountRecords
78
        &GetMemberAccountRecords
79
        &GetBorNotifyAcctRecord
79
        &GetBorNotifyAcctRecord
80
80
81
        GetBorrowerCategorycode
82
83
        &GetBorrowersToExpunge
81
        &GetBorrowersToExpunge
84
        &GetBorrowersWhoHaveNeverBorrowed
82
        &GetBorrowersWhoHaveNeverBorrowed
85
        &GetBorrowersWithIssuesHistoryOlderThan
83
        &GetBorrowersWithIssuesHistoryOlderThan
Lines 522-528 sub ModMember { Link Here
522
        }
520
        }
523
    }
521
    }
524
522
525
    my $old_categorycode = GetBorrowerCategorycode( $data{borrowernumber} );
523
    my $old_categorycode = Koha::Patrons->find( $data{borrowernumber} )->categorycode;
526
524
527
    # get only the columns of a borrower
525
    # get only the columns of a borrower
528
    my $schema = Koha::Database->new()->schema;
526
    my $schema = Koha::Database->new()->schema;
Lines 1213-1238 sub GetUpcomingMembershipExpires { Link Here
1213
    return $results;
1211
    return $results;
1214
}
1212
}
1215
1213
1216
=head2 GetBorrowerCategorycode
1217
1218
    $categorycode = &GetBorrowerCategoryCode( $borrowernumber );
1219
1220
Given the borrowernumber, the function returns the corresponding categorycode
1221
1222
=cut
1223
1224
sub GetBorrowerCategorycode {
1225
    my ( $borrowernumber ) = @_;
1226
    my $dbh = C4::Context->dbh;
1227
    my $sth = $dbh->prepare( qq{
1228
        SELECT categorycode
1229
        FROM borrowers
1230
        WHERE borrowernumber = ?
1231
    } );
1232
    $sth->execute( $borrowernumber );
1233
    return $sth->fetchrow;
1234
}
1235
1236
=head2 GetAge
1214
=head2 GetAge
1237
1215
1238
  $dateofbirth,$date = &GetAge($date);
1216
  $dateofbirth,$date = &GetAge($date);
(-)a/tools/modborrowers.pl (-3 / +2 lines)
Lines 38-43 use Koha::DateUtils qw( dt_from_string ); Link Here
38
use Koha::List::Patron;
38
use Koha::List::Patron;
39
use Koha::Libraries;
39
use Koha::Libraries;
40
use Koha::Patron::Categories;
40
use Koha::Patron::Categories;
41
use Koha::Patrons;
41
42
42
my $input = new CGI;
43
my $input = new CGI;
43
my $op = $input->param('op') || 'show_form';
44
my $op = $input->param('op') || 'show_form';
Lines 294-301 if ( $op eq 'do' ) { Link Here
294
            }
295
            }
295
        }
296
        }
296
297
297
        #
298
        my $borrower_categorycode = Koha::Patrons->find( $borrowernumber )->categorycode;
298
        my $borrower_categorycode = GetBorrowerCategorycode $borrowernumber;
299
        my $i=0;
299
        my $i=0;
300
        for ( @attributes ) {
300
        for ( @attributes ) {
301
            my $attribute;
301
            my $attribute;
302
- 

Return to bug 16852