Exemplo n.º 1
0
 private function importRemainingChangesets(Tracker_Artifact $artifact, array $xml_changesets, Tracker_Artifact_XMLImport_ArtifactFieldsDataBuilder $fields_data_builder)
 {
     $count = 0;
     $this->logger->push('art #' . $artifact->getId());
     foreach ($xml_changesets as $xml_changeset) {
         try {
             $count++;
             $this->logger->push("changeset {$count}");
             $initial_comment_body = '';
             $initial_comment_format = Tracker_Artifact_Changeset_Comment::TEXT_COMMENT;
             if (isset($xml_changeset->comments) && count($xml_changeset->comments->comment) > 0) {
                 $initial_comment_body = (string) $xml_changeset->comments->comment[0]->body;
                 $initial_comment_format = (string) $xml_changeset->comments->comment[0]->body['format'];
             }
             $submitted_by = $this->getSubmittedBy($xml_changeset);
             $changeset = $this->new_changeset_creator->create($artifact, $fields_data_builder->getFieldsData($xml_changeset, $submitted_by), $initial_comment_body, $submitted_by, $this->getSubmittedOn($xml_changeset), $this->send_notifications, $initial_comment_format);
             if ($changeset) {
                 $this->updateComments($changeset, $xml_changeset);
             } else {
                 $this->logger->warn("Impossible to create changeset {$count}: " . $GLOBALS['Response']->getAndClearRawFeedback());
             }
             $this->logger->pop();
         } catch (Tracker_NoChangeException $exception) {
             $this->logger->warn("No Change for changeset {$count}");
             $this->logger->pop();
         } catch (Exception $exception) {
             $this->logger->warn("Unexpected error at changeset {$count}: " . $exception->getMessage());
             $this->logger->pop();
         }
     }
     $this->logger->pop();
 }
 public function __construct(Tracker_Artifact_Changeset_AtGivenDateFieldsValidator $fields_validator, Tracker_FormElementFactory $formelement_factory, Tracker_Artifact_ChangesetDao $changeset_dao, Tracker_Artifact_Changeset_CommentDao $changeset_comment_dao, Tracker_ArtifactFactory $artifact_factory, EventManager $event_manager, ReferenceManager $reference_manager)
 {
     parent::__construct($fields_validator, $formelement_factory, $changeset_dao, $changeset_comment_dao, $artifact_factory, $event_manager, $reference_manager);
 }