diff options
Diffstat (limited to 'rt/html/Admin/Groups')
-rw-r--r-- | rt/html/Admin/Groups/CustomFields.html | 48 | ||||
-rw-r--r-- | rt/html/Admin/Groups/GroupRights.html | 119 | ||||
-rw-r--r-- | rt/html/Admin/Groups/History.html | 68 | ||||
-rw-r--r-- | rt/html/Admin/Groups/Members.html | 168 | ||||
-rw-r--r-- | rt/html/Admin/Groups/Modify.html | 174 | ||||
-rw-r--r-- | rt/html/Admin/Groups/UserRights.html | 116 | ||||
-rw-r--r-- | rt/html/Admin/Groups/index.html | 113 |
7 files changed, 806 insertions, 0 deletions
diff --git a/rt/html/Admin/Groups/CustomFields.html b/rt/html/Admin/Groups/CustomFields.html new file mode 100644 index 000000000..8ffa54aab --- /dev/null +++ b/rt/html/Admin/Groups/CustomFields.html @@ -0,0 +1,48 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# 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., 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: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/ObjectCustomFields, %ARGS, ObjectType => 'RT::Group' &> diff --git a/rt/html/Admin/Groups/GroupRights.html b/rt/html/Admin/Groups/GroupRights.html new file mode 100644 index 000000000..b81b6a938 --- /dev/null +++ b/rt/html/Admin/Groups/GroupRights.html @@ -0,0 +1,119 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# 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., 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: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> +<& /Admin/Elements/GroupTabs, + GroupObj => $GroupObj, + current_tab => 'Admin/Groups/GroupRights.html?id='.$id, + Title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + + <form method="post" action="GroupRights.html"> + <input type="hidden" class="hidden" name="id" value="<% $GroupObj->id %>" /> + +<&| /Widgets/TitleBox, title => loc('Modify group rights for group [_1]', $GroupObj->Name) &> + +<h1><&|/l&>System groups</&></h1> +<table> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToSystemInternalGroups(); +% while (my $Group = $Groups->Next()) { + <tr align="right"> + <td valign="top"> + <% loc($Group->Type) %> + </td> + <td> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + PrincipalType => 'Group', + Object => $GroupObj &> + </td> + </tr> +% } +</table> +<h1><&|/l&>User defined groups</&></h1> +<table> +% $Groups = RT::Groups->new($session{'CurrentUser'}); +% $Groups->LimitToUserDefinedGroups(); +% while (my $Group = $Groups->Next()) { + <tr align="right"> + <td valign="top"> + <% $Group->Name %> + </td> + <td> + <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId, + PrincipalType => 'Group', + Object => $GroupObj &> + </td> + </tr> +% } +</table> + + </&> + <& /Elements/Submit, Label => loc('Modify Group Rights'), Reset => 1 &> + + </form> + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + + +if (!defined $id) { + Abort(loc("No Group defined")); +} + +my $GroupObj = RT::Group->new($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort(loc("Couldn't load group [_1]",$id)); + +my $Groups; + +</%INIT> + +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Groups/History.html b/rt/html/Admin/Groups/History.html new file mode 100644 index 000000000..ee1d5539c --- /dev/null +++ b/rt/html/Admin/Groups/History.html @@ -0,0 +1,68 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# 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., 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: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GroupTabs, + id => $id, + GroupObj => $GroupObj, + current_subtab => $current_tab, + Title => $title &> + +<& /Ticket/Elements/ShowHistory, + Ticket => $GroupObj, + ShowDisplayModes => 0, +&> + +<%INIT> +my $current_tab = 'Admin/Groups/History.html?id='.$id; +my $GroupObj = new RT::Group($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort("Couldn't load group '$id'"); +my $title = loc("History of the group [_1]", $GroupObj->Name); +</%INIT> +<%ARGS> +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Groups/Members.html b/rt/html/Admin/Groups/Members.html new file mode 100644 index 000000000..77c3fb09f --- /dev/null +++ b/rt/html/Admin/Groups/Members.html @@ -0,0 +1,168 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# 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., 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: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => "RT/Admin/Edit the group ". $Group->Name &> +<& /Admin/Elements/GroupTabs, GroupObj => $Group, + current_tab => 'Admin/Groups/Members.html?id='.$id, + Title => "RT/Admin/Edit the group ". $Group->Name &> +<& /Elements/ListActions, actions => \@results &> + + +<&| /Widgets/TitleBox, title => loc('Editing membership for group [_1]', $Group->Name) &> + +<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> +<h3><&|/l&>Add members</&></h3> +</td> +</tr> + +<tr> +<td valign="top"> + +% if ($Group->MembersObj->Count == 0 ) { +<em><&|/l&>(No members)</&></em> +% } else { +<em><&|/l&>(Check box to delete)</&></em> +<br /> +<br /> +<&|/l&>Users</&> +% 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</&> +<ul> +% my $GroupMembers = $Group->MembersObj; +% $GroupMembers->LimitToGroups(); +% while (my $member = $GroupMembers->Next()) { +% $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, + SkipUsers => \%UsersSeen, SkipGroups => \%GroupsSeen &> +</td> +</tr> +</table> +</&> +<& /Elements/Submit, Label => loc('Modify Members'), Reset => 1 &> +</form> + + +<%INIT> + +my $Group = new RT::Group($session{'CurrentUser'}); +$Group->Load($id) || Abort(loc('Could not load group')); + +my (@results); + +my $key; +foreach $key (keys %ARGS) { + +if ($key =~ /^DeleteMember-(\d+)$/) { + my $id = $1; + my ($val,$msg) = $Group->DeleteMember($id); + push (@results, $msg); +} +} + +# Make sure AddMembers is always an array +my @AddMembers = ( + ((ref $AddMembersUsers eq 'ARRAY') ? @{$AddMembersUsers} : ($AddMembersUsers)), + ((ref $AddMembersGroups eq 'ARRAY') ? @{$AddMembersGroups} : ($AddMembersGroups)), +); + +foreach my $member (@AddMembers) { + next unless ($member); + + my $principal; + + if ($member =~ /^Group-(\d+)$/) { + $principal = RT::Group->new($session{'CurrentUser'}); + $principal->Load($1); + } elsif ($member =~ /^User-(\d+)$/) { + $principal = RT::User->new($session{'CurrentUser'}); + $principal->Load($1); + } else { + next; + } + + + my ($val, $msg) = $Group->AddMember($principal->PrincipalId); + push (@results, $msg); +} + +my %UsersSeen; +my %GroupsSeen; +$GroupsSeen{$Group->id} = 1; # can't be a member of ourself + +</%INIT> + +<%ARGS> +$AddMembersUsers => undef +$AddMembersGroups => undef +$id => undef +$UserOrderBy => 'Name' +$UserOrder => 'ASC' +$SkipSeenUsers => 1 +$SkipSeenGroups => 1 +</%ARGS> diff --git a/rt/html/Admin/Groups/Modify.html b/rt/html/Admin/Groups/Modify.html new file mode 100644 index 000000000..f3c13fe6f --- /dev/null +++ b/rt/html/Admin/Groups/Modify.html @@ -0,0 +1,174 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# 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., 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: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> + +<& /Admin/Elements/GroupTabs, + GroupObj => $Group, + current_tab => $current_tab, + Title => $title &> +<& /Elements/ListActions, actions => \@results &> + + + +<form action="<%$RT::WebPath%>/Admin/Groups/Modify.html" method="post" enctype="multipart/form-data"> + +%unless ($Group->Id) { +<input type="hidden" class="hidden" name="id" value="new" /> +% } else { +<input type="hidden" class="hidden" name="id" value="<%$Group->Id%>" /> +% } +<table> +<tr><td align="right"> +<&|/l&>Name</&>: +</td> +<td><input name="Name" value="<%$Group->Name%>" /></td> +</tr> +<tr> +<td align="right"> +<&|/l&>Description</&>:</td><td colspan="3"><input name="Description" value="<%$Group->Description%>" size="60" /></td> +</tr> +% my $CFs = $Group->CustomFields; +% while (my $CF = $CFs->Next) { +<tr valign="top"><td align="right"> +<% $CF->Name %>: +</td><td> +<& /Elements/EditCustomField, CustomField => $CF, + Object => $Group, + ($Create ? (NamePrefix => 'Object-RT::Group--CustomField-') + : () )&> +</td></tr> +% } +<tr> +<td colspan="2"> +<input type="hidden" class="hidden" name="SetEnabled" value="1" /> +<input type="checkbox" class="checkbox" name="Enabled" value="1" <%$EnabledChecked%> /> <&|/l&>Enabled (Unchecking this box disables this group)</&><br /> +</td> +</tr> +<& /Elements/Callback, GroupObj => $Group, results => \@results, %ARGS &> +</table> +<& /Elements/Submit, Label => loc('Save Changes'), Reset => 1 &> +</form> +<%INIT> + +my $current_tab; +my ($title, @results, $Disabled, $EnabledChecked); + +my $Group = RT::Group->new($session{'CurrentUser'}); + +if ($Create) { + $current_tab = 'Admin/Groups/Modify.html?Create=1'; + $title = loc("Create a new group"); +} + +else { + $current_tab = 'Admin/Groups/Modify.html?id='.$id; + if ($id eq 'new' ) { + + my ($create_id, $create_msg) = $Group->CreateUserDefinedGroup(Name => + "$Name"); + unless ($create_id) { + Abort (loc("Group could not be created: [_1]", $create_msg)); + } + $id = $Group->Id; + } + else { + $Group->Load($id) || Abort('Could not load group'); + } + + + if ($id) { + $title = loc("Modify the group [_1]", $Group->Name); + + } + + # If the create failed + else { + $title = loc("Create a new group"); + $Create = 1; + } + +} + +if ($id) { + + my @fields = qw(Description Name ); + my @fieldresults = UpdateRecordObject ( AttributesRef => \@fields, + Object => $Group, + ARGSRef => \%ARGS ); + push (@results,@fieldresults); + push @results, ProcessObjectCustomFieldUpdates( ARGSRef => \%ARGS, Object => $Group ); +} + +#we're asking about enabled on the web page but really care about disabled. +if ($Enabled == 1) { + $Disabled = 0; +} +else { + $Disabled = 1; +} +if ( ($SetEnabled) and ( $Disabled != $Group->Disabled) ) { + my ($code, $msg) = $Group->SetDisabled($Disabled); + push @results, loc('Enabled status [_1]', loc_fuzzy($msg)); +} + +unless ($Group->Disabled()) { + $EnabledChecked ="CHECKED"; +} + + +</%INIT> + + +<%ARGS> +$Create => undef +$Name => undef +$Description => undef +$SetEnabled => undef +$Enabled => undef +$id => undef +</%ARGS> diff --git a/rt/html/Admin/Groups/UserRights.html b/rt/html/Admin/Groups/UserRights.html new file mode 100644 index 000000000..b77edb011 --- /dev/null +++ b/rt/html/Admin/Groups/UserRights.html @@ -0,0 +1,116 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# 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., 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: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> +<& /Admin/Elements/GroupTabs, + GroupObj => $GroupObj, + current_tab => 'Admin/Groups/UserRights.html?id='.$id, + Title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> +<& /Elements/ListActions, actions => \@results &> + + <form method="post" action="UserRights.html"> + <input type="hidden" class="hidden" name="id" value="<% $GroupObj->id %>" /> + +<&| /Widgets/TitleBox, title => loc('Modify user rights for group [_1]', $GroupObj->Name) &> + +<table> + +% while (my $Member = $Users->Next()) { +% my $UserObj = $Member->MemberObj->Object(); + <tr align="right"> + <td valign="top"> + <% $UserObj->Name %> + </td> + <td> + <& /Admin/Elements/SelectRights, PrincipalId => $Member->MemberObj->Id, + PrincipalType => 'User', + Object => $GroupObj &> + </td> + </tr> +% } + </table> + + </&> + <& /Elements/Submit, Label => loc('Modify User Rights'), Reset => 1 &> + + </form> + +<%INIT> + + #Update the acls. + my @results = ProcessACLChanges(\%ARGS); + +# {{{ Deal with setting up the display of current rights. + + +#Define vars used in html above + + +if (!defined $id) { + Abort(loc("No Group defined")); +} + +my $GroupObj = RT::Group->new($session{'CurrentUser'}); +$GroupObj->Load($id) || Abort(loc("Couldn't load group [_1]",$id)); + +# Find out which users we want to display ACL selects for +my $Privileged = RT::Group->new($session{'CurrentUser'}); +$Privileged->LoadSystemInternalGroup('Privileged'); +my $Users = $Privileged->MembersObj(); + + + +# }}} + +</%INIT> + +<%ARGS> +$id => undef +$UserString => undef +$UserOp => undef +$UserField => undef +</%ARGS> diff --git a/rt/html/Admin/Groups/index.html b/rt/html/Admin/Groups/index.html new file mode 100644 index 000000000..384092bdf --- /dev/null +++ b/rt/html/Admin/Groups/index.html @@ -0,0 +1,113 @@ +%# BEGIN BPS TAGGED BLOCK {{{ +%# +%# COPYRIGHT: +%# +%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# <jesse@bestpractical.com> +%# +%# (Except where explicitly superseded by other copyright notices) +%# +%# +%# LICENSE: +%# +%# This work is made available to you under the terms of Version 2 of +%# the GNU General Public License. A copy of that license should have +%# been provided with this software, but in any event can be snarfed +%# from www.gnu.org. +%# +%# This work is distributed in the hope that it will be useful, but +%# WITHOUT ANY WARRANTY; without even the implied warranty of +%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +%# General Public License for more details. +%# +%# 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., 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: +%# +%# (The following paragraph is not intended to limit the rights granted +%# to you to modify and distribute this software under the terms of +%# the GNU General Public License and is only of importance to you if +%# you choose to contribute your changes and enhancements to the +%# community by submitting them to Best Practical Solutions, LLC.) +%# +%# By intentionally submitting any modifications, corrections or +%# derivatives to this work, or any other work intended for use with +%# Request Tracker, to Best Practical Solutions, LLC, you confirm that +%# you are the copyright holder for those contributions and you grant +%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable, +%# royalty-free, perpetual, license to use, copy, create derivative +%# works based on those contributions, and sublicense and distribute +%# those contributions and any derivatives thereof. +%# +%# END BPS TAGGED BLOCK }}} +<& /Admin/Elements/Header, Title => $title &> +<& /Admin/Elements/GroupTabs, current_tab => 'Admin/Groups/', + current_subtab => 'Admin/Groups/', + Title => $title &> +<%$caption%>:<br /> <ul> +%if ($Groups->Count == 0) { +<li> <em><&|/l&>No groups matching search criteria found.</&></em> +% } +%my @ids; +%while ( my $Group = $Groups->Next) { +% push @ids, $Group->Id; +<li><a href="Modify.html?id=<%$Group->id%>"><%$Group->Name || loc('(empty)')%></a><br /> +%} +</ul> +%if (my $ids = join(',', @ids)) { +<em>(<a href="<%$RT::WebPath%>/Download/Tabular/Group/<% $ids %>/Groups.tsv"><&|/l&>Download as a tab-delimited file</&></a>)</em><br /> +%} +<br /><br /> +<form method="post" action="<% $RT::WebPath %>/Admin/Groups/index.html"> +<input type="checkbox" class="checkbox" name="FindDisabledGroups" value="1" /> <&|/l&>Include disabled groups in listing.</&> +<br /> +<div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div> +</form> + +<br /><br /> +<form method="post" action="<% $RT::WebPath %>/Admin/Groups/index.html"> +<&|/l&>Find groups whose</&> <& /Elements/SelectGroups &><br /> +<div align="right"><input type="submit" class="button" value="<&|/l&>Go!</&>" /></div> +</form> +<%INIT> +my $Groups = RT::Groups->new($session{'CurrentUser'}); +$Groups->LimitToUserDefinedGroups(); +my $title = loc('Select a group'); +my $caption; + +if ($FindDisabledGroups) { + $Groups->FindAllRows(); +} + +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, + ); + } +} +else { + $caption = loc("User-defined groups"); +} +</%INIT> +<%ARGS> +$GroupString => undef +$GroupOp => '=' +$GroupField => 'Name' +$FindDisabledGroups => 0 +</%ARGS> |