<%args> $id => undef $comment => undef <%init> my $post = RT::Ticket->new( $session{'CurrentUser'} ); my @Actions; if ( $ARGS{'id'} eq 'new' ) { # new ticket? my $q = RT::Queue->new( $session{'CurrentUser'} ); $q->Load($RT::JournalQueue); $ARGS{'Queue'} = $q->id; $ARGS{'Owner'} = $session{'CurrentUser'}->id; $ARGS{'Status'} = 'new'; my $cat = RT::CustomField->new( $session{'CurrentUser'} ); $cat->LoadByNameAndQueue( Queue => $q->Id, Name => 'RT::Journal-Category'); $ARGS{ 'CustomField-' . $cat->Id } = $ARGS{'Category'}; #$ARGS{'Attachments'}{'Upload'} = $ARGS{'Attach'}; delete $ARGS{'Attach'}; ( $post, @Actions ) = CreateTicket(%ARGS); } else { $post->Load($id); if ($comment) { $post->Correspond( Content => $comment ); } } %$m->comp( 'Elements/Tabs', Title => $post->CreatorObj->Name.": ".$post->Subject );

<%$post->Subject%>

( <%$post->CreatedObj->AsString%>)
<%$post->FirstCustomFieldValue('RT-Journal::Category')%>
<%perl> my $content = $post->Transactions->First->Content; $content =~ s/-- (.*)$//gism; $content =~ s/\n/
/gi; $m->print( $content ); my $refto = $post->RefersTo;
% while( my $link = $refto->Next ) { <%$link->TargetURI->Resolver->HREF%>
% }
% #Todo, only let the right person edit % if ($session{'CurrentUser'} ) { [Edit] % }
% my $history = $post->Transactions(); % $history->Limit(FIELD => 'Type', VALUE => 'Correspond'); % while (my $comment = $history->Next) { % my $attach = $comment->Attachments; <%$comment->CreatorObj->Name%> - ( <%$post->CreatedObj->AsString%>)
<%$comment->Content%> % $attach->Limit(FIELD => 'ContentType', OPERATOR => 'LIKE', VALUE => 'image/jpeg'); % while (my $file = $attach->Next) { Found : <%$attach->id%> / <%$attach->Filename%> % }
%}
--