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

(-)a/C4/SIP/Sip/MsgType.pm (+16 lines)
Lines 19-24 use CGI qw ( -utf8 ); Link Here
19
use C4::Auth qw(&check_api_auth);
19
use C4::Auth qw(&check_api_auth);
20
20
21
use Koha::Patron::Attributes;
21
use Koha::Patron::Attributes;
22
use Koha::Plugins;
22
use Koha::Items;
23
use Koha::Items;
23
24
24
use UNIVERSAL::can;
25
use UNIVERSAL::can;
Lines 519-524 sub handle_checkout { Link Here
519
    $fields = $self->{fields};
520
    $fields = $self->{fields};
520
521
521
    $patron_id = $fields->{ (FID_PATRON_ID) };
522
    $patron_id = $fields->{ (FID_PATRON_ID) };
523
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id ) || $patron_id;
522
    $item_id   = $fields->{ (FID_ITEM_ID) };
524
    $item_id   = $fields->{ (FID_ITEM_ID) };
523
    my $fee_ack = $fields->{ (FID_FEE_ACK) };
525
    my $fee_ack = $fields->{ (FID_FEE_ACK) };
524
526
Lines 735-740 sub handle_block_patron { Link Here
735
    $patron_id        = $fields->{ (FID_PATRON_ID) };
737
    $patron_id        = $fields->{ (FID_PATRON_ID) };
736
    $terminal_pwd     = $fields->{ (FID_TERMINAL_PWD) };
738
    $terminal_pwd     = $fields->{ (FID_TERMINAL_PWD) };
737
739
740
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id ) || $patron_id;
741
738
    # Terminal passwords are different from account login
742
    # Terminal passwords are different from account login
739
    # passwords, but I have no idea what to do with them.  So,
743
    # passwords, but I have no idea what to do with them.  So,
740
    # I'll just ignore them for now.
744
    # I'll just ignore them for now.
Lines 959-964 sub handle_patron_info { Link Here
959
    $start        = $fields->{ (FID_START_ITEM) };
963
    $start        = $fields->{ (FID_START_ITEM) };
960
    $end          = $fields->{ (FID_END_ITEM) };
964
    $end          = $fields->{ (FID_END_ITEM) };
961
965
966
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id ) || $patron_id;
967
962
    $patron = $ils->find_patron($patron_id);
968
    $patron = $ils->find_patron($patron_id);
963
969
964
    $resp = (PATRON_INFO_RESP);
970
    $resp = (PATRON_INFO_RESP);
Lines 1116-1121 sub handle_fee_paid { Link Here
1116
    $fee_id     = $fields->{ (FID_FEE_ID) };
1122
    $fee_id     = $fields->{ (FID_FEE_ID) };
1117
    $trans_id   = $fields->{ (FID_TRANSACTION_ID) };
1123
    $trans_id   = $fields->{ (FID_TRANSACTION_ID) };
1118
1124
1125
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id ) || $patron_id;
1126
1119
    $ils->check_inst_id( $inst_id, "handle_fee_paid" );
1127
    $ils->check_inst_id( $inst_id, "handle_fee_paid" );
1120
1128
1121
    my $pay_result = $ils->pay_fee( $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment, $register_id );
1129
    my $pay_result = $ils->pay_fee( $patron_id, $patron_pwd, $fee_amt, $fee_type, $pay_type, $fee_id, $trans_id, $currency, $is_writeoff, $disallow_overpayment, $register_id );
Lines 1306-1311 sub handle_patron_enable { Link Here
1306
    $patron_id  = $fields->{ (FID_PATRON_ID) };
1314
    $patron_id  = $fields->{ (FID_PATRON_ID) };
1307
    $patron_pwd = $fields->{ (FID_PATRON_PWD) };
1315
    $patron_pwd = $fields->{ (FID_PATRON_PWD) };
1308
1316
1317
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id ) || $patron_id;
1318
1309
    siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd );
