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('patron_barcode_transform', $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 740-745 sub handle_block_patron { Link Here
740
    $patron_id        = $fields->{ (FID_PATRON_ID) };
742
    $patron_id        = $fields->{ (FID_PATRON_ID) };
741
    $terminal_pwd     = $fields->{ (FID_TERMINAL_PWD) };
743
    $terminal_pwd     = $fields->{ (FID_TERMINAL_PWD) };
742
744
745
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
746
743
    # Terminal passwords are different from account login
747
    # Terminal passwords are different from account login
744
    # passwords, but I have no idea what to do with them.  So,
748
    # passwords, but I have no idea what to do with them.  So,
745
    # I'll just ignore them for now.
749
    # I'll just ignore them for now.
Lines 964-969 sub handle_patron_info { Link Here
964
    $start        = $fields->{ (FID_START_ITEM) };
968
    $start        = $fields->{ (FID_START_ITEM) };
965
    $end          = $fields->{ (FID_END_ITEM) };
969
    $end          = $fields->{ (FID_END_ITEM) };
966
970
971
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
972
967
    $patron = $ils->find_patron($patron_id);
973
    $patron = $ils->find_patron($patron_id);
968
974
969
    $resp = (PATRON_INFO_RESP);
975
    $resp = (PATRON_INFO_RESP);
Lines 1121-1126 sub handle_fee_paid { Link Here
1121
    $fee_id     = $fields->{ (FID_FEE_ID) };
1127
    $fee_id     = $fields->{ (FID_FEE_ID) };
1122
    $trans_id   = $fields->{ (FID_TRANSACTION_ID) };
1128
    $trans_id   = $fields->{ (FID_TRANSACTION_ID) };
1123
1129
1130
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1131
1124
    $ils->check_inst_id( $inst_id, "handle_fee_paid" );
1132
    $ils->check_inst_id( $inst_id, "handle_fee_paid" );
1125
1133
1126
    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 );
1134
    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 1317-1322 sub handle_patron_enable { Link Here
1317
    $patron_id  = $fields->{ (FID_PATRON_ID) };
1325
    $patron_id  = $fields->{ (FID_PATRON_ID) };
1318
    $patron_pwd = $fields->{ (FID_PATRON_PWD) };
1326
    $patron_pwd = $fields->{ (FID_PATRON_PWD) };
1319
1327
1328
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1329
1320
    siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd );
1330
    siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd );
1321
1331
1322
    $patron = $ils->find_patron($patron_id);
1332
    $patron = $ils->find_patron($patron_id);
Lines 1380-1385 sub handle_hold { Link Here
1380
    $title_id    = $fields->{ (FID_TITLE_ID) } || '';
1390
    $title_id    = $fields->{ (FID_TITLE_ID) } || '';
1381
    $fee_ack     = $fields->{ (FID_FEE_ACK) } || 'N';
1391
    $fee_ack     = $fields->{ (FID_FEE_ACK) } || 'N';
1382
1392
1393
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1394
1383
    if ( $hold_mode eq '+' ) {
1395
    if ( $hold_mode eq '+' ) {
1384
        $status = $ils->add_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack );
1396
        $status = $ils->add_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack );
1385
    } elsif ( $hold_mode eq '-' ) {
1397
    } elsif ( $hold_mode eq '-' ) {
Lines 1445-1450 sub handle_renew { Link Here
1445
    $item_props = $fields->{ (FID_ITEM_PROPS) };
1457
    $item_props = $fields->{ (FID_ITEM_PROPS) };
1446
    $fee_ack    = $fields->{ (FID_FEE_ACK) };
1458
    $fee_ack    = $fields->{ (FID_FEE_ACK) };
1447
1459
1460
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1461
1448
    $status = $ils->renew( $patron_id, $patron_pwd, $item_id, $title_id, $no_block, $nb_due_date, $third_party, $item_props, $fee_ack );
1462
    $status = $ils->renew( $patron_id, $patron_pwd, $item_id, $title_id, $no_block, $nb_due_date, $third_party, $item_props, $fee_ack );
1449
1463
1450
    $patron = $status->patron;
1464
    $patron = $status->patron;
Lines 1526-1531 sub handle_renew_all { Link Here
1526
    $terminal_pwd = $fields->{ (FID_TERMINAL_PWD) };
1540
    $terminal_pwd = $fields->{ (FID_TERMINAL_PWD) };
1527
    $fee_ack      = $fields->{ (FID_FEE_ACK) };
1541
    $fee_ack      = $fields->{ (FID_FEE_ACK) };
1528
1542
1543
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1544
1529
    $status = $ils->renew_all( $patron_id, $patron_pwd, $fee_ack );
1545
    $status = $ils->renew_all( $patron_id, $patron_pwd, $fee_ack );
1530
1546
1531
    $resp .= $status->ok ? '1' : '0';
1547
    $resp .= $status->ok ? '1' : '0';
(-)a/Koha/Patron.pm (-1 / +7 lines)
Lines 111-117 Autogenerate next cardnumber from highest value found in database Link Here
111
111
112
sub fixup_cardnumber {
112
sub fixup_cardnumber {
113
    my ( $self ) = @_;
113
    my ( $self ) = @_;
114
    my $max = Koha::Patrons->search({
114
115
    my ( $max ) = Koha::Plugins->call( 'barcode_generate', 'patron', $self );
116
117
    $max ||= Koha::Patrons->search({
115
        cardnumber => {-regexp => '^-?[0-9]+$'}
118
        cardnumber => {-regexp => '^-?[0-9]+$'}
116
    }, {
119
    }, {
117
        select => \'CAST(cardnumber AS SIGNED)',
120
        select => \'CAST(cardnumber AS SIGNED)',
Lines 198-203 sub store { Link Here
198
201
199
            $self->trim_whitespaces;
202
            $self->trim_whitespaces;
200
203
204
            my ( $new_cardnumber ) = Koha::Plugins->call( 'patron_barcode_transform', $self->cardnumber ) || $self->cardnumber;
205
            $self->cardnumber( $new_cardnumber );
206
201
            # Set surname to uppercase if uppercasesurname is true
207
            # Set surname to uppercase if uppercasesurname is true
202
            $self->surname( uc($self->surname) )
208
            $self->surname( uc($self->surname) )
203
                if C4::Context->preference("uppercasesurnames");
209
                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( 'patron_barcode_transform', $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 226-231 if ( @$barcodes == 0 && $charges eq 'yes' ) { Link Here
226
#
227
#
227
my $message;
228
my $message;
228
if ($findborrower) {
229
if ($findborrower) {
230
    ( $findborrower ) = Koha::Plugins->call( 'patron_barcode_transform', $findborrower ) || $findborrower;
229
    my $patron = Koha::Patrons->find( { cardnumber => $findborrower } );
231
    my $patron = Koha::Patrons->find( { cardnumber => $findborrower } );
230
    if ( $patron ) {
232
    if ( $patron ) {
231
        $borrowernumber = $patron->borrowernumber;
233
        $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 333-338 if ($op eq 'save' || $op eq 'insert'){ Link Here
333
    # If the cardnumber is blank, treat it as null.
334
    # If the cardnumber is blank, treat it as null.
334
    $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
335
    $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
335
336
337
    my ( $new_barcode ) = Koha::Plugins->call( 'patron_barcode_transform', $newdata{'cardnumber'} ) || $newdata{'cardnumber'};
338
    $newdata{'cardnumber'} = $new_barcode;
339
336
    if (my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
340
    if (my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
337
        push @errors, $error_code == 1
341
        push @errors, $error_code == 1
338
            ? 'ERROR_cardnumber_already_exists'
342
            ? 'ERROR_cardnumber_already_exists'
(-)a/opac/sco/sco-main.pl (-1 / +1 lines)
Lines 124-129 if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) { Link Here
124
124
125
my ( $borrower, $patron );
125
my ( $borrower, $patron );
126
if ( $patronid ) {
126
if ( $patronid ) {
127
    ( $patronid ) = Koha::Plugins->call( 'patron_barcode_transform', $patronid ) || $patronid;
127
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
128
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
128
    $borrower = $patron->unblessed if $patron;
129
    $borrower = $patron->unblessed if $patron;
129
}
130
}
130
- 

Return to bug 26352