From 025528a1570ed60a709fda67d02f7a334c88aad5 Mon Sep 17 00:00:00 2001 From: Koha user Date: Tue, 7 Aug 2012 08:09:19 -0400 Subject: [PATCH] Bug 8606 - Talking Tech broken by Bug 7001 The patches for bug 7001 removed the parseletter subroutine from C4::Letters without updating the talking tech script to use the new alternative. This patch rectifies that situation. Signed-off-by: Chris Cormack --- C4/Letters.pm | 3 +++ .../thirdparty/TalkingTech_itiva_outbound.pl | 23 ++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 0b6a9bec1b..3eb8ace936 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -148,9 +148,12 @@ my %letter; sub getletter { my ( $module, $code, $branchcode ) = @_; + $branchcode |= ''; + if ( C4::Context->preference('IndependantBranches') and $branchcode and C4::Context->userenv ) { + $branchcode = C4::Context->userenv->{'branch'}; } diff --git a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl index 226f17e101..b4d4e9c989 100755 --- a/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl +++ b/misc/cronjobs/thirdparty/TalkingTech_itiva_outbound.pl @@ -127,20 +127,17 @@ foreach my $type (@types) { my $date = C4::Dates->new( $issues->{'date_due'}, 'iso' ); my $due_date = $date->output('metric'); - # gets the placeholder message, and enqueues the letter - my $letter = getletter( $module, $code ); - die "No letter found for type $type!... dying\n" unless $letter; + my $letter = C4::Letters::GetPreparedLetter( + module => $module, + letter_code => $code, + tables => { + borrowers => $issues->{'borrowernumber'}, + biblio => $issues->{'biblionumber'}, + biblioitems => $issues->{'biblionumber'} + }, + ); - # covers basic variable parsing in letter - $letter = - C4::Letters::parseletter( $letter, 'borrowers', - $issues->{'borrowernumber'} ); - $letter = - C4::Letters::parseletter( $letter, 'biblio', - $issues->{'biblionumber'} ); - $letter = - C4::Letters::parseletter( $letter, 'biblioitems', - $issues->{'biblionumber'} ); + die "No letter found for type $type!... dying\n" unless $letter; my $message_id = 0; if ($outfile) { -- 2.39.5