a1ac709e14341416683d2f34fbcde877b7343b79
[freeside.git] / rt / html / Admin / Queues / GroupRights.html
1 %# BEGIN LICENSE BLOCK
2 %# 
3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4 %# 
5 %# (Except where explictly superceded by other copyright notices)
6 %# 
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
10 %# from www.gnu.org.
11 %# 
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 %# General Public License for more details.
16 %# 
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
21 %# 
22 %# 
23 %# END LICENSE BLOCK
24 <& /Admin/Elements/Header, Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &>
25 <& /Admin/Elements/QueueTabs, id => $id, 
26     QueueObj => $QueueObj,                                                      
27     current_tab => $current_tab, 
28     Title => loc('Modify group rights for queue [_1]', $QueueObj->Name) &>
29 <& /Elements/ListActions, actions => \@results &>
30
31   <FORM METHOD=POST ACTION="GroupRights.html">
32     <INPUT TYPE=HIDDEN NAME=id VALUE="<% $QueueObj->id %>">
33       
34       
35 <h1><&|/l&>System groups</&></h1>
36 <TABLE>
37 <& /Elements/Callback, QueueObj => $QueueObj, results => \@results, %ARGS &>
38 % $Groups = RT::Groups->new($session{'CurrentUser'});
39 % $Groups->LimitToSystemInternalGroups();
40 %       while (my $Group = $Groups->Next()) {
41   <TR ALIGN=RIGHT> 
42         <TD VALIGN=TOP>
43             <% loc($Group->Type) %>
44                   </TD>
45           <TD>
46             <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId,
47         Object => $QueueObj  &>
48           </TD>
49         </TR>
50 % }
51 </TABLE>
52 <h1><&|/l&>Roles</&></h1>
53 <TABLE>
54 % $Groups = RT::Groups->new($session{'CurrentUser'});
55 % $Groups->LimitToRolesForQueue($QueueObj->Id);
56 %       while (my $Group = $Groups->Next()) {
57   <TR ALIGN=RIGHT> 
58         <TD VALIGN=TOP>
59             <% loc($Group->Type) %>
60                   </TD>
61           <TD>
62             <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId,
63         Object => $QueueObj  &>
64           </TD>
65         </TR>
66 % }
67 </TABLE>
68 <h1><&|/l&>User defined groups</&></h1>
69 <TABLE>
70 % $Groups = RT::Groups->new($session{'CurrentUser'});
71 % $Groups->LimitToUserDefinedGroups();    
72 %       while (my $Group = $Groups->Next()) {
73   <TR ALIGN=RIGHT> 
74         <TD VALIGN=TOP>
75             <% $Group->Name %>
76                   </TD>
77           <TD>
78             <& /Admin/Elements/SelectRights, PrincipalId => $Group->PrincipalId,
79         Object => $QueueObj  &>
80           </TD>
81         </TR>
82 % }
83 </TABLE>
84             
85       <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
86       
87   </FORM>
88   
89 <%INIT>
90  
91   #Update the acls.
92   my @results =  ProcessACLChanges(\%ARGS);
93
94
95 if (!defined $id) {
96     Abort(loc("No Queue defined"));
97 }
98
99 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
100 $QueueObj->Load($id) || Abort(loc("Couldn't load queue [_1]",$id));
101
102 my $Groups;
103 my $current_tab;
104 $current_tab = 'Admin/Queues/GroupRights.html?id='.$QueueObj->id;
105     
106 </%INIT>
107
108 <%ARGS>
109 $id => undef
110 </%ARGS>