<& /Admin/Elements/Header, Title => $title &> <& /Elements/Tabs &>

<% $caption %>

<&|/l&>Go to group
<&|/l&>Find groups whose <& /Elements/SelectGroups &>
% unless ( $Groups->Count ) { <&|/l&>No groups matching search criteria found. % } else {

<&|/l&>Select a group:

<& /Elements/CollectionList, OrderBy => 'Name', Order => 'ASC', Rows => $Rows, %ARGS, Format => $Format, Collection => $Groups, AllowSorting => 1, PassArguments => [qw(Format Rows Page Order OrderBy GroupString GroupOp GroupField)], &> % } <%INIT> my $Groups = RT::Groups->new($session{'CurrentUser'}); $Groups->LimitToUserDefinedGroups(); my $title = loc('Group Search'); my $caption; if (length $GroupString) { $caption = loc("Groups matching search criteria"); if ($GroupField =~ /^CustomField-(\d+)/) { $Groups->LimitCustomField( CUSTOMFIELD => $1, OPERATOR => $GroupOp, VALUE => $GroupString, ); } else { $Groups->Limit( FIELD => $GroupField, OPERATOR => $GroupOp, VALUE => $GroupString, ); } RT::Interface::Web::Redirect(RT->Config->Get('WebURL')."/Group/Summary.html?id=".$Groups->First->id) if $Groups->Count == 1 and $Groups->First; } else { $caption = loc("Search a user-defined group"); } $Format ||= RT->Config->Get('GroupSearchResultFormat'); my $Rows = RT->Config->Get('GroupSearchResultRows') || 50; <%ARGS> $Format => undef $GroupString => '' $GroupOp => '=' $GroupField => 'Name'