@@ -, +, @@ customized da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]" --- C4/SIP/ILS/Item.pm | 18 +++++++++++++++--- C4/SIP/Sip/MsgType.pm | 2 +- etc/SIPconfig.xml | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) --- a/C4/SIP/ILS/Item.pm +++ a/C4/SIP/ILS/Item.pm @@ -11,6 +11,7 @@ use warnings; use Sys::Syslog qw(syslog); use Carp; +use Template; use C4::SIP::ILS::Transaction; @@ -22,7 +23,7 @@ use C4::Circulation; use C4::Members; use C4::Reserves; use Koha::Database; - +use Koha::Patrons; =encoding UTF-8 @@ -165,8 +166,19 @@ sub hold_patron_id { } sub hold_patron_name { - my $self = shift; - my $borrowernumber = (@_ ? shift: $self->hold_patron_id()) or return; + my ( $self, $template ) = @_; + my $borrowernumber = $self->hold_patron_id() or return; + + if ($template) { + my $tt = Template->new(); + + my $patron = Koha::Patrons->find($borrowernumber); + + my $output; + $tt->process( \$template, { patron => $patron }, \$output ); + return $output; + } + my $holder = GetMember(borrowernumber=>$borrowernumber); unless ($holder) { syslog("LOG_ERR", "While checking hold, GetMember failed for borrowernumber '$borrowernumber'"); --- a/C4/SIP/Sip/MsgType.pm +++ a/C4/SIP/Sip/MsgType.pm @@ -679,7 +679,7 @@ sub handle_checkin { $resp .= maybe_add( FID_CALL_NUMBER, $item->call_number ); $resp .= maybe_add( FID_DESTINATION_LOCATION, $item->destination_loc ); $resp .= maybe_add( FID_HOLD_PATRON_ID, $item->hold_patron_bcode ); - $resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name ); + $resp .= maybe_add( FID_HOLD_PATRON_NAME, $item->hold_patron_name( $server->{account}->{da_field_template} ) ); if ( $status->hold and $status->hold->{branchcode} ne $item->destination_loc ) { warn 'SIP hold mismatch: $status->hold->{branchcode}=' . $status->hold->{branchcode} . '; $item->destination_loc=' . $item->destination_loc; --- a/etc/SIPconfig.xml +++ a/etc/SIPconfig.xml @@ -51,6 +51,7 @@ --