summaryrefslogtreecommitdiff
path: root/rt/share/html/Elements/ShowCustomFields
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2015-07-09 22:18:55 -0700
committerIvan Kohler <ivan@freeside.biz>2015-07-09 22:18:55 -0700
commit1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (patch)
tree96922ad4459eda1e649327fd391d60c58d454c53 /rt/share/html/Elements/ShowCustomFields
parent4f5619288413a185e9933088d9dd8c5afbc55dfa (diff)
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/share/html/Elements/ShowCustomFields')
-rw-r--r--rt/share/html/Elements/ShowCustomFields20
1 files changed, 15 insertions, 5 deletions
diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields
index 75e302bd3..d8e6acf5b 100644
--- a/rt/share/html/Elements/ShowCustomFields
+++ b/rt/share/html/Elements/ShowCustomFields
@@ -45,7 +45,8 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% $m->callback( CallbackName => 'BeforeCustomFields' );
+% $m->callback( CallbackName => 'BeforeCustomFields', Object => $Object,
+% Grouping => $Grouping, ARGSRef => \%ARGS, CustomFields => $CustomFields, Table => $Table );
% if ($Table) {
<table>
% }
@@ -54,6 +55,7 @@
% while ( my $CustomField = $set->Next ) {
% my $Values = $Object->CustomFieldValues( $CustomField->Id );
% my $count = $Values->Count;
+% next if $HideEmpty and not $count;
% next if $count == 0 and $CustomField->Disabled;
<tr id="CF-<%$CustomField->id%>-ShowRow">
<td class="label"><% $CustomField->Name %>:</td>
@@ -72,19 +74,23 @@
</ul>
% }
</td>
+% $m->callback( CallbackName => 'AfterCustomFieldValue', CustomField => $CustomField,
+% Object => $Object, Grouping => $Grouping, Table => $Table );
</tr>
% }
% }
% if ($Table) {
</table>
% }
-% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object );
+% $m->callback( CallbackName => 'AfterCustomFields', Object => $Object,
+% Grouping => $Grouping, ARGSRef => \%ARGS, Table => $Table );
<%INIT>
$m->callback(
%ARGS,
CallbackName => 'MassageCustomFields',
- Object => $Object,
+ Object => $Object,
CustomFields => $CustomFields,
+ Table => $Table,
);
# kludge to allow "Support time" to be displayed even though it's been
@@ -94,6 +100,8 @@ $HiddenCustomFields->LimitToChildType(ref $Object);
$HiddenCustomFields->Limit( FIELD => 'Type', VALUE => 'TimeValue' );
$HiddenCustomFields->LimitToDeleted;
+$CustomFields->LimitToGrouping( $Object => $Grouping ) if defined $Grouping;
+
# don't print anything if there is no custom fields
return unless $CustomFields->Count > 0 or $HiddenCustomFields->Count > 0;
@@ -102,7 +110,7 @@ my $print_value = sub {
my $linked = $value->LinkValueTo;
if ( defined $linked && length $linked ) {
my $linked = $m->interp->apply_escapes( $linked, 'h' );
- $m->out('<a href="'. $linked .'" target="_new">');
+ $m->out('<a href="'. $linked .'" target="_blank">');
}
my $comp = "ShowCustomField". $cf->Type;
$m->callback(
@@ -110,6 +118,7 @@ my $print_value = sub {
Name => \$comp,
CustomField => $cf,
Object => $Object,
+ Table => $Table,
);
if ( $m->comp_exists( $comp ) ) {
$m->comp( $comp, Object => $value );
@@ -137,6 +146,7 @@ my $print_value = sub {
<%ARGS>
$Object => undef
$CustomFields => $Object->CustomFields
-
+$Grouping => undef
$Table => 1
+$HideEmpty => 0
</%ARGS>