public function getColumnIdOfKanbanItem(Tracker_Artifact $artifact)
 {
     $row = $this->item_dao->getColumnIdOfKanbanItem($artifact->getTrackerId(), $artifact->getId())->getRow();
     if (!$row) {
         return null;
     }
     return (int) $row['bindvalue_id'];
 }
 private function isArtifactInParentTracker(Tracker_Artifact $linked_artifact)
 {
     $linked_artifact_tracker_id = $linked_artifact->getTrackerId();
     $parent_tracker = $this->tracker->getParent();
     if ($parent_tracker) {
         return $parent_tracker->getId() == $linked_artifact_tracker_id;
     }
     return false;
 }
 /**
  * @return boolean
  */
 private function parentMilestoneHasItemTrackerInItsBacklogTracker(Planning_Milestone $parent_milestone, Tracker_Artifact $artifact_added)
 {
     $backlog_trackers = $this->getBacklogTrackers($parent_milestone);
     foreach ($backlog_trackers as $backlog_tracker) {
         if ($backlog_tracker->getId() === $artifact_added->getTrackerId()) {
             return true;
         }
     }
     return false;
 }
 private function getBaseArtifact(Tracker_Artifact $artifact, array &$properties)
 {
     $last_changeset = $artifact->getLastChangeset();
     $last_changeset_id = $last_changeset ? $last_changeset->getId() : -1;
     $properties = array('id' => $artifact->getId(), 'group_id' => $artifact->getTracker()->getGroupId(), 'tracker_id' => $artifact->getTrackerId(), 'last_changeset_id' => $last_changeset_id);
     $this->artifact_properties_extractor->extractTrackerUserGroups($artifact, $properties);
     $this->artifact_properties_extractor->extractArtifactUserGroups($artifact, $properties);
     if ($last_changeset) {
         $this->artifact_properties_extractor->extractArtifactTextFields($artifact, $last_changeset, $properties);
         $this->artifact_properties_extractor->extractArtifactDateFields($artifact, $last_changeset, $properties);
     }
 }
示例#5
0
 public function getFields(Tracker_Artifact $artifact)
 {
     $diplayed_fields = array();
     $tracker_id = $artifact->getTrackerId();
     foreach ($this->displayed_fields as $diplayed_field_name) {
         $field = $this->form_element_factory->getUsedFieldByNameForUser($tracker_id, $diplayed_field_name, $this->user_manager->getCurrentUser());
         if ($field) {
             $diplayed_fields[] = $field;
         }
     }
     return $diplayed_fields;
 }
 /**
  * Index an artifact
  *
  * @param Tracker_Artifact $artifact The artifact to index
  */
 public function indexArtifactUpdate(Tracker_Artifact $artifact)
 {
     $this->initializeMapping($artifact->getTracker());
     $this->logger->debug('[Tracker] Elasticsearch index artifact #' . $artifact->getId() . ' in tracker #' . $artifact->getTrackerId());
     $this->client->index($artifact->getTrackerId(), $artifact->getId(), $this->tracker_data_factory->getFormattedArtifact($artifact));
 }
 public function queueArtifactDelete(Tracker_Artifact $artifact)
 {
     if ($this->plugin->isAllowed($artifact->getTracker()->getGroupId())) {
         $this->system_event_manager->createEvent(SystemEvent_FULLTEXTSEARCH_TRACKER_ARTIFACT_DELETE::NAME, $this->implodeParams(array($artifact->getId(), $artifact->getTrackerId())), SystemEvent::PRIORITY_MEDIUM, SystemEvent::OWNER_APP);
     }
 }
 public function save(Tracker_Artifact $artifact)
 {
     return $this->getDao()->save($artifact->getId(), $artifact->getTrackerId(), $artifact->useArtifactPermissions());
 }
示例#9
0
 /**
  * @return int
  */
 public function getTrackerId()
 {
     return $this->artifact->getTrackerId();
 }
示例#10
0
 /**
  * Return artifact info from artifact object
  *
  * If there is already an artifact info available in DB result, use this one
  * instead of re-creating it (artifact_info from DB contains extra informations
  * like the "artifact link column value")
  *
  * @param Tracker_Artifact $artifact
  * @param array $artifacts_info
  *
  * @return array
  */
 private function getArtifactInfo(Tracker_Artifact $artifact, array $artifacts_info)
 {
     if (isset($artifacts_info[$artifact->getId()])) {
         return $artifacts_info[$artifact->getId()];
     } else {
         return array('id' => $artifact->getId(), 'last_changeset_id' => $artifact->getLastChangeset()->getId(), 'tracker_id' => $artifact->getTrackerId());
     }
 }