diff options
author | Mark Wells <mark@freeside.biz> | 2014-11-19 16:41:12 -0800 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-11-19 16:41:12 -0800 |
commit | 99c6f47aa88806bfdbdef64250050273318bf057 (patch) | |
tree | 002f39639abd835987f298d7d4321738a9c7d029 /rt | |
parent | 074e048b805fea95151739aca652425b39e73163 (diff) |
allow old "support time" custom field to be viewed, but not edited; #30921
Diffstat (limited to 'rt')
-rw-r--r-- | rt/lib/RT/CustomFields.pm | 6 | ||||
-rw-r--r-- | rt/share/html/Elements/ShowCustomFields | 13 |
2 files changed, 15 insertions, 4 deletions
diff --git a/rt/lib/RT/CustomFields.pm b/rt/lib/RT/CustomFields.pm index 7c7701580..5fdac15aa 100644 --- a/rt/lib/RT/CustomFields.pm +++ b/rt/lib/RT/CustomFields.pm @@ -121,8 +121,7 @@ sub LimitToChildType { my $self = shift; my $lookup = shift; - $self->Limit( FIELD => 'LookupType', VALUE => "$lookup" ); - $self->Limit( FIELD => 'LookupType', ENDSWITH => "$lookup" ); + $self->Limit( FIELD => 'LookupType', VALUE => "$lookup", OPERATOR => "ENDSWITH" ); } @@ -137,8 +136,7 @@ sub LimitToParentType { my $self = shift; my $lookup = shift; - $self->Limit( FIELD => 'LookupType', VALUE => "$lookup" ); - $self->Limit( FIELD => 'LookupType', STARTSWITH => "$lookup" ); + $self->Limit( FIELD => 'LookupType', VALUE => "$lookup", OPERATOR => "STARTSWITH" ); } =head2 LimitToObjectId diff --git a/rt/share/html/Elements/ShowCustomFields b/rt/share/html/Elements/ShowCustomFields index 3fe51c109..387497e29 100644 --- a/rt/share/html/Elements/ShowCustomFields +++ b/rt/share/html/Elements/ShowCustomFields @@ -52,6 +52,7 @@ % while ( my $CustomField = $CustomFields->Next ) { % my $Values = $Object->CustomFieldValues( $CustomField->Id ); % my $count = $Values->Count; +% next if $count == 0 and $CustomField->Disabled; <tr id="CF-<%$CustomField->id%>-ShowRow"> <td class="label"><% $CustomField->Name %>:</td> <td class="value"> @@ -70,6 +71,10 @@ % } </td> </tr> +% if ( $CustomFields->IsLast ) { +% # switch to the other result set +% $CustomFields = $HiddenCustomFields; +% } % } % if ($Table) { </table> @@ -83,6 +88,13 @@ $m->callback( CustomFields => $CustomFields, ); +# kludge to allow "Support time" to be displayed even though it's been +# removed +my $HiddenCustomFields = RT::CustomFields->new($session{'CurrentUser'}); +$HiddenCustomFields->LimitToChildType(ref $Object); +$HiddenCustomFields->Limit( FIELD => 'Type', VALUE => 'TimeValue' ); +$HiddenCustomFields->Limit( FIELD => 'Disabled', VALUE => 1 ); + # don't print anything if there is no custom fields return unless $CustomFields->First; $CustomFields->GotoFirstItem; @@ -127,5 +139,6 @@ my $print_value = sub { <%ARGS> $Object => undef $CustomFields => $Object->CustomFields + $Table => 1 </%ARGS> |