|
Lines 11-17
use warnings;
Link Here
|
| 11 |
|
11 |
|
| 12 |
use C4::SIP::Sip qw(siplog); |
12 |
use C4::SIP::Sip qw(siplog); |
| 13 |
use Carp; |
13 |
use Carp; |
| 14 |
use Template; |
|
|
| 15 |
|
14 |
|
| 16 |
use C4::SIP::ILS::Transaction; |
15 |
use C4::SIP::ILS::Transaction; |
| 17 |
use C4::SIP::Sip qw(add_field maybe_add); |
16 |
use C4::SIP::Sip qw(add_field maybe_add); |
|
Lines 29-34
use Koha::DateUtils qw( dt_from_string );
Link Here
|
| 29 |
use Koha::Holds; |
28 |
use Koha::Holds; |
| 30 |
use Koha::Items; |
29 |
use Koha::Items; |
| 31 |
use Koha::Patrons; |
30 |
use Koha::Patrons; |
|
|
31 |
use Koha::TemplateUtils qw( process_tt ); |
| 32 |
|
32 |
|
| 33 |
=encoding UTF-8 |
33 |
=encoding UTF-8 |
| 34 |
|
34 |
|
|
Lines 183-195
sub hold_patron_name {
Link Here
|
| 183 |
my $borrowernumber = $self->hold_patron_id() or return q{}; |
183 |
my $borrowernumber = $self->hold_patron_id() or return q{}; |
| 184 |
|
184 |
|
| 185 |
if ($template) { |
185 |
if ($template) { |
| 186 |
my $tt = Template->new(); |
|
|
| 187 |
|
| 188 |
my $patron = Koha::Patrons->find($borrowernumber); |
186 |
my $patron = Koha::Patrons->find($borrowernumber); |
| 189 |
|
187 |
return process_tt( $template, { patron => $patron } ); |
| 190 |
my $output; |
|
|
| 191 |
$tt->process( \$template, { patron => $patron }, \$output ); |
| 192 |
return $output; |
| 193 |
} |
188 |
} |
| 194 |
|
189 |
|
| 195 |
my $holder = Koha::Patrons->find( $borrowernumber ); |
190 |
my $holder = Koha::Patrons->find( $borrowernumber ); |
|
Lines 480-500
sub format {
Link Here
|
| 480 |
my ( $self, $template ) = @_; |
475 |
my ( $self, $template ) = @_; |
| 481 |
|
476 |
|
| 482 |
if ($template) { |
477 |
if ($template) { |
| 483 |
require Template; |
|
|
| 484 |
|
| 485 |
my $tt = Template->new(); |
| 486 |
|
| 487 |
my $item = $self->{_object}; |
478 |
my $item = $self->{_object}; |
| 488 |
|
479 |
return process_tt( $template, { item => $item } ); |
| 489 |
my $output; |
|
|
| 490 |
eval { |
| 491 |
$tt->process( \$template, { item => $item }, \$output ); |
| 492 |
}; |
| 493 |
if ( $@ ){ |
| 494 |
siplog("LOG_DEBUG", "Error processing template: $template"); |
| 495 |
return ""; |
| 496 |
} |
| 497 |
return $output; |
| 498 |
} |
480 |
} |
| 499 |
} |
481 |
} |
| 500 |
|
482 |
|