[Rt-commit] rt branch, 4.2/hide-empty-cfs-option, created. rt-4.2.4-35-g1846505
Jim Brandt
jbrandt at bestpractical.com
Fri May 23 16:52:42 EDT 2014
The branch, 4.2/hide-empty-cfs-option has been created
at 184650563d9fe1558b33b4eea8ab4069fea56076 (commit)
- Log -----------------------------------------------------------------
commit 184650563d9fe1558b33b4eea8ab4069fea56076
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 not displayed transaction CFs with no
value. Explicitly add back that behavior to prevent
repeatedly showing labels for empty CFs and cluttering
the transaction history.
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