[Rt-commit] rt branch, 4.2/expose-cf-to-cfvs, repushed

Kevin Falcone falcone at bestpractical.com
Mon Dec 8 15:48:47 EST 2014


The branch 4.2/expose-cf-to-cfvs was deleted and repushed:
       was 0731d196de7da4897dec268b4c53d8fab0370160
       now 803ca7ff7d9b3b871f6f13f18fc3d05f544af86b

1:  0731d19 ! 1:  a84b429 Keep track of which Custom Field object these Values belong to
    @@ -1,6 +1,6 @@
     Author: Kevin Falcone <falcone at bestpractical.com>
     
    -    Keep track of which Custom Field Object these Values belong to
    +    Keep track of which Custom Field object these Values belong to
         
         While you can reverse the Custom Field by looking at
         $cfvs->First->CustomFieldObj you lose the Context Object of the Custom
    @@ -17,7 +17,7 @@
              $class->require or die "Can't load $class: $@";
          }
          my $cf_values = $class->new( $self->CurrentUser );
    -+    $cf_values->SetCustomField( $self );
    ++    $cf_values->SetCustomFieldObject( $self );
          # if the user has no rights, return an empty object
          if ( $self->id && $self->CurrentUserHasRight( 'SeeCustomField') ) {
              $cf_values->LimitToCustomField( $self->Id );
    @@ -37,12 +37,28 @@
          );
      }
      
    -+sub SetCustomField {
    ++=head2 SetCustomFieldObject
    ++
    ++Store the CustomField object which loaded this CustomFieldValues collection.
    ++Consumers of CustomFieldValues collection (such as External Custom Fields)
    ++can now work out how they were loaded (off a Queue or Ticket or something else)
    ++by inspecting the CustomField.
    ++
    ++=cut
    ++
    ++sub SetCustomFieldObject {
     +    my $self = shift;
     +    return $self->{'custom_field'} = shift;
     +}
     +
    -+sub CustomField {
    ++=head2 CustomFieldObject
    ++
    ++Returns the CustomField object used to load this CustomFieldValues collection.
    ++Relies on $CustomField->Values having been called, is not set on manual loads.
    ++
    ++=cut
    ++
    ++sub CustomFieldObject {
     +    my $self = shift;
     +    return $self->{'custom_field'};
     +}
    @@ -51,3 +67,4 @@
      RT::Base->_ImportOverlays();
      
      1;
    +
-:  ------- > 2:  803ca7f Pass down the CustomField object from the collection.



More information about the rt-commit mailing list