• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Tracker_Artifact_Changeset类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Tracker_Artifact_Changeset的典型用法代码示例。如果您正苦于以下问题:PHP Tracker_Artifact_Changeset类的具体用法?PHP Tracker_Artifact_Changeset怎么用?PHP Tracker_Artifact_Changeset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Tracker_Artifact_Changeset类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getFullRESTValue

 public function getFullRESTValue(PFUser $user, Tracker_Artifact_Changeset $changeset)
 {
     $classname_with_namespace = 'Tuleap\\Tracker\\REST\\Artifact\\ArtifactFieldValueFullRepresentation';
     $artifact_field_value_full_representation = new $classname_with_namespace();
     $artifact_field_value_full_representation->build($this->getId(), Tracker_FormElementFactory::instance()->getType($this), $this->getLabel(), (int) $changeset->getArtifact()->getPerTrackerArtifactId());
     return $artifact_field_value_full_representation;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:7,代码来源:Tracker_FormElement_Field_PerTrackerArtifactIdclass.php


示例2: exportSnapshotWithoutComments

 /**
  * Same as exportFullHistory() but only the current state of the artifact
  */
 public function exportSnapshotWithoutComments(SimpleXMLElement $artifacts_xml, Tracker_Artifact_Changeset $changeset)
 {
     $artifact_xml = $artifacts_xml->addChild('artifact');
     $artifact_xml->addAttribute('id', $changeset->getArtifact()->getId());
     $artifact_xml->addAttribute('tracker_id', $changeset->getArtifact()->getTrackerId());
     $this->changeset_exporter->exportWithoutComments($artifact_xml, $changeset);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:ArtifactXMLExporter.php


示例3: build

 /**
  * @return Tracker_Artifact_Changeset
  */
 public function build()
 {
     $changeset = new Tracker_Artifact_Changeset($this->id, $this->artifact, $this->submitted_by, $this->submitted_on, $this->email);
     if ($this->comment !== null) {
         $changeset->setLatestComment($this->comment);
     }
     return $changeset;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:aChangeset.php


示例4: getRawMailForChangeset

 private function getRawMailForChangeset(Tracker_Artifact_Changeset $changeset)
 {
     $raw_mails = $this->getCachedRawMailByChangesetsForArtifact($changeset->getArtifact());
     $changeset_id = $changeset->getId();
     if (isset($raw_mails[$changeset_id])) {
         return $raw_mails[$changeset_id];
     }
     return null;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:IncomingMailGoldenRetriever.php


示例5: hasChanges

 private function hasChanges(Tracker_Artifact_Changeset $new_changeset, Tracker_Artifact_Changeset $previous_changeset = null)
 {
     if (!$previous_changeset) {
         return true;
     }
     $new_value = $new_changeset->getValue($this->field);
     $previous_value = $previous_changeset->getValue($this->field);
     $diff = $new_value->getArtifactLinkInfoDiff($previous_value);
     return $diff->hasChanges();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:ProcessChildrenTriggersCommand.class.php


示例6: fetchRawValueFromChangeset

 /**
  * Fetch the value in a specific changeset
  * @param Tracker_Artifact_Changeset $changeset
  * @return string
  */
 public function fetchRawValueFromChangeset($changeset)
 {
     $value = '';
     if ($v = $changeset->getValue($this)) {
         if ($row = $this->getValueDao()->searchById($v->getId(), $this->id)->getRow()) {
             $value = $row['value'];
         }
     }
     return $value;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:15,代码来源:Tracker_FormElement_Field_Alphanum.class.php


示例7: exportFullHistory

 public function exportFullHistory(SimpleXMLElement $artifact_xml, Tracker_Artifact_Changeset $changeset)
 {
     $changeset_xml = $artifact_xml->addChild('changeset');
     if ($changeset->getSubmittedBy()) {
         $this->user_xml_exporter->exportUserByUserId($changeset->getSubmittedBy(), $changeset_xml, 'submitted_by');
     } elseif ($changeset->getEmail()) {
         $this->user_xml_exporter->exportUserByMail($changeset->getEmail(), $changeset_xml, 'submitted_by');
     }
     $submitted_on = $changeset_xml->addChild('submitted_on', date('c', $changeset->getSubmittedOn()));
     $submitted_on->addAttribute('format', 'ISO8601');
     $comments_node = $changeset_xml->addChild('comments');
     if ($changeset->getComment()) {
         $changeset->getComment()->exportToXML($comments_node);
     }
     $this->values_exporter->exportChangedFields($artifact_xml, $changeset_xml, $changeset->getArtifact(), $changeset->getValues());
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:16,代码来源:ChangesetXMLExporter.class.php


示例8: create

 /**
  * Add an artefact in the tracker
  *
  * @return Tracker_Artifact or false if an error occured
  */
 public function create(Tracker $tracker, array $fields_data, PFUser $user, $submitted_on, $send_notification)
 {
     $artifact = $this->getBareArtifact($tracker, $user, $submitted_on);
     if (!$this->fields_validator->validate($artifact, $fields_data)) {
         return;
     }
     $use_artifact_permissions = 0;
     $id = $this->artifact_dao->create($tracker->id, $user->getId(), $submitted_on, $use_artifact_permissions);
     if (!$id) {
         return;
     }
     $artifact->setId($id);
     $changeset_id = $this->changeset_creator->create($artifact, $fields_data, $user, $submitted_on);
     if (!$changeset_id) {
         return;
     }
     $changeset = new Tracker_Artifact_Changeset($changeset_id, $artifact, $artifact->getSubmittedBy(), $artifact->getSubmittedOn(), $user->getEmail());
     if ($send_notification) {
         $changeset->notify();
     }
     return $artifact;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:27,代码来源:Tracker_ArtifactCreator.class.php


示例9: getCrossReferenceListForREST

 private function getCrossReferenceListForREST(Tracker_Artifact_Changeset $changeset)
 {
     $crf = new CrossReferenceFactory($changeset->getArtifact()->getId(), Tracker_Artifact::REFERENCE_NATURE, $this->getTracker()->getGroupId());
     $crf->fetchDatas();
     $list = array();
     $refs = $crf->getFormattedCrossReferences();
     if (!empty($refs['target'])) {
         foreach ($refs['target'] as $refTgt) {
             $list[] = array(self::REST_REF_INDEX => $refTgt['ref'], self::REST_REF_URL => $refTgt['url'], self::REST_REF_DIRECTION => self::REST_REF_DIRECTION_OUT);
         }
     }
     if (!empty($refs['source'])) {
         foreach ($refs['source'] as $refSrc) {
             $list[] = array(self::REST_REF_INDEX => $refSrc['ref'], self::REST_REF_URL => $refSrc['url'], self::REST_REF_DIRECTION => self::REST_REF_DIRECTION_IN);
         }
     }
     if (!empty($refs['both'])) {
         foreach ($refs['both'] as $refBoth) {
             $list[] = array(self::REST_REF_INDEX => $refBoth['ref'], self::REST_REF_URL => $refBoth['url'], self::REST_REF_DIRECTION => self::REST_REF_DIRECTION_BOTH);
         }
     }
     return $list;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:23,代码来源:Tracker_FormElement_Field_CrossReferences.class.php


示例10: extractArtifactDateFields

 public function extractArtifactDateFields(Tracker_Artifact $artifact, Tracker_Artifact_Changeset $last_changeset, array &$properties)
 {
     $tracker = $artifact->getTracker();
     $custom_date_fields = $this->form_element_factory->getUsedCustomDateFields($tracker);
     foreach ($custom_date_fields as $date_field) {
         $last_changeset_value = $last_changeset->getValue($date_field);
         if ($last_changeset->getValue($date_field) && $last_changeset_value) {
             $properties[$date_field->getName()] = date('c', $last_changeset_value->getTimestamp());
         }
     }
     $core_date_fields = $this->form_element_factory->getCoreDateFields($tracker);
     foreach ($core_date_fields as $date_field) {
         if ($date_field instanceof Tracker_FormElement_Field_SubmittedOn) {
             $properties[$date_field->getName()] = date('c', $artifact->getSubmittedOn());
         } elseif ($date_field instanceof Tracker_FormElement_Field_LastUpdateDate) {
             $properties[$date_field->getName()] = date('c', $artifact->getLastUpdateDate());
         }
     }
     $last_modified = $artifact->getLastUpdateDate();
     if ($last_modified === -1) {
         $last_modified = $artifact->getSubmittedOn();
     }
     $properties[self::LAST_UPDATE_PROPERTY] = date('c', $last_modified);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:24,代码来源:ArtifactPropertiesExtractor.class.php


示例11: testDisplayDiffShouldNotStripHtmlTagsInPlainTextFormat

 public function testDisplayDiffShouldNotStripHtmlTagsInPlainTextFormat()
 {
     $diff = "@@ -1 +1 @@\n- Quelle est la couleur <b> du <i> cheval blanc d'Henri IV?\n+ Quelle est la couleur <b> du <i> <s> cheval blanc d'Henri IV?";
     $format = 'text';
     $field = new MockTracker_FormElement_Field_Date();
     $field->setReturnValue('getLabel', 'Summary');
     $changeset = new Tracker_Artifact_Changeset(null, null, null, null, null);
     $result = $changeset->displayDiff($diff, $format, $field);
     $this->assertPattern('%Quelle est la couleur <b> du <i> <s> cheval blanc%', $result);
     $this->assertPattern('%Summary%', $result);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:11,代码来源:Tracker_Artifact_ChangesetTest.php


示例12: fetchRawValueFromChangeset

 /**
  * Fetch the value in a specific changeset
  * @param Tracker_Artifact_Changeset $changeset
  * @return string
  */
 public function fetchRawValueFromChangeset($changeset)
 {
     $value = '';
     if ($v = $changeset->getValue($this)) {
         if (isset($v['value_id'])) {
             $v = array($v);
         }
         foreach ($v as $val) {
             if ($val['value_id'] != 100) {
                 if ($row = $this->getValueDao()->searchById($val['value_id'], $this->id)->getRow()) {
                     if ($value) {
                         $value .= ', ';
                     }
                     $value .= $row['filename'];
                 }
             }
         }
     }
     return $value;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:25,代码来源:Tracker_FormElement_Field_File.class.php


示例13: getSlicedLinkedArtifacts

 /**
  * Retrieve sliced linked artifacts according to user's permissions
  *
  * This is nearly the same as a paginated list however, for performance
  * reasons, the total size may be different than the sum of total paginated
  * artifacts.
  *
  * Example to illustrate the difference between paginated and sliced:
  *
  * Given that artifact links are [12, 13, 24, 39, 65, 69]
  * And that the user cannot see artifact #39
  * When I request linked artifacts by bunchs of 2
  * Then I get [[12, 13], [24], [65, 69]]  # instead of [[12, 13], [24, 65], [69]]
  * And total size will be 6               # instead of 5
  *
  * @param Tracker_Artifact_Changeset $changeset The changeset you want to retrieve artifact from
  * @param PFUser                     $user      The user who will see the artifacts
  * @param int                        $limit     The number of artifact to fetch
  * @param int                        $offset    The offset
  *
  * @return Tracker_Artifact_PaginatedArtifacts
  */
 public function getSlicedLinkedArtifacts(Tracker_Artifact_Changeset $changeset, PFUser $user, $limit, $offset)
 {
     $changeset_value = $changeset->getValue($this);
     if (!$changeset_value) {
         return new Tracker_Artifact_PaginatedArtifacts(array(), 0);
     }
     $artifact_ids = $changeset_value->getArtifactIds();
     $size = count($artifact_ids);
     $artifacts = array();
     foreach (array_slice($artifact_ids, $offset, $limit) as $id) {
         $this->addArtifactUserCanViewFromId($artifacts, $id, $user);
     }
     return new Tracker_Artifact_PaginatedArtifacts($artifacts, $size);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:36,代码来源:Tracker_FormElement_Field_ArtifactLink.class.php


示例14: getEmail

 private function getEmail(PFUser $user, Tracker_Artifact $artifact, Tracker_Artifact_Changeset $changeset)
 {
     return "<" . $artifact->getId() . "-" . $this->getHash($user, $artifact) . "-" . $user->getId() . "-" . $changeset->getId() . "@" . $this->host . ">";
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:4,代码来源:RecipientFactory.class.php


示例15: getRESTValue

 /**
  * Return REST value of a field for a given changeset
  *
  * @param PFUser                     $user
  * @param Tracker_Artifact_Changeset $changeset
  *
  * @return mixed | null if no values
  */
 public function getRESTValue(PFUser $user, Tracker_Artifact_Changeset $changeset)
 {
     $value = $changeset->getValue($this);
     if ($value) {
         return $value->getRESTValue($user);
     }
 }
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:15,代码来源:Tracker_FormElement_Field_PermissionsOnArtifact.class.php


示例16: fetchRawValueFromChangeset

 /**
  * Fetch the value in a specific changeset
  * @param Tracker_Artifact_Changeset $changeset
  * @return string
  */
 public function fetchRawValueFromChangeset($changeset)
 {
     $value = '';
     $values_array = array();
     if ($v = $changeset->getValue($this->field)) {
         $values = $v->getListValues();
         foreach ($values as $val) {
             $values_array[] = $val->getLabel();
         }
     }
     return implode(",", $values_array);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:17,代码来源:Tracker_FormElement_Field_List_Bind_Ugroups.class.php


示例17: linkRawMailToChangeset

 private function linkRawMailToChangeset($raw_mail, Tracker_Artifact_Changeset $changeset)
 {
     $this->logger->debug('Linking created changeset (' . $changeset->getId() . ') to the raw mail.');
     $this->incoming_mail_dao->save($changeset->getId(), $raw_mail);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:5,代码来源:MailGateway.class.php


示例18: addChangeset

 public function addChangeset(Tracker_Artifact_Changeset $changeset)
 {
     $this->changesets[$changeset->getId()] = $changeset;
 }
开发者ID:superlinger,项目名称:tuleap,代码行数:4,代码来源:Tracker_Artifact.class.php


示例19: getFullRESTValueForAnonymous

 public function getFullRESTValueForAnonymous(Tracker_Artifact_Changeset $changeset)
 {
     $user = new PFUser();
     $user->setEmail($changeset->getEmail());
     $user->setRealName($changeset->getEmail());
     $class_user_representation = '\\Tuleap\\User\\REST\\UserRepresentation';
     $user_representation = new $class_user_representation();
     $user_representation->build($user);
     return $user_representation;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:10,代码来源:Tracker_FormElement_Field_List_Bind_UsersValue.class.php


示例20: getFirstValueFor

 /**
  *
  * @param Tracker_Artifact_Changeset $changeset
  * @return string
  */
 public function getFirstValueFor(Tracker_Artifact_Changeset $changeset)
 {
     if ($this->userCanRead()) {
         $value = $changeset->getValue($this);
         if ($value && ($last_values = $value->getListValues())) {
             // let's assume there is no more that one status
             if ($label = array_shift($last_values)->getLabel()) {
                 return $label;
             }
         }
     }
 }
开发者ID:uniteddiversity,项目名称:tuleap,代码行数:17,代码来源:Tracker_FormElement_Field_List.class.php



注:本文中的Tracker_Artifact_Changeset类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Tracker_Definition类代码示例发布时间:2022-05-23
下一篇:
PHP Tracker_ArtifactFactory类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap