[Rt-commit] r9512 - rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools
ruz at bestpractical.com
ruz at bestpractical.com
Wed Oct 31 08:24:44 EDT 2007
Author: ruz
Date: Wed Oct 31 08:24:43 2007
New Revision: 9512
Modified:
rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools/ScriptedAction.html
Log:
* fix using of templates in ScriptedActions
Modified: rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools/ScriptedAction.html
==============================================================================
--- rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools/ScriptedAction.html (original)
+++ rtir/branches/2.3-EXPERIMENTAL/html/RTIR/Tools/ScriptedAction.html Wed Oct 31 08:24:43 2007
@@ -198,10 +198,6 @@
$Title = loc("Scripted Action: Create Incidents and Investigations");
}
-my $template = RT::Template->new($session{'CurrentUser'});
-$template->LoadGlobalTemplate( $TemplateName );
-$ARGS{'Template'} = $template->Id;
-
# XXX: what's this?
foreach my $arg (keys %ARGS) {
if ($arg =~ /^Requestorbox-(.+)/) {
@@ -395,7 +391,7 @@
$arg =~ s/_IP_/$ip/g;
# load the selected template
- my $TemplateObj = new RT::Template($session{'CurrentUser'});
+ my $TemplateObj = RT::Template->new( $session{'CurrentUser'} );
$TemplateObj->Load( $ARGS{'Template'} );
# XXX: why don't we handle return values?
my ( $result, $message ) = $TemplateObj->Parse(
@@ -403,6 +399,9 @@
TicketObj => $Ticket,
TransactionObj => $transaction,
);
+ unless ( $result ) {
+ $RT::Logger->error("Couldn't parse template: $message");
+ }
# add the template's MIMEObj to the Attachments list
$session{'Attachments'} = { _Body => $TemplateObj->MIMEObj,
@@ -443,7 +442,6 @@
<%ARGS>
$incidentid => undef
-$TemplateName => 'Correspondence'
$Requestors => undef
$server => undef
$current_tab => "RTIR/Tools/ScriptedAction.html";
More information about the Rt-commit
mailing list