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

(-)a/C4/SIP/ILS/Patron.pm (+31 lines)
Lines 15-20 use Carp; Link Here
15
use Sys::Syslog qw(syslog);
15
use Sys::Syslog qw(syslog);
16
use Data::Dumper;
16
use Data::Dumper;
17
17
18
use C4::SIP::Sip qw(add_field);
19
18
use C4::Debug;
20
use C4::Debug;
19
use C4::Context;
21
use C4::Context;
20
use C4::Koha;
22
use C4::Koha;
Lines 447-452 sub _get_outstanding_holds { Link Here
447
    return \@hold_array;
449
    return \@hold_array;
448
}
450
}
449
451
452
sub build_patron_attributes_string {
453
    my ( $self, $server ) = @_;
454
455
    my $string = q{};
456
457
    if ( $server->{account}->{patron_attribute} ) {
458
        my @attributes_to_send =
459
          ref $server->{account}->{patron_attribute} eq "ARRAY"
460
          ? @{ $server->{account}->{patron_attribute} }
461
          : $server->{account}->{patron_attribute};
462
463
        foreach my $a ( @attributes_to_send ) {
464
            my @attributes = Koha::Patron::Attributes->search(
465
                {
466
                    borrowernumber => $self->{borrowernumber},
467
                    code           => $a->{code}
468
                }
469
            );
470
471
            foreach my $attribute ( @attributes ) {
472
                my $value = $attribute->attribute();
473
                $string .= add_field( $a->{field}, $value );
474
            }
475
        }
476
    }
477
478
    return $string;
479
}
480
450
1;
481
1;
451
__END__
482
__END__
452
483
(-)a/C4/SIP/Sip/MsgType.pm (+7 lines)
Lines 19-24 use Data::Dumper; Link Here
19
use CGI qw ( -utf8 );
19
use CGI qw ( -utf8 );
20
use C4::Auth qw(&check_api_auth);
20
use C4::Auth qw(&check_api_auth);
21
21
22
use Koha::Patron::Attributes;
23
22
use UNIVERSAL::can;
24
use UNIVERSAL::can;
23
25
24
use vars qw(@ISA @EXPORT_OK);
26
use vars qw(@ISA @EXPORT_OK);
Lines 443-448 sub build_patron_status { Link Here
443
          if ( $server->{account}->{send_patron_home_library_in_af} );
445
          if ( $server->{account}->{send_patron_home_library_in_af} );
444
        $resp .= maybe_add( FID_PRINT_LINE, $patron->print_line );
446
        $resp .= maybe_add( FID_PRINT_LINE, $patron->print_line );
445
447
448
        $resp .= $patron->build_patron_attributes_string( $server );
449
446
    } else {
450
    } else {
447
        # Invalid patron (cardnumber)
451
        # Invalid patron (cardnumber)
448
        # Report that the user has no privs.
452
        # Report that the user has no privs.
Lines 1006-1011 sub handle_patron_info { Link Here
1006
            $resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server);
1010
            $resp .= maybe_add( FID_SCREEN_MSG, $patron->{branchcode}, $server);
1007
        }
1011
        }
1008
        $resp .= maybe_add( FID_PRINT_LINE, $patron->print_line );
1012
        $resp .= maybe_add( FID_PRINT_LINE, $patron->print_line );
1013
1014
        $resp .= $patron->build_patron_attributes_string( $server );
1009
    } else {
1015
    } else {
1010
1016
1011
        # Invalid patron ID:
1017
        # Invalid patron ID:
Lines 1606-1611 sub api_auth { Link Here
1606
    return $status;
1612
    return $status;
1607
}
1613
}
1608
1614
1615
1609
1;
1616
1;
1610
__END__
1617
__END__
1611
1618
(-)a/etc/SIPconfig.xml (-1 / +1 lines)
Lines 54-59 Link Here
54
             av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" >
54
             av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" >
55
          <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
55
          <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
56
          <screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />
56
          <screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />
57
          <patron_attribute field="XY" code="CODE" />
57
      </login>
58
      </login>
58
  </accounts>
59
  </accounts>
59
60
60
- 

Return to bug 17826