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

(-)a/C4/SIP/Sip/MsgType.pm (+16 lines)
Lines 20-25 use C4::Auth qw(&check_api_auth); Link Here
20
20
21
use Koha::Patrons;
21
use Koha::Patrons;
22
use Koha::Patron::Attributes;
22
use Koha::Patron::Attributes;
23
use Koha::Plugins;
23
use Koha::Items;
24
use Koha::Items;
24
25
25
use UNIVERSAL::can;
26
use UNIVERSAL::can;
Lines 520-525 sub handle_checkout { Link Here
520
    $fields = $self->{fields};
521
    $fields = $self->{fields};
521
522
522
    $patron_id = $fields->{ (FID_PATRON_ID) };
523
    $patron_id = $fields->{ (FID_PATRON_ID) };
524
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
523
    $item_id   = $fields->{ (FID_ITEM_ID) };
525
    $item_id   = $fields->{ (FID_ITEM_ID) };
524
    my $fee_ack = $fields->{ (FID_FEE_ACK) };
526
    my $fee_ack = $fields->{ (FID_FEE_ACK) };
525
527
Lines 741-746 sub handle_block_patron { Link Here
741
    $patron_id        = $fields->{ (FID_PATRON_ID) };
743
    $patron_id        = $fields->{ (FID_PATRON_ID) };
742
    $terminal_pwd     = $fields->{ (FID_TERMINAL_PWD) };
744
    $terminal_pwd     = $fields->{ (FID_TERMINAL_PWD) };
743
745
746
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
747
744
    # Terminal passwords are different from account login
748
    # Terminal passwords are different from account login
745
    # passwords, but I have no idea what to do with them.  So,
749
    # passwords, but I have no idea what to do with them.  So,
746
    # I'll just ignore them for now.
750
    # I'll just ignore them for now.
Lines 965-970 sub handle_patron_info { Link Here
965
    $start        = $fields->{ (FID_START_ITEM) };
969
    $start        = $fields->{ (FID_START_ITEM) };
966
    $end          = $fields->{ (FID_END_ITEM) };
970
    $end          = $fields->{ (FID_END_ITEM) };
967
971
972
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
973
968
    $patron = $ils->find_patron($patron_id);
974
    $patron = $ils->find_patron($patron_id);
969
975
970
    $resp = (PATRON_INFO_RESP);
976
    $resp = (PATRON_INFO_RESP);
Lines 1122-1127 sub handle_fee_paid { Link Here
1122
    $fee_id     = $fields->{ (FID_FEE_ID) };
1128
    $fee_id     = $fields->{ (FID_FEE_ID) };
1123
    $trans_id   = $fields->{ (FID_TRANSACTION_ID) };
1129
    $trans_id   = $fields->{ (FID_TRANSACTION_ID) };
1124
1130
1131
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1132
1125
    $ils->check_inst_id( $inst_id, "handle_fee_paid" );
1133
    $ils->check_inst_id( $inst_id, "handle_fee_paid" );
1126
1134
1127
    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 );
1135
    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 1318-1323 sub handle_patron_enable { Link Here
1318
    $patron_id  = $fields->{ (FID_PATRON_ID) };
1326
    $patron_id  = $fields->{ (FID_PATRON_ID) };
1319
    $patron_pwd = $fields->{ (FID_PATRON_PWD) };
1327
    $patron_pwd = $fields->{ (FID_PATRON_PWD) };
1320
1328
1329
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1330
1321
    siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd );
1331
    siplog( "LOG_DEBUG", "handle_patron_enable: patron_id: '%s', patron_pwd: '%s'", $patron_id, $patron_pwd );
1322
1332
1323
    $patron = $ils->find_patron($patron_id);
1333
    $patron = $ils->find_patron($patron_id);
Lines 1381-1386 sub handle_hold { Link Here
1381
    $title_id    = $fields->{ (FID_TITLE_ID) } || '';
1391
    $title_id    = $fields->{ (FID_TITLE_ID) } || '';
1382
    $fee_ack     = $fields->{ (FID_FEE_ACK) } || 'N';
1392
    $fee_ack     = $fields->{ (FID_FEE_ACK) } || 'N';
1383
1393
1394
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1395
1384
    if ( $hold_mode eq '+' ) {
1396
    if ( $hold_mode eq '+' ) {
1385
        $status = $ils->add_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack );
1397
        $status = $ils->add_hold( $patron_id, $patron_pwd, $item_id, $title_id, $expiry_date, $pickup_locn, $hold_type, $fee_ack );
1386
    } elsif ( $hold_mode eq '-' ) {
1398
    } elsif ( $hold_mode eq '-' ) {
Lines 1446-1451 sub handle_renew { Link Here
1446
    $item_props = $fields->{ (FID_ITEM_PROPS) };
1458
    $item_props = $fields->{ (FID_ITEM_PROPS) };
1447
    $fee_ack    = $fields->{ (FID_FEE_ACK) };
1459
    $fee_ack    = $fields->{ (FID_FEE_ACK) };
1448
1460
1461
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1462
1449
    $status = $ils->renew( $patron_id, $patron_pwd, $item_id, $title_id, $no_block, $nb_due_date, $third_party, $item_props, $fee_ack );
1463
    $status = $ils->renew( $patron_id, $patron_pwd, $item_id, $title_id, $no_block, $nb_due_date, $third_party, $item_props, $fee_ack );
1450
1464
1451
    $patron = $status->patron;
1465
    $patron = $status->patron;
Lines 1527-1532 sub handle_renew_all { Link Here
1527
    $terminal_pwd = $fields->{ (FID_TERMINAL_PWD) };
1541
    $terminal_pwd = $fields->{ (FID_TERMINAL_PWD) };
1528
    $fee_ack      = $fields->{ (FID_FEE_ACK) };
1542
    $fee_ack      = $fields->{ (FID_FEE_ACK) };
1529
1543
1544
    ($patron_id) = Koha::Plugins->call('patron_barcode_transform', $patron_id ) || $patron_id;
1545
1530
    $status = $ils->renew_all( $patron_id, $patron_pwd, $fee_ack );
1546
    $status = $ils->renew_all( $patron_id, $patron_pwd, $fee_ack );
1531
1547
1532
    $resp .= $status->ok ? '1' : '0';
1548
    $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 324-329 if ($op eq 'save' || $op eq 'insert'){ Link Here
324
    # If the cardnumber is blank, treat it as null.
325
    # If the cardnumber is blank, treat it as null.
325
    $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
326
    $newdata{'cardnumber'} = undef if $newdata{'cardnumber'} =~ /^\s*$/;
326
327
328
    my ( $new_barcode ) = Koha::Plugins->call( 'patron_barcode_transform', $newdata{'cardnumber'} ) || $newdata{'cardnumber'};
329
    $newdata{'cardnumber'} = $new_barcode;
330
327
    if (my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
331
    if (my $error_code = checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){
328
        push @errors, $error_code == 1
332
        push @errors, $error_code == 1
329
            ? 'ERROR_cardnumber_already_exists'
333
            ? 'ERROR_cardnumber_already_exists'
(-)a/opac/sco/sco-main.pl (-1 / +1 lines)
Lines 123-128 if (C4::Context->preference('SelfCheckoutByLogin') && !$patronid) { Link Here
123
123
124
my ( $borrower, $patron );
124
my ( $borrower, $patron );
125
if ( $patronid ) {
125
if ( $patronid ) {
126
    ( $patronid ) = Koha::Plugins->call( 'patron_barcode_transform', $patronid ) || $patronid;
126
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
127
    $patron = Koha::Patrons->find( { cardnumber => $patronid } );
127
    $borrower = $patron->unblessed if $patron;
128
    $borrower = $patron->unblessed if $patron;
128
}
129
}
129
- 

Return to bug 26352