[Rt-commit] rt branch, 4.2/hide-empty-cfs-option, created. rt-4.2.4-35-gc43681f
Jim Brandt
jbrandt at bestpractical.com
Tue May 27 10:24:39 EDT 2014
The branch, 4.2/hide-empty-cfs-option has been created
at c43681f8de80a53188daf92d682c3780f478ce5c (commit)
- Log -----------------------------------------------------------------
commit c43681f8de80a53188daf92d682c3780f478ce5c
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. 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.
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