[freeside-commits] branch master updated. 99c6f47aa88806bfdbdef64250050273318bf057

Mark Wells mark at 420.am
Wed Nov 19 16:42:07 PST 2014


The branch, master has been updated
       via  99c6f47aa88806bfdbdef64250050273318bf057 (commit)
      from  074e048b805fea95151739aca652425b39e73163 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 99c6f47aa88806bfdbdef64250050273318bf057
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Nov 19 16:41:12 2014 -0800

    allow old "support time" custom field to be viewed, but not edited; #30921

diff --git a/rt/lib/RT/CustomFields.pm b/rt/lib/RT/CustomFields.pm
index 7c77015..5fdac15 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 3fe51c1..387497e 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>

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

Summary of changes:
 rt/lib/RT/CustomFields.pm               |    6 ++----
 rt/share/html/Elements/ShowCustomFields |   13 +++++++++++++
 2 files changed, 15 insertions(+), 4 deletions(-)




More information about the freeside-commits mailing list