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 956-962 sub handle_patron_info { Link Here
956
        # while the patron ID we got from the SC is valid, let's
956
        # while the patron ID we got from the SC is valid, let's
957
        # use the one returned from the ILS, just in case...
957
        # use the one returned from the ILS, just in case...
958
        $resp .= add_field( FID_PATRON_ID,     $patron->id );
958
        $resp .= add_field( FID_PATRON_ID,     $patron->id );
959
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name );
959
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ) );
960
960
961
        # TODO: add code for the fields
961
        # TODO: add code for the fields
962
        #   hold items limit
962
        #   hold items limit
Lines 1248-1254 sub handle_patron_enable { Link Here
1248
        $resp .= $patron->language . timestamp();
1248
        $resp .= $patron->language . timestamp();
1249
1249
1250
        $resp .= add_field( FID_PATRON_ID,     $patron->id );
1250
        $resp .= add_field( FID_PATRON_ID,     $patron->id );
1251
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name );
1251
        $resp .= add_field( FID_PERSONAL_NAME, $patron->name( $server->{account}->{ae_field_template} ) );
1252
        if ( defined($patron_pwd) ) {
1252
        if ( defined($patron_pwd) ) {
1253
            $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ) );
1253
            $resp .= add_field( FID_VALID_PATRON_PWD, sipbool( $patron->check_password($patron_pwd) ) );
1254
        }
1254
        }
(-)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