<%doc> Page to list the filter rule groups for management. \ <%ARGS> $FindDisabled => 1 $SearchOp => 'LIKE' $SearchString => '' $MoveUp => undef $MoveDown => undef \ <%INIT> unless ( $session{'CurrentUser'} ->HasRight( Object => $RT::System, Right => 'SuperUser' ) ) { Abort( loc('This feature is only available to system administrators.') ); } my $Title = loc('Admin filter rule groups'); my @Results = (); if ($MoveUp) { my $Object = RT::FilterRuleGroup->new( $session{'CurrentUser'} ); $Object->Load($MoveUp); if ( $Object->id ) { my ( $ok, $msg ) = $Object->MoveUp; push @Results, $msg; } else { push @Results, loc( "Couldn't load filter rule group '[_1]'", $MoveUp ); } } if ($MoveDown) { my $Object = RT::FilterRuleGroup->new( $session{'CurrentUser'} ); $Object->Load($MoveDown); if ( $Object->id ) { my ( $ok, $msg ) = $Object->MoveDown; push @Results, $msg; } else { push @Results, loc( "Couldn't load filter rule group '[_1]'", $MoveDown ); } } my $Collection = RT::FilterRuleGroups->new( $session{'CurrentUser'} ); $Collection->FindAllRows if ($FindDisabled); my ($Caption); if ( defined $SearchString && length $SearchString ) { $Caption = $FindDisabled ? loc("All filter rule groups matching search criteria") : loc("Enabled filter rule groups matching search criteria"); $Collection->Limit( FIELD => 'Name', OPERATOR => $SearchOp, VALUE => $SearchString, ); RT::Interface::Web::Redirect( RT->Config->Get('WebURL') . "Admin/FilterRules/Modify.html?id=" . $Collection->First->id ) if $Collection->Count == 1; } else { $Collection->UnLimit; $Caption = $FindDisabled ? loc("All filter rule groups") : loc("Enabled filter rule groups"); } my $Rows = 50; my $Format = "'__id__/TITLE:#'," . "'__Name__'," . "'__CanMatchQueues__'," . "'__CanTransferQueues__'," . "'__CanUseGroups__'," . "'__RequirementsCount__'," . "'__FilterRulesCount__'," . "'__Disabled__'," . "'__MoveFilterRuleGroup__'"; \ <& /Admin/Elements/Header, Title => $Title &> <& /Elements/Tabs &> <& /Elements/ListActions, actions => \@Results &>

<%$Caption%>

% foreach my $Field ( qw(Rows Page) ) { % next unless defined $ARGS{ $Field } && length $ARGS{ $Field }; % } <&|/l&>Name <& /Elements/SelectMatch, Name => 'SearchOp', Default => $SearchOp &>
%# /> %#

<&|/l&>Select a filter rule group:

% unless ( $Collection->Count ) { <&|/l&>No filter rule groups matching search criteria found. % } else { <& /Elements/CollectionList, OrderBy => 'SortOrder', Order => 'ASC', Rows => $Rows, %ARGS, Format => $Format, Collection => $Collection, AllowSorting => 0, PassArguments => [qw( FindDisabled SearchString SearchOp Rows Page )], &> % }