public function getCriteria()
 {
     $rank = 0;
     foreach ($this->soap_criteria as $key => $value) {
         $is_advanced = false;
         if ($formelement = $this->formelement_factory->getFormElementByName($this->getTracker()->getId(), $value->field_name)) {
             if ($formelement->userCanRead($this->current_user)) {
                 $criteria = new Tracker_Report_Criteria(0, $this, $formelement, $rank, $is_advanced);
                 $formelement->setCriteriaValueFromSOAP($criteria, $value->value);
                 $this->criteria[$formelement->getId()] = $criteria;
                 $rank++;
             }
         }
     }
     return $this->criteria;
 }
Ejemplo n.º 2
0
    private function createUserStory(PFUser $user, $field_i_want_to_value, $field_status_value) {
        $fields_data = array(
            $this->tracker_formelement_factory->getFormElementByName(self::USER_STORIES_TRACKER_ID, 'i_want_to')->getId() => $field_i_want_to_value,
            $this->tracker_formelement_factory->getFormElementByName(self::USER_STORIES_TRACKER_ID, 'status')->getId()  => $field_status_value
        );

        $this->tracker_artifact_factory->createArtifact(
            $this->tracker_factory->getTrackerById(self::USER_STORIES_TRACKER_ID),
            $fields_data,
            $user,
            '',
            false
        );
    }
 public function getCriteria()
 {
     $rank = 0;
     $tracker_id = $this->getTracker()->getId();
     foreach ($this->rest_criteria as $field_identifier => $criterion) {
         $formelement = $this->formelement_factory->getFormElementById($field_identifier);
         if (!$formelement) {
             $formelement = $this->formelement_factory->getFormElementByName($tracker_id, $field_identifier);
         }
         if ($formelement && $formelement->userCanRead($this->current_user)) {
             $this->addCriterionToFormElement($formelement, $criterion, $rank);
             $rank++;
         }
     }
     return $this->criteria;
 }
Ejemplo n.º 4
0
 /**
  * @return Tracker_FormElement_Field | null
  */
 private function getPlanningTrackerDurationField(Tracker $planning_tracker)
 {
     return $this->form_element_factory->getFormElementByName($planning_tracker->getId(), Planning_Milestone::DURATION_FIELD_NAME);
 }