[Rt-commit] rt branch, 4.4/bulk-cf-grouping, created. rt-4.4.1-216-g65faf55

Shawn Moore shawn at bestpractical.com
Thu Dec 29 14:18:09 EST 2016


The branch, 4.4/bulk-cf-grouping has been created
        at  65faf55ef8b4c43a0757c451d812b6252f632442 (commit)

- Log -----------------------------------------------------------------
commit bbd24aa9c37b07db95516a8f2f1ebc1d005e5118
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Dec 29 19:06:50 2016 +0000

    Add support for CF grouping in asset bulk update
    
    Asset bulk update had partial support for custom field grouping;
    specifically, any new panels were included as separate panels in bulk
    update, and any CFs that weren't included in any groupings were put into
    the core Custom Fields panel.
    
    However, any custom fields that were included in the Basics, People,
    Links, or Dates panel were not present on the bulk update page at all.
    This commit fixes the first three by adding those groups explicitly to
    those panels. Some CSS adjustments had to be made because the asset bulk
    update CSS is not appropriate for the custom field bulk update table UI.
    For the fourth panel, Dates, we add it as if it were another sort of new
    panel, as assets bulk update does not include a Dates panel at all, as
    neither of the two core date fields for assets (Created and Last
    Updated) are directly editable.
    
    Fixes: I#32198

diff --git a/share/html/Asset/Search/Bulk.html b/share/html/Asset/Search/Bulk.html
index 87a0513..cb5cb40 100644
--- a/share/html/Asset/Search/Bulk.html
+++ b/share/html/Asset/Search/Bulk.html
@@ -80,7 +80,7 @@
 </div>
 
 <&| /Widgets/TitleBox, title => loc("Basics"), class => "asset-basics asset-bulk-basics", title_class => "inverse" &>
-<table>
+<table class="core-fields">
   <tr class="asset-catalog">
     <td class="label"><label for="UpdateCatalog"><&|/l&>Catalog</&></label></td>
     <td><& /Asset/Elements/SelectCatalog, Name => 'UpdateCatalog', Default => $catalog_obj->id, UpdateSession => 0, &></td>
@@ -98,10 +98,15 @@
     <td><& /Asset/Elements/SelectStatus, Name => 'UpdateStatus', DefaultValue => 1, CatalogObj => $catalog_obj &></td>
   </tr>
 </table>
+%   my $cfs = $catalog_obj->AssetCustomFields;
+%   $cfs->LimitToGrouping( 'RT::Asset' => 'Basics');
+%   if ( $cfs->Count ) {
+<& /Elements/BulkCustomFields, CustomFields => $cfs, &>
+%   }
 </&>
 
 <&| /Widgets/TitleBox, title => loc("People"), class => "asset-people asset-bulk-people", title_class => "inverse" &>
-<table>
+<table class="core-fields">
 % for my $rname ( $asset->Roles( ACLOnly => 0 ) ) {
 % my $role = $asset->Role( $rname );
 % if ( $role->{'Single'} ) {
@@ -130,9 +135,22 @@
 </tr>
 % }
 % }
+%   my $cfs = $catalog_obj->AssetCustomFields;
+%   $cfs->LimitToGrouping( 'RT::Asset' => 'People');
+%   if ( $cfs->Count ) {
+<& /Elements/BulkCustomFields, CustomFields => $cfs, &>
+%   }
 </table>
 </&>
 
+%   my $cfs = $catalog_obj->AssetCustomFields;
+%   $cfs->LimitToGrouping( 'RT::Asset' => 'Dates');
+%   if ( $cfs->Count ) {
+<&| /Widgets/TitleBox, title => loc("Dates"), class => "asset-dates asset-bulk-dates", title_class => "inverse" &>
+<& /Elements/BulkCustomFields, CustomFields => $cfs, &>
+</&>
+%   }
+
 % for my $group ( RT::CustomField->CustomGroupings( 'RT::Asset' ), '' ) {
 %   my $cfs = $catalog_obj->AssetCustomFields;
 %   $cfs->LimitToGrouping( 'RT::Asset' => $group);
@@ -145,6 +163,11 @@
 
 <&|/Widgets/TitleBox, title => loc('Edit Links'), color => "#336633"&>
 <& /Elements/BulkLinks, Collection => $assets, %ARGS &>
+%   my $cfs = $catalog_obj->AssetCustomFields;
+%   $cfs->LimitToGrouping( 'RT::Asset' => 'Links');
+%   if ( $cfs->Count ) {
+<& /Elements/BulkCustomFields, CustomFields => $cfs, &>
+%   }
 </&>
 
 <& /Elements/Submit, Label => loc('Update'), Name => 'Update' &>
diff --git a/share/static/css/base/assets.css b/share/static/css/base/assets.css
index c09a8a7..2689280 100644
--- a/share/static/css/base/assets.css
+++ b/share/static/css/base/assets.css
@@ -210,18 +210,18 @@ body#comp-Asset-Search .collection-as-table td {
         width: 100%;
     }
 
-    .asset-bulk-people tr,
+    .asset-bulk-people table.core-fields tr,
     .asset-search-people tr,
-    .asset-bulk-basics tr,
+    .asset-bulk-basics table.core-fields tr,
     .asset-search-basics tr {
         width: 49%;
         display: inline-block;
         white-space: nowrap;
     }
 
-    .asset-bulk-people tr>td,
+    .asset-bulk-people table.core-fields tr>td,
     .asset-search-people tr>td,
-    .asset-bulk-basics tr>td,
+    .asset-bulk-basics table.core-fields tr>td,
     .asset-search-basics tr>td {
         display: inline-block;
         width: 10em;

commit 65faf55ef8b4c43a0757c451d812b6252f632442
Author: Shawn M Moore <shawn at bestpractical.com>
Date:   Thu Dec 29 19:17:39 2016 +0000

    Fix missing styling for asset bulk Links and CF titleboxes

diff --git a/share/html/Asset/Search/Bulk.html b/share/html/Asset/Search/Bulk.html
index cb5cb40..8fc7d4e 100644
--- a/share/html/Asset/Search/Bulk.html
+++ b/share/html/Asset/Search/Bulk.html
@@ -155,13 +155,13 @@
 %   my $cfs = $catalog_obj->AssetCustomFields;
 %   $cfs->LimitToGrouping( 'RT::Asset' => $group);
 %   if ( $cfs->Count ) {
-<&| /Widgets/TitleBox, class=>'asset-bulk-grouping asset-bulk-cfs', title => loc('Edit [_1]', ($group? loc($group) : loc('Custom Fields')) ) &>
+<&| /Widgets/TitleBox, class=>'asset-bulk-grouping asset-info-cfs asset-bulk-cfs', title => loc('Edit [_1]', ($group? loc($group) : loc('Custom Fields')) ), title_class => "inverse" &>
 <& /Elements/BulkCustomFields, CustomFields => $cfs, &>
 </&>
 %   }
 % }
 
-<&|/Widgets/TitleBox, title => loc('Edit Links'), color => "#336633"&>
+<&|/Widgets/TitleBox, title => loc('Edit Links'), class => "asset-links asset-bulk-links", title_class => "inverse" &>
 <& /Elements/BulkLinks, Collection => $assets, %ARGS &>
 %   my $cfs = $catalog_obj->AssetCustomFields;
 %   $cfs->LimitToGrouping( 'RT::Asset' => 'Links');

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


More information about the rt-commit mailing list