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

(-)a/C4/Members.pm (-23 / +1 lines)
Lines 79-86 BEGIN { Link Here
79
        &GetMemberAccountRecords
79
        &GetMemberAccountRecords
80
        &GetBorNotifyAcctRecord
80
        &GetBorNotifyAcctRecord
81
81
82
        GetBorrowerCategorycode
83
84
        &GetBorrowersToExpunge
82
        &GetBorrowersToExpunge
85
        &GetBorrowersWhoHaveNeverBorrowed
83
        &GetBorrowersWhoHaveNeverBorrowed
86
        &GetBorrowersWithIssuesHistoryOlderThan
84
        &GetBorrowersWithIssuesHistoryOlderThan
Lines 572-578 sub ModMember { Link Here
572
        }
570
        }
573
    }
571
    }
574
572
575
    my $old_categorycode = GetBorrowerCategorycode( $data{borrowernumber} );
573
    my $old_categorycode = Koha::Patrons->find( $data{borrowernumber} )->categorycode;
576
574
577
    # get only the columns of a borrower
575
    # get only the columns of a borrower
578
    my $schema = Koha::Database->new()->schema;
576
    my $schema = Koha::Database->new()->schema;
Lines 1263-1288 sub GetUpcomingMembershipExpires { Link Here
1263
    return $results;
1261
    return $results;
1264
}
1262
}
1265
1263
1266
=head2 GetBorrowerCategorycode
1267
1268
    $categorycode = &GetBorrowerCategoryCode( $borrowernumber );
1269
1270
Given the borrowernumber, the function returns the corresponding categorycode
1271
1272
=cut
1273
1274
sub GetBorrowerCategorycode {
1275
    my ( $borrowernumber ) = @_;
1276
    my $dbh = C4::Context->dbh;
1277
    my $sth = $dbh->prepare( qq{
1278
        SELECT categorycode
1279
        FROM borrowers
1280
        WHERE borrowernumber = ?
1281
    } );
1282
    $sth->execute( $borrowernumber );
1283
    return $sth->fetchrow;
1284
}
1285
1286
=head2 GetAge
1264
=head2 GetAge
1287
1265
1288
  $dateofbirth,$date = &GetAge($date);
1266
  $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