[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-210-gf8cae06
Shawn Moore
sartak at bestpractical.com
Mon Jul 26 15:58:42 EDT 2010
The branch, new-style-templates has been updated
via f8cae068f2b550957605829f2a697958cf0d69a3 (commit)
from bbf4626365e126e2c7faa81c26ecb85dfc29d657 (commit)
Summary of changes:
lib/RT/Template_Overlay.pm | 2 +-
t/api/template-simple.t | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
- Log -----------------------------------------------------------------
commit f8cae068f2b550957605829f2a697958cf0d69a3
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Mon Jul 26 16:00:24 2010 -0400
Add a bunch more ticket fields like id and status
diff --git a/lib/RT/Template_Overlay.pm b/lib/RT/Template_Overlay.pm
index a949767..2625650 100755
--- a/lib/RT/Template_Overlay.pm
+++ b/lib/RT/Template_Overlay.pm
@@ -524,7 +524,7 @@ sub _MassageSimpleTemplateArgs {
my $template_args = $args{TemplateArgs};
if (my $ticket = $template_args->{Ticket}) {
- for my $column (qw/Subject Queue/) {
+ for my $column (qw/Id Subject Type InitialPriority FinalPriority Priority TimeEstimated TimeWorked Status TimeLeft Told Starts Started Due Resolved/) {
$template_args->{"Ticket".$column} = $ticket->$column;
}
diff --git a/t/api/template-simple.t b/t/api/template-simple.t
index a60f450..0049ec4 100644
--- a/t/api/template-simple.t
+++ b/t/api/template-simple.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
use RT;
-use RT::Test tests => 167;
+use RT::Test tests => 191;
my $ticket = RT::Ticket->new($RT::SystemUser);
my ($id, $msg) = $ticket->Create(
@@ -68,6 +68,19 @@ TemplateTest(
);
TemplateTest(
+ Content => "\ntest { \$TicketStatus }",
+ FullOutput => "test ",
+ SimpleOutput => "test new",
+);
+
+TemplateTest(
+ Content => "\ntest #{ \$TicketId }",
+ FullOutput => "test #",
+ SimpleOutput => "test #" . $ticket->id,
+);
+
+
+TemplateTest(
Content => "\ntest { \$Nonexistent }",
FullOutput => "test ",
SimpleOutput => "test { \$Nonexistent }",
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list