use Sys::Syslog qw(syslog);
use Carp;
+use Template;
use C4::SIP::ILS::Transaction;
use C4::Reserves;
use Koha::Database;
use Koha::Biblios;
-
+use Koha::Patrons;
=encoding UTF-8
}
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'");
$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;
<login id="lpl-sc-beacock" password="xyzzy"
delimiter="|" error-detect="enabled" institution="LPL"
send_patron_home_library_in_af="1"
+ da_field_template="[% patron.surname %][% IF patron.firstname %], [% patron.firstname %][% END %]"
av_field_template="[% accountline.description %] [% accountline.amountoutstanding | format('%.2f') %]" >
<screen_msg_regex find="Greetings from Koha." replace="Welcome to your library!" />
<screen_msg_regex find="Invalid patron barcode." replace="Barcode not found, are you sure this is your library card?" />