rt 4.0.23
[freeside.git] / rt / share / html / Admin / CustomFields / GroupRights.html
index 2c516d0..2e0b5b0 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
 %#
 %# END BPS TAGGED BLOCK }}}
 <& /Admin/Elements/Header, Title => $title &>
-<& /Admin/Elements/CustomFieldTabs,
-    id => $id,
-    current_tab => "Admin/CustomFields/GroupRights.html?id=".$id,
-    Title => $title
-&>
+<& /Elements/Tabs &>
 <& /Elements/ListActions, actions => \@results &>
 
-  <form method="post" action="GroupRights.html">
+  <form method="post" action="GroupRights.html" id="ModifyGroupRights" name="ModifyGroupRights">
     <input type="hidden" class="hidden" name="id" value="<% $CustomFieldObj->id %>" />
-      
-      
-<h1><&|/l&>System groups</&></h1>
-<table>
-% my $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,
-        Object => $CustomFieldObj  &>
-         </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,
-        Object => $CustomFieldObj  &>
-         </td>
-       </tr>
-% }
-</table>
-            
-      <& /Elements/Submit, Caption => loc("Be sure to save your changes"), Reset => 1 &>
-      
+
+    <& /Admin/Elements/EditRights, Context => $CustomFieldObj, Principals => \@principals &>
+    <& /Elements/Submit, Label => loc('Save Changes') &>
   </form>
-  
+
 <%INIT>
 
 if (!defined $id) {
@@ -103,10 +65,12 @@ if (!defined $id) {
 my $CustomFieldObj = RT::CustomField->new($session{'CurrentUser'});
 $CustomFieldObj->Load($id) || $m->comp("/Elements/Error", Why => loc("Couldn't load CustomField [_1]",$id));
 
-my @results = ProcessACLChanges( \%ARGS );
+my @results = ProcessACLs( \%ARGS );
 
 my $title = loc('Modify group rights for custom field [_1]', $CustomFieldObj->Name);
-    
+
+# Principal collections
+my @principals = GetPrincipalsMap($CustomFieldObj, qw(System Groups));
 </%INIT>
 
 <%ARGS>