diff options
Diffstat (limited to 'rt/share/html/Admin/Users/Memberships.html')
-rw-r--r-- | rt/share/html/Admin/Users/Memberships.html | 90 |
1 files changed, 1 insertions, 89 deletions
diff --git a/rt/share/html/Admin/Users/Memberships.html b/rt/share/html/Admin/Users/Memberships.html index 74f10b813..1910ff5c2 100644 --- a/rt/share/html/Admin/Users/Memberships.html +++ b/rt/share/html/Admin/Users/Memberships.html @@ -45,92 +45,4 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<& /Admin/Elements/Header, Title => $title &> -<& /Elements/Tabs &> - -<& /Elements/ListActions, actions => \@results &> - -<form method="post" action=""> -<input type="hidden" id="<% $id %>" /> - -<h2><&|/l&>Groups the user is member of (check box to delete)</&></h2> - -<& /Elements/CollectionList, - OrderBy => 'Name', - Order => 'ASC', - %ARGS, - Rows => 20, - DisplayFormat => "__CheckBox.{Delete}__,$Format", - Format => $Format, - Collection => $is_member, - AllowSorting => 1, - PassArguments => [qw(Format Rows Page Order OrderBy id)], -&> - -<h2><&|/l&>Groups the user is not member of (check box to add)</&></h2> - -<& /Elements/CollectionList, - OrderBy => 'Name', - Order => 'ASC', - Rows => 20, - %ARGS, - DisplayFormat => "__CheckBox.{Add}__,'__HasMemberRecursively.{$id}__/TITLE:Recursive',$Format", - Format => $Format, - Collection => $is_not_member, - AllowSorting => 1, - PassArguments => [qw(Format Rows Page Order OrderBy id)], -&> - -<& /Elements/Submit, Label => loc('Update'), Name => 'Update' &> - -</form> - -<%INIT> -my $UserObj = RT::User->new($session{'CurrentUser'}); -$UserObj->Load( $id ) || Abort("Couldn't load user '$id'"); - -my $title = loc("Memberships of the user [_1]", $UserObj->Name); - -my @results; -if ( $Update ) { - foreach my $gid( @Add ) { - my $group = RT::Group->new( $session{'CurrentUser'} ); - $group->LoadUserDefinedGroup( $gid ); - unless ( $group->id ) { - push @results, loc( "Couldn't load group #[_1]", $gid ); - next; - } - my ($status, $msg) = $group->AddMember( $id ); - push @results, $msg; - } - foreach my $gid( @Delete ) { - my $group = RT::Group->new( $session{'CurrentUser'} ); - $group->LoadUserDefinedGroup( $gid ); - unless ( $group->id ) { - push @results, loc( "Couldn't load group #[_1]", $gid ); - next; - } - my ($status, $msg) = $group->DeleteMember( $id ); - push @results, $msg; - } -} - -my $is_member = RT::Groups->new( $session{'CurrentUser'} ); -$is_member->LimitToUserDefinedGroups; -$is_member->WithMember( PrincipalId => $UserObj->Id ); - -my $is_not_member = RT::Groups->new( $session{'CurrentUser'} ); -$is_not_member->LimitToUserDefinedGroups; -$is_not_member->WithoutMember( PrincipalId => $UserObj->Id ); - -$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Groups'}; -</%INIT> -<%ARGS> -$id => undef - -$Update => 0, -@Add => (), -@Delete => (), - -$Format => undef -</%ARGS> +<& /Admin/Elements/MembershipsPage, %ARGS &> |