1319
    siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd );
1310
1320
1311
    $patron = $ils->find_patron($patron_id);
1321
    $patron = $ils->find_patron($patron_id);
Lines 1369-1374 sub handle_hold { Link Here
1369
    $title_id    = $fields->{ (FID_TITLE_ID) } || '';
1379
    $title_id    = $fields->{ (FID_TITLE_ID) } || '';
1370
    $fee_ack     = $fields->{ (FID_FEE_ACK) } || 'N';
1380
    $fee_ack     = $fields->{ (FID_FEE_ACK) } || 'N';
1371
1381
1382
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id ) || $patron_id;
1383
1372
    if ( $hold_mode eq '+' ) {
1384
    if ( $hold_mode eq '+' ) {
1373
        $status = $ils->add_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack );
1385
        $status = $ils->add_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack );
1374
    } elsif ( $hold_mode eq '-' ) {
1386
    } elsif ( $hold_mode eq '-' ) {
Lines 1434-1439 sub handle_renew { Link Here
1434
    $item_props = $fields->{ (FID_ITEM_PROPS) };
1446
    $item_props = $fields->{ (FID_ITEM_PROPS) };
1435
    $fee_ack    = $fields->{ (FID_FEE_ACK) };
1447
    $fee_ack    = $fields->{ (FID_FEE_ACK) };
1436
1448
1449
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id ) || $patron_id;
1450
1437
    $status = $ils->renew( $patron_id, $patron_pwd, $item_id, $title_id, $no_block, $nb_due_date, $third_party, $item_props, $fee_ack );
1451
    $status = $ils->renew( $patron_id, $patron_pwd, $item_id, $title_id, $no_block, $nb_due_date, $third_party, $item_props, $fee_ack );
1438
1452
1439
    $patron = $status->patron;
1453
    $patron = $status->patron;
Lines 1515-1520 sub handle_renew_all { Link Here
1515
    $terminal_pwd = $fields->{ (FID_TERMINAL_PWD) };
1529
    $terminal_pwd = $fields->{ (FID_TERMINAL_PWD) };
1516
    $fee_ack      = $fields->{ (FID_FEE_ACK) };
1530
    $fee_ack      = $fields->{ (FID_FEE_ACK) };
1517
1531
1532
    ($patron_id) = Koha::Plugins->call('barcode_transform', 'patron', $patron_id ) || $patron_id;
1533
1518
    $status = $ils->renew_all( $patron_id, $patron_pwd, $fee_ack );
1534
    $status = $ils->renew_all( $patron_id, $patron_pwd, $fee_ack );
1519
1535
1520
    $resp .= $status->ok ? '1' : '0';
1536
    $resp .= $status->ok ? '1' : '0';
(-)a/Koha/Patron.pm (-1 / +7 lines)
Lines 110-116 Autogenerate next cardnumber from highest value found in database Link Here
110
110
111
sub fixup_cardnumber {
111
sub fixup_cardnumber {
112
    my ( $self ) = @_;
112
    my ( $self ) = @_;
113
    my $max = Koha::Patrons->search({
113
114
    my ( $max ) = Koha::Plugins->call( 'barcode_generate', 'patron', $self );
115
116
    $max ||= Koha::Patrons->search({
114
        cardnumber => {-regexp => '^-?[0-9]+$'}
117
        cardnumber => {-regexp => '^-?[0-9]+$'}
115
    }, {
118
    }, {
116
        select => \'CAST(cardnumber AS SIGNED)',
119
        select => \'CAST(cardnumber AS SIGNED)',
Lines 197-202 sub store { Link Here
197
200
198
            $self->trim_whitespaces;
201
            $self->trim_whitespaces;
199
202
203
            my ( $new_cardnumber ) = Koha::Plugins->call( 'barcode_transform', 'patron', $self->cardnumber ) || $self->cardnumber;
204
            $self->cardnumber( $new_cardnumber );
205
200
            # Set surname to uppercase if uppercasesurname is true
206
            # Set surname to uppercase if uppercasesurname is true
201
            $self->surname( uc($self->surname) )
207
            $self->surname( uc($self->surname) )
202
                if C4::Context->preference("uppercasesurnames");
208
                if C4::Context->preference("uppercasesurnames");
(-)a/circ/circulation.pl (-1 / +3 lines)
Lines 81-87 my $autoswitched; Link Here
81
my $borrowernumber = $query->param('borrowernumber');
81
my $borrowernumber = $query->param('borrowernumber');
82
82
83
if (C4::Context->preference("AutoSwitchPatron") && $barcode) {
83
if (C4::Context->preference("AutoSwitchPatron") && $barcode) {
84
    if (Koha::Patrons->search( { cardnumber => $barcode} )->count() > 0) {
84
    my ( $new_barcode ) = Koha::Plugins->call( 'barcode_transform', 'patron', $findborrower ) || $findborrower;
85
    if (Koha::Patrons->search( { cardnumber => $new_barcode} )->count() > 0) {
85
        $findborrower = $barcode;
86
        $findborrower = $barcode;
86
        undef $barcode;
87
        undef $barcode;
87
        undef $borrowernumber;
88
        undef $borrowernumber;
Lines 229-234 if ( @$barcodes == 0 && $charges eq 'yes' ) { Link Here
229
#
230
#
230
my $message;
231
my $message;
231
if ($findborrower) {
232
if ($findborrower) {
233
    ( $findborrower ) = Koha::Plugins->call( 'barcode_transform', 'patron', $findborrower ) || $findborrower;
232
    my $patron = Koha::Patrons->find( { cardnumber => $findborrower } );
234
    my $patron = Koha::Patrons->find( { cardnumber => $findborrower } );
233
    if ( $patron ) {
235
    if ( $patron ) {
234
        $borrowernumber = $patron->borrowernumber;
236
        $borrowernumber = $patron->borrowernumber;
(-)a/members/memberentry.pl (+4 lines)
Lines 45-50 use Koha::Patron::Attribute::Types; Link Here
45
use Koha::Patron::Categories;
45
use Koha::Patron::Categories;
46
use Koha::Patron::HouseboundRole;
46
use Koha::Patron::HouseboundRole;
47
use Koha::Patron::HouseboundRoles;
47
use Koha::Patron::HouseboundRoles;
48
use Koha::Plugins;
48
use Koha::Token;
49
use Koha::Token;
49
use Email::Valid;
50
use Email::Valid;
50
use Koha::SMS::Providers;
51
use Koha::SMS::Providers;
Lines 327-332 if ($op eq 'save' || $op eq 'insert'){ Link Here
327
    # If the cardnumber is blank, treat it as null.
328
    # If the cardnumber is blank, treat it as null.
328
    $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
329
    $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
329
330
331
    my ( $new_barcode ) = Koha::Plugins->call( 'barcode_transform', 'patron', $newdata{'cardnumber'} ) || $newdata{'cardnumber'};
332
    $newdata{'cardnumber'} = $new_barcode;
333
330
    if (my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
334
    if (my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
331
        push @errors, $error_code == 1
335
        push @errors, $error_code == 1
332
            ? 'ERROR_cardnumber_already_exists'
336
            ? 'ERROR_cardnumber_already_exists'
(-)a/opac/sco/sco-main.pl (-1 / +1 lines)
Lines 125-130 if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) { Link Here
125
125
126
my ( $borrower, $patron );
126
my ( $borrower, $patron );
127
if ( $patronid ) {
127
if ( $patronid ) {
128
    ( $patronid ) = Koha::Plugins->call( 'barcode_transform', 'patron', $patronid ) || $patronid;
128
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
129
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
129
    $borrower = $patron->unblessed if $patron;
130
    $borrower = $patron->unblessed if $patron;
130
}
131
}
131
- 

Return to bug 26352