& /Admin/Elements/Header, title => loc("Modify template [_1]", $TemplateObj->id) &> <& /Admin/Elements/SystemTabs &> <& /Elements/ListActions, actions => \@results &> <& /Elements/TitleBoxStart, title => $title &>
<%INIT> my $TemplateObj = new RT::Template($session{'CurrentUser'}); my ($title, @results); if ($create) { $title = loc("Create a template"); } else { if ($template eq 'new') { my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name); Abort(loc("Could not create template: [_1]",$msg)) unless ($val); push @results, $msg; $title = loc('Created template [_1]', $TemplateObj->Name()); } else { $TemplateObj->Load($template) || Abort(loc('No Template')); $title = loc('Editing template [_1]', $TemplateObj->Name()); } } if ($TemplateObj->Id()) { my @attribs = qw( Description Content Queue Name); my @aresults = UpdateRecordObject( AttributesRef => \@attribs, Object => $TemplateObj, ARGSRef => \%ARGS); push @results, @aresults; } %INIT> <%ARGS> $Queue => undef $template => undef $create => undef $Name => undef %ARGS>