<& /Admin/Elements/Header, Title => loc("Admin Lifecycles") &> <& /Elements/Tabs &> <& /Elements/ListActions, actions => \@results &>
<&|/l&>Lifecycle Name:
<&|/l&>Type:
<&|/l&>Clone Lifecycle: % for my $type (@types) {
% for my $lifecycle (@{ $lifecycles{$type} }) {
% }
% }
<& /Elements/Submit, Name => 'Create', Label => loc('Create') &> <%INIT> my @results; my @types = List::MoreUtils::uniq( 'ticket', 'asset', sort keys %RT::Lifecycle::LIFECYCLES_TYPES, ); my %lifecycles; for my $type (@types) { @{ $lifecycles{$type} } = sort { loc($a) cmp loc($b) } grep { $_ ne 'approvals' } RT::Lifecycle->ListAll($type); } if ($Create) { my ($ok, $msg) = RT::Extension::LifecycleUI->CreateLifecycle( CurrentUser => $session{CurrentUser}, Name => $Name, Type => $Type, Clone => $Clone, ); if ($ok) { MaybeRedirectForResults( Actions => [ $msg ], Path => 'Admin/Lifecycles/Modify.html', Arguments => { Type => $Type, Name => $Name }, ); } else { push @results, $msg if !$ok; } } <%ARGS> $Name => undef $Type => 'ticket' $Clone => undef $Create => undef