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

(-)a/C4/SIP/ILS/Patron.pm (+20 lines)
Lines 190-195 sub AUTOLOAD { Link Here
190
    }
190
    }
191
}
191
}
192
192
193
sub name {
194
    my ( $self, $template ) = @_;
195
196
    if ($template) {
197
        require Template;
198
        require Koha::Patrons;
199
200
        my $tt = Template->new();
201
202
        my $patron = Koha::Patrons->find( $self->{borrowernumber} );
203
204
        my $output;
205
        $tt->process( \$template, { patron => $patron }, \$output );
206
        return $output;
207
    }
208
    else {
209
        return $self->{name};
210
    }
211
}
212
193
sub check_password {
213
sub check_password {
194
    my ( $self, $pwd ) = @_;
214
    my ( $self, $pwd ) = @_;
195
215
(-)a/C4/SIP/Sip/MsgType.pm (-3 / +3 lines)
Lines 420-426 sub build_patron_status { Link Here
420
420
421
        $resp .= patron_status_string($patron);
421
        $resp .= patron_status_string($patron);
422
        $resp .= $lang . timestamp();
422
        $resp .= $lang . timestamp();
423
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name );
423
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ) );
424
424
425
        # while the patron ID we got from the SC is valid, let's
425
        # while the patron ID we got from the SC is valid, let's
426
        # use the one returned from the ILS, just in case...
426
        # use the one returned from the ILS, just in case...
Lines 948-954 sub handle_patron_info { Link Here
948
        # while the patron ID we got from the SC is valid, let's
948
        # while the patron ID we got from the SC is valid, let's
949
        # use the one returned from the ILS, just in case...
949
        # use the one returned from the ILS, just in case...
950
        $resp .= add_field( FID_PATRON_ID,     $patron->id );
950
        $resp .= add_field( FID_PATRON_ID,     $patron->id );
951
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name );
951
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ) );
952
952
953
        # TODO: add code for the fields
953
        # TODO: add code for the fields
954
        #   hold items limit
954
        #   hold items limit
Lines 1243-1249 sub handle_patron_enable { Link Here
1243
        $resp .= $patron->language . timestamp();
1243
        $resp .= $patron->language . timestamp();
1244
1244
1245
        $resp .= add_field( FID_PATRON_ID,     $patron->id );
1245
        $resp .= add_field( FID_PATRON_ID,     $patron->id );
1246
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name );
1246
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ) );
1247
        if ( defined($patron_pwd) ) {
1247
        if ( defined($patron_pwd) ) {
1248
            $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ) );
1248
            $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ) );
1249
        }
1249
        }
(-)a/etc/SIPconfig.xml (-1 / +1 lines)
Lines 51-56 Link Here
51
      <login id="lpl-sc-beacock" password="xyzzy"
51
      <login id="lpl-sc-beacock" password="xyzzy"
52
             delimiter="|" error-detect="enabled" institution="LPL"
52
             delimiter="|" error-detect="enabled" institution="LPL"
53
             send_patron_home_library_in_af="1"
53
             send_patron_home_library_in_af="1"
54
             ae_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]"
54
             da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]"
55
             da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]"
55
             av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" >
56
             av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" >
56
          <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
57
          <screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
57
- 

Return to bug 18104