diff options
Diffstat (limited to 'rt/html/Admin/Groups/Members.html')
-rw-r--r-- | rt/html/Admin/Groups/Members.html | 78 |
1 files changed, 45 insertions, 33 deletions
diff --git a/rt/html/Admin/Groups/Members.html b/rt/html/Admin/Groups/Members.html index fd25b2d7f..5d189a122 100644 --- a/rt/html/Admin/Groups/Members.html +++ b/rt/html/Admin/Groups/Members.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC %# <jesse@bestpractical.com> %# %# (Except where explicitly superseded by other copyright notices) @@ -22,7 +22,9 @@ %# %# You should have received a copy of the GNU General Public License %# along with this program; if not, write to the Free Software -%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +%# 02110-1301 or visit their web page on the internet at +%# http://www.gnu.org/copyleft/gpl.html. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -50,36 +52,37 @@ <& /Elements/ListActions, actions => \@results &> -<& /Elements/TitleBoxStart, title => loc('Editing membership for group [_1]', $Group->Name) &> +<&| /Widgets/TitleBox, title => loc('Editing membership for group [_1]', $Group->Name) &> -<FORM ACTION="<%$RT::WebPath%>/Admin/Groups/Members.html" METHOD=POST> -<INPUT TYPE=HIDDEN NAME=id VALUE="<%$Group->Id%>"> -<TABLE WIDTH="100%"> -<TR> -<TD> +<form action="<%$RT::WebPath%>/Admin/Groups/Members.html" method="post"> +<input type="hidden" class="hidden" name="id" value="<%$Group->Id%>" /> +<table width="100%"> +<tr> +<td> <h3><&|/l&>Current members</&></h3> -</TD> -<TD> +</td> +<td> <h3><&|/l&>Add members</&></h3> -</TD> -</TR> +</td> +</tr> -<TR> -<TD VALIGN=TOP> +<tr> +<td valign="top"> % if ($Group->MembersObj->Count == 0 ) { -<i><&|/l&>(No members)</&></i> +<em><&|/l&>(No members)</&></em> % } else { -<i><&|/l&>(Check box to delete)</&></i> -<br> -<br> +<em><&|/l&>(Check box to delete)</&></em> +<br /> +<br /> <&|/l&>Users</&> -% my $UserMembers = $Group->MembersObj; -% $UserMembers->LimitToUsers(); -<UL> -% while (my $member = $UserMembers->Next()) { -<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>" value="1"> -<%$member->MemberObj->Object->Name%> (<%$member->MemberObj->Object->RealName%>) +% my $Users = $Group->UserMembersObj; +% $Users->OrderBy( FIELD => $UserOrderBy, ORDER => $UserOrder ); +<ul> +% while (my $user = $Users->Next()) { +% $UsersSeen{$user->id} = 1 if $SkipSeenUsers; +<li><input type="checkbox" class="checkbox" name="DeleteMember-<%$user->PrincipalObj->Id%>" value="1" /> +<%$user->Name%> (<%$user->RealName%>) % } </ul> <&|/l&>Groups</&> @@ -87,18 +90,20 @@ % my $GroupMembers = $Group->MembersObj; % $GroupMembers->LimitToGroups(); % while (my $member = $GroupMembers->Next()) { -<LI><INPUT TYPE=CHECKBOX Name="DeleteMember-<%$member->MemberId%>" value="1"> +% $GroupsSeen{$member->MemberId} = 1 if $SkipSeenGroups; +<li><input type="checkbox" class="checkbox" name="DeleteMember-<%$member->MemberId%>" value="1" /> <%$member->MemberObj->Object->Name%> % } % } -</UL> -</TD> -<TD VALIGN=TOP> -<& /Admin/Elements/SelectNewGroupMembers, Name => "AddMembers", Group => $Group &> -</TD> -</TR> -</TABLE> -<& /Elements/TitleBoxEnd &> +</ul> +</td> +<td valign="top"> +<& /Admin/Elements/SelectNewGroupMembers, Name => "AddMembers", Group => $Group, + SkipUsers => \%UsersSeen, SkipGroups => \%GroupsSeen &> +</td> +</tr> +</table> +</&> <& /Elements/Submit, Label => loc('Modify Members'), Reset => 1 &> </form> @@ -146,6 +151,9 @@ foreach my $member (@AddMembers) { push (@results, $msg); } +my %UsersSeen; +my %GroupsSeen; +$GroupsSeen{$Group->id} = 1; # can't be a member of ourself </%INIT> @@ -153,4 +161,8 @@ foreach my $member (@AddMembers) { $AddMembersUsers => undef $AddMembersGroups => undef $id => undef +$UserOrderBy => 'Name' +$UserOrder => 'ASC' +$SkipSeenUsers => 1 +$SkipSeenGroups => 1 </%ARGS> |