<%doc> Allow the filter rules of a filter rule group to be modified. \ <%ARGS> $id => undef \ <%INIT> unless ( $session{'CurrentUser'} ->HasRight( Object => $RT::System, Right => 'SuperUser' ) ) { Abort( loc('This feature is only available to system administrators.') ); } my $FilterRuleGroup = RT::FilterRuleGroup->new( $session{'CurrentUser'} ); $FilterRuleGroup->Load($id) || Abort("Couldn't load filter rule group '$id'"); my $Title = loc( 'Filter rule group #[_1]: [_2]: Filter rules', $FilterRuleGroup->id, $FilterRuleGroup->Name ); my @Results = (); if ( $ARGS{'Rule'} || $ARGS{'Create'} || $ARGS{'MoveUp'} || $ARGS{'MoveDown'} ) { $m->comp( '/Elements/FilterRules/EditRule:Post', 'ARGSRef' => \%ARGS, 'FilterRuleGroup' => $FilterRuleGroup, 'Edit' => 'FilterRules', 'Results' => \@Results ); } my $FilterRule = undef; if ( $ARGS{'Rule'} && not $ARGS{'Create'} ) { $FilterRule = RT::FilterRule->new( $session{'CurrentUser'} ); $FilterRule->Load( $ARGS{'Rule'} ) || Abort("Couldn't load filter rule '$ARGS{'Rule'}'"); if ( $FilterRule->FilterRuleGroupObj->id != $id ) { Abort( "Filter rule '$ARGS{'Rule'}' is not part of filter rule group '$id'" ); } if ( $FilterRule->IsGroupRequirement ) { Abort( "Filter rule '$ARGS{'Rule'}' is not a filter rule of filter rule group '$id'" ); } $Title = loc( 'Filter rule group #[_1]: [_2]: Filter rule #[_3]: [_4]', $FilterRuleGroup->id, $FilterRuleGroup->Name, $FilterRule->id, $FilterRule->Name ); } elsif ( $ARGS{'Create'} ) { $Title = loc( 'Filter rule group #[_1]: [_2]: Add new filter rule', $FilterRuleGroup->id, $FilterRuleGroup->Name ); } \ <& /Admin/Elements/Header, Title => $Title &> <& /Elements/Tabs &> <& /Elements/ListActions, actions => \@Results &>

% if ($ARGS{'Rule'} || $ARGS{'Create'}) { <& /Elements/FilterRules/EditRule, %ARGS, FilterRuleGroup => $FilterRuleGroup, FilterRule => $FilterRule, Edit => 'FilterRules', PageLink => RT->Config->Get('WebPath') . '/Admin/FilterRules/Filters.html', &> % } else {

<& /Elements/FilterRules/ShowRules, %ARGS, FilterRuleGroup => $FilterRuleGroup, Edit => 'FilterRules', PageLink => RT->Config->Get('WebPath') . '/Admin/FilterRules/Filters.html', &> % }