[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.1-337-g6cf0354

Shawn Moore shawn at bestpractical.com
Fri May 5 11:32:15 EDT 2017


The branch, 4.4-trunk has been updated
       via  6cf035492ff95ea4d440e93e812b22be7c4eda77 (commit)
       via  42ca108e1abbe25174a77b2f65779ccb7101f143 (commit)
       via  c2c75995bf7c6765a1c39341d5cefbb01463e564 (commit)
      from  c15c8381e0fc0fdd1b506f8ec8f544b64e821278 (commit)

Summary of changes:
 etc/RT_Config.pm.in                 |  7 +++++
 lib/RT/CustomField.pm               |  1 +
 share/html/Admin/Groups/Modify.html | 56 ++++++++++++++++++++-----------------
 3 files changed, 39 insertions(+), 25 deletions(-)

- Log -----------------------------------------------------------------
commit c2c75995bf7c6765a1c39341d5cefbb01463e564
Author: Dave Goehrig <dave at bestpractical.com>
Date:   Thu May 4 13:16:45 2017 -0400

    Add Custom Grouping to Admin Group
    
    In order to add the EditCustomFieldCustomGrouping support,
    I need to add a default array for the RT::Group.  Trying to
    do it in the same fashion as RT::Asset failed due to
    require dependencies, so the editing of RT::CustomField
    as necessary.
    
    On the Admin/Groups/Modify page I have mirror the layout
    of Admin/Users/Modify with the top level table and nested
    components.  The layout is single column as the custom field
    groupings widget is included as is in a single row.
    
    I confirmed it worked with both variants of the RT_SiteConfig
    Set($CustomFieldGroupings, setting with a number of
    custom fields and groups.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index b2e5aef..cfb1c17 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -968,6 +968,9 @@ Set C<%CustomFieldGroupings> to a nested structure similar to the following:
             'Asset Details' => ['Serial Number', 'Manufacturer', 'Type', 'Tracking Number'],
             'Dates'         => ['Support Expiration', 'Issue Date'],
         ],
+        'RT::Group' => [
+            'Basics' => ['Department'],
+        ],
     );
 
 The first level keys are record types for which CFs may be used, and the
@@ -986,6 +989,8 @@ For C<RT::Ticket>, these groupings are: C<Basics>, C<Dates>, C<Links>, C<People>
 
 For C<RT::User>: C<Identity>, C<Access control>, C<Location>, C<Phones>
 
+For C<RT::Group>: C<Basics>
+
 Extensions may also add their own built-in groupings, refer to the individual
 extension documentation for those.
 
diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index ae81702..c74c707 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -220,6 +220,7 @@ __PACKAGE__->RegisterLookupType( 'RT::Group' => "Groups", );
 __PACKAGE__->RegisterBuiltInGroupings(
     'RT::Ticket'    => [ qw(Basics Dates Links People) ],
     'RT::User'      => [ 'Identity', 'Access control', 'Location', 'Phones' ],
+    'RT::Group'     => [ 'Basics' ],
 );
 
 __PACKAGE__->AddRight( General => SeeCustomField         => 'View custom fields'); # loc
diff --git a/share/html/Admin/Groups/Modify.html b/share/html/Admin/Groups/Modify.html
index d9c4966..e47afa4 100644
--- a/share/html/Admin/Groups/Modify.html
+++ b/share/html/Admin/Groups/Modify.html
@@ -59,34 +59,40 @@
 % } 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||$Name||''%>" /></td>
-</tr>
-<tr>
-<td align="right">
-<&|/l&>Description</&>:</td><td colspan="3"><input name="Description" value="<%$Group->Description||$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, &>
-</td></tr>
-% }
-<tr>
-<td colspan="2">
-<input type="hidden" class="hidden" name="SetEnabled" value="1" />
-<input type="checkbox" class="checkbox" id="Enabled" name="Enabled" value="1" <%$EnabledChecked%> />
-<label for="Enabled"><&|/l&>Enabled (Unchecking this box disables this group)</&></label><br />
-</td>
-</tr>
+  <tr>
+    <td valign="top" class="boxcontainer">
+      <&| /Widgets/TitleBox, title => loc('Basics'), class => 'group-info-basics' &>
+        <table>
+          <tr>
+            <td align="right"><&|/l&>Name</&>:</td>
+            <td><input name="Name" value="<%$Group->Name||$Name||''%>" /></td>
+          </tr>
+          <tr>
+            <td align="right"><&|/l&>Description</&>:</td>
+            <td colspan="3"><input name="Description" value="<%$Group->Description||$Description||''%>" size="60" /></td>
+          </tr>
+          <& /Elements/EditCustomFields, Object => $Group, Grouping => 'Basics', InTable => 1 &>
+          <tr>
+            <td colspan="2">
+              <input type="hidden" class="hidden" name="SetEnabled" value="1" />
+              <input type="checkbox" class="checkbox" id="Enabled" name="Enabled" value="1" <%$EnabledChecked%> />
+              <label for="Enabled"><&|/l&>Enabled (Unchecking this box disables this group)</&></label><br />
+            </td>
+          </tr>
+        </table>
+      </&>
+    </td>
+  </tr>
+  <tr>
+    <td>
+      <& /Elements/EditCustomFieldCustomGroupings , Object => $Group, &>
+    </td>
+  </tr>
 % $m->callback( %ARGS, GroupObj => $Group, results => \@results );
 </table>
+
 % if ( $Create ) {
 <& /Elements/Submit, Label => loc('Create'), Reset => 1 &>
 % } else {

commit 42ca108e1abbe25174a77b2f65779ccb7101f143
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri May 5 15:29:33 2017 +0000

    Document which groupings are available for Assets

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index cfb1c17..d6b402e 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -991,6 +991,8 @@ For C<RT::User>: C<Identity>, C<Access control>, C<Location>, C<Phones>
 
 For C<RT::Group>: C<Basics>
 
+For C<RT::Asset>: C<Basics>, C<Dates>, C<People>, C<Links>
+
 Extensions may also add their own built-in groupings, refer to the individual
 extension documentation for those.
 

commit 6cf035492ff95ea4d440e93e812b22be7c4eda77
Merge: c15c838 42ca108
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Fri May 5 15:32:09 2017 +0000

    Merge branch '4.4/group-admin-customfield-grouping' into 4.4-trunk


-----------------------------------------------------------------------


More information about the rt-commit mailing list