[Rt-commit] rt branch, 4.2/hide-empty-cfs-option, created. rt-4.2.4-35-g9ae058f

Jim Brandt jbrandt at bestpractical.com
Thu May 29 14:21:12 EDT 2014


The branch, 4.2/hide-empty-cfs-option has been created
        at  9ae058fa483a8391753ca3737059348c49f5fdfd (commit)

- Log -----------------------------------------------------------------
commit 9ae058fa483a8391753ca3737059348c49f5fdfd
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri May 23 16:42:42 2014 -0400

    Hide empty transaction cfs via new ShowCustomFields option
    
    As noted in the commit, 61a2dea49 removed code that had
    previously hidden transaction cfs with no value in the
    transaction history. Transaction cfs were shown for create,
    comment, and reply whether they had a value or not. After
    that commit, transaction CFs with no value are shown in
    every transaction (a label with (no value)).
    
    This commit explicitly adds back the hiding behavior to prevent
    repeatedly showing labels for empty CFs and cluttering the
    transaction history. However, this changes the behavior from
    RT 4.0 in that it also hides transaction cfs with no value on
    create, comment, and reply transactions also.
    
    Resolves issues ticket 29757

diff --git a/share/html/Elements/ShowCustomFields b/share/html/Elements/ShowCustomFields
index 3bd4b14..4ff0674 100644
--- a/share/html/Elements/ShowCustomFields
+++ b/share/html/Elements/ShowCustomFields
@@ -53,6 +53,7 @@
 % while ( my $CustomField = $CustomFields->Next ) {
 % my $Values = $Object->CustomFieldValues( $CustomField->Id );
 % my $count = $Values->Count;
+% next if $HideEmpty and not $count;
   <tr id="CF-<%$CustomField->id%>-ShowRow">
     <td class="label"><% $CustomField->Name %>:</td>
     <td class="value">
@@ -137,4 +138,5 @@ $Object => undef
 $CustomFields => $Object->CustomFields
 $Grouping => undef
 $Table => 1
+$HideEmpty => 0
 </%ARGS>
diff --git a/share/html/Elements/ShowTransaction b/share/html/Elements/ShowTransaction
index e60a79e..3b2e8da 100644
--- a/share/html/Elements/ShowTransaction
+++ b/share/html/Elements/ShowTransaction
@@ -68,7 +68,7 @@
 
   <div class="content">
 <%PERL>
-$m->comp('/Elements/ShowCustomFields', Object => $Transaction ) if $HasTxnCFs;
+$m->comp('/Elements/ShowCustomFields', Object => $Transaction, HideEmpty => 1 ) if $HasTxnCFs;
 $m->comp(
     'ShowTransactionAttachments',
     %ARGS,

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


More information about the rt-commit mailing list