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

PHP Tracker_FormElement_Field类代码示例

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

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



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

示例1: getFieldData

 /**
  * Extract Field data from XML input
  *
  * @param Tracker_FormElement_Field $field
  * @param SimpleXMLElement $field_change
  *
  * @return mixed
  */
 public function getFieldData(Tracker_FormElement_Field $field, SimpleXMLElement $field_change)
 {
     $values = $field_change->value;
     $files_infos = array();
     if ($this->isFieldChangeEmpty($values)) {
         $this->logger->warn('Skipped attachment field ' . $field->getLabel() . ': field value is empty.');
         return $files_infos;
     }
     foreach ($values as $value) {
         try {
             $attributes = $value->attributes();
             $file_id = (string) $attributes['ref'];
             $file = $this->files_importer->getFileXML($file_id);
             if (!$this->files_importer->fileIsAlreadyImported($file_id)) {
                 $files_infos[] = $this->getFileInfoForAttachment($file);
                 $this->files_importer->markAsImported($file_id);
             }
         } catch (Tracker_Artifact_XMLImport_Exception_FileNotFoundException $exception) {
             $this->logger->warn('Skipped attachment field ' . $field->getLabel() . ': ' . $exception->getMessage());
         }
     }
     if ($this->itCannotImportAnyFiles($values, $files_infos)) {
         throw new Tracker_Artifact_XMLImport_Exception_NoValidAttachementsException();
     }
     return $files_infos;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:34,代码来源:XMLImportFieldStrategyAttachment.class.php


示例2: getFieldChangeId

 private function getFieldChangeId(Tracker_FormElement_Field $field, $value)
 {
     if (isset($value['format']) && (string) $value['format'] === self::FORMAT_ID) {
         return (string) $value;
     }
     return $field->getFieldData((string) $value);
 }
开发者ID:amanikamail,项目名称:tuleap,代码行数:7,代码来源:XMLImportFieldStrategyOpenList.class.php


示例3: getFieldChangeId

 private function getFieldChangeId(Tracker_FormElement_Field $field, $value)
 {
     if (isset($value['format']) && (string) $value['format'] === self::FORMAT_ID) {
         return $this->xml_fields_mapping->getNewOpenValueId((string) $value);
     }
     return $field->getFieldData((string) $value);
 }
开发者ID:pkdevbox,项目名称:tuleap,代码行数:7,代码来源:XMLImportFieldStrategyOpenList.class.php


示例4: getFieldData

 /**
  * Extract Field data from XML input
  *
  * @param Tracker_FormElement_Field $field
  * @param SimpleXMLElement $field_change
  *
  * @return mixed
  */
 public function getFieldData(Tracker_FormElement_Field $field, SimpleXMLElement $field_change)
 {
     $timestamp = strtotime((string) $field_change->value);
     if ($timestamp > 0) {
         return $field->formatDate(strtotime($field_change->value));
     }
     return '';
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:16,代码来源:XMLImportFieldStrategyDate.class.php


示例5: getValue

 /**
  * Return the value of a field in the current changeset
  *
  * @param Tracker_FormElement_Field $field The field
  *
  * @return Tracker_Artifact_ChangesetValue, or null if not found
  */
 public function getValue(Tracker_FormElement_Field $field)
 {
     $values = $this->getValues();
     if (isset($values[$field->getId()])) {
         return $values[$field->getId()];
     }
     return null;
 }
开发者ID:ndjido,项目名称:tuleap,代码行数:15,代码来源:Tracker_Artifact_Changeset.class.php


示例6: getFullRESTValue

 public function getFullRESTValue(Tracker_FormElement_Field $field)
 {
     $class_user_representation = '\\Tuleap\\Project\\REST\\UserGroupRepresentation';
     $ugroup_representation = new $class_user_representation();
     $ugroup_manager = new UGroupManager();
     $project = $field->getTracker()->getProject();
     $ugroup_representation->build($project->getID(), $ugroup_manager->getById($this->getUgroupId()));
     return $ugroup_representation;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:Tracker_FormElement_Field_List_Bind_UgroupsValue.class.php


示例7: getStaticListDataValue

 private function getStaticListDataValue(Tracker_FormElement_Field $field, $value)
 {
     if (isset($value['format']) && (string) $value['format'] === self::FORMAT_ID) {
         return $this->xml_fields_mapping->getNewValueId((int) $value);
     }
     $result = $this->static_value_dao->searchValueByLabel($field->getId(), (string) $value);
     $row = $result->getRow();
     return (int) $row['id'];
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:9,代码来源:XMLImportFieldStrategyList.class.php


示例8: getMappings

 /**
  * @return array of Cardwall_OnTop_Config_ValueMapping
  */
 public function getMappings(Tracker $tracker, Tracker $mapping_tracker, Tracker_FormElement_Field $mapping_field)
 {
     // Why does we return a collection indexed on value_id in the case of freestyle mappings, and a collection
     // indexed on column_id in the case of status mappings @see getStatusMappings?????????
     // Shouldn't we let TrackerMapping do the indexing so that code in TrackerMapping might exploit that?
     $mappings = $this->getMappingFieldValuesIndexedByTracker($tracker);
     if (isset($mappings[$mapping_tracker->getId()][$mapping_field->getId()])) {
         return $mappings[$mapping_tracker->getId()][$mapping_field->getId()];
     }
     return array();
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:14,代码来源:ValueMappingFactory.class.php


示例9: getLastChangesetWithFieldValue

 /**
  * @return \Tracker_Artifact_Changeset|null
  */
 public function getLastChangesetWithFieldValue(Tracker_Artifact $artifact, Tracker_FormElement_Field $field)
 {
     $dar = $this->dao->searchLastChangesetAndValueForArtifactField($artifact->getId(), $field->getId());
     if ($dar) {
         $row = $dar->getRow();
         $changeset = $this->getChangesetFromRow($artifact, $row);
         $value = $field->getChangesetValue($changeset, $row['value_id'], $row['has_changed']);
         $changeset->setFieldValue($field, $value);
         return $changeset;
     }
     return null;
 }
开发者ID:ansarbek,项目名称:tuleap,代码行数:15,代码来源:Tracker_Artifact_ChangesetFactory.class.php


示例10: getFieldData

 /**
  * Extract Field data from XML input
  *
  * @param Tracker_FormElement_Field $field
  * @param SimpleXMLElement $field_change
  *
  * @return mixed
  */
 public function getFieldData(Tracker_FormElement_Field $field, SimpleXMLElement $field_change)
 {
     $data = array('use_artifact_permissions' => (int) $field_change['use_perm'], 'u_groups' => array());
     foreach ($field_change->ugroup as $ugroup_xml) {
         if (isset($ugroup_xml['ugroup_id'])) {
             $data['u_groups'][] = (int) $ugroup_xml['ugroup_id'];
         } elseif (isset($ugroup_xml['ugroup_name'])) {
             $ugroup_manager = new UGroupManager();
             $ugroup = $ugroup_manager->getUGroupByName($field->getTracker()->getProject(), (string) $ugroup_xml['ugroup_name']);
             $data['u_groups'][] = $ugroup->getId();
         }
     }
     return $data;
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:22,代码来源:XMLImportFieldStrategyPermissionsOnArtifact.class.php


示例11: getBind

 /**
  * Build a binder associated to a list field.
  * @param Tracker_FormElement_Field $field
  * @param string $type ('ug', 'submit', 'Static')
  */
 public function getBind($field, $type)
 {
     $default_value = array();
     $dao = new Tracker_FormElement_Field_List_Bind_DefaultvalueDao();
     foreach ($dao->searchByFieldId($field->id) as $row) {
         $default_value[$row['value_id']] = true;
     }
     $decorators = array();
     $dao = new Tracker_FormElement_Field_List_BindDecoratorDao();
     foreach ($dao->searchByFieldId($field->id) as $row) {
         $decorators[$row['value_id']] = new Tracker_FormElement_Field_List_BindDecorator($row['field_id'], $row['value_id'], $row['red'], $row['green'], $row['blue']);
     }
     $bind = new Tracker_FormElement_Field_List_Bind_Null($field);
     switch ($type) {
         case self::STATIK:
             $dao = new Tracker_FormElement_Field_List_Bind_StaticDao();
             if ($row = $dao->searchByFieldId($field->id)->getRow()) {
                 $values = array();
                 $dao = new Tracker_FormElement_Field_List_Bind_Static_ValueDao();
                 foreach ($dao->searchByFieldId($field->id, $row['is_rank_alpha']) as $row_value) {
                     $values[$row_value['id']] = $this->getStaticValueInstance($row_value['id'], $row_value['label'], $row_value['description'], $row_value['rank'], $row_value['is_hidden']);
                 }
                 $bind = new Tracker_FormElement_Field_List_Bind_Static($field, $row['is_rank_alpha'], $values, $default_value, $decorators);
             }
             break;
         case self::USERS:
             $dao = new Tracker_FormElement_Field_List_Bind_UsersDao();
             if ($row = $dao->searchByFieldId($field->id)->getRow()) {
                 $bind = new Tracker_FormElement_Field_List_Bind_Users($field, $row['value_function'], $default_value, $decorators);
             }
             break;
         case self::UGROUPS:
             $values = array();
             foreach ($this->getUgroupsValueDao()->searchByFieldId($field->id) as $row_value) {
                 $values[$row_value['id']] = $this->getUgroupsValueInstance($row_value['id'], $field->getTracker()->getProject(), $row_value['ugroup_id'], $row_value['is_hidden']);
             }
             $bind = new Tracker_FormElement_Field_List_Bind_Ugroups($field, array_filter($values), $default_value, $decorators, $this->ugroup_manager, $this->getUgroupsValueDao());
             break;
         default:
             trigger_error('Unknown bind "' . $type . '"', E_USER_WARNING);
             break;
     }
     return $bind;
 }
开发者ID:ndjido,项目名称:tuleap,代码行数:49,代码来源:Tracker_FormElement_Field_List_BindFactory.class.php


示例12: isFieldUsedInPostActions

 /**
  * @see Transition_PostActionSubFactory::isFieldUsedInPostActions()
  */
 public function isFieldUsedInPostActions(Tracker_FormElement_Field $field)
 {
     foreach (array_keys($this->post_actions_classes) as $shortname) {
         if ($this->getDao($shortname)->countByFieldId($field->getId()) > 0) {
             return true;
         }
     }
     return false;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:12,代码来源:Transition_PostAction_FieldFactory.class.php


示例13: canFieldBeExportedToCSV

 private function canFieldBeExportedToCSV(Tracker_FormElement_Field $field)
 {
     return $field->isUsed() && $field->userCanRead() && (!is_a($field, 'Tracker_FormElement_Field_ArtifactId') || is_a($field, 'Tracker_FormElement_Field_PerTrackerArtifactId'));
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:4,代码来源:Tracker_Report_Renderer_Table.class.php


示例14: getFieldHTMLValue

 public function getFieldHTMLValue(PFUser $user, Tracker_FormElement_Field $field)
 {
     return $field->fetchCardValue($this->artifact, $this->display_preferences);
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:4,代码来源:SingleCard.class.php


示例15: bypassPermissions

 /**
  * Get the value of bypass_permissions
  *
  * @param Tracker_FormElement_Field $field
  *
  * @return boolean
  */
 public function bypassPermissions($field)
 {
     return $this->getFieldId() == $field->getId() && $this->bypass_permissions;
 }
开发者ID:nterray,项目名称:tuleap,代码行数:11,代码来源:Transition_PostAction_Field.class.php


示例16: isWorkflowField

 /**
  * Say if a field is used to define a workflow
  *
  * @param Tracker_FormElement_Field $field The field
  *
  * @return bool
  */
 public function isWorkflowField(Tracker_FormElement_Field $field)
 {
     $workflow = $this->getWorkflowByTrackerId($field->getTracker()->getId());
     if ($workflow) {
         return $field->getId() == $workflow->getFieldId();
     }
     return false;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:15,代码来源:WorkflowFactory.class.php


示例17: isRequiredFieldsValid

 /**
  * @return bool
  */
 private function isRequiredFieldsValid(Tracker $tracker, Tracker_FormElement_Field $title_field, Tracker_FormElement_Field $description_field)
 {
     $is_required_fields_valid = true;
     $form_elements = $tracker->getFormElementFields();
     reset($form_elements);
     while ($is_required_fields_valid && (list(, $form_element) = each($form_elements))) {
         if ($form_element->isRequired()) {
             $is_required_fields_valid = $form_element->getId() === $title_field->getId() || $form_element->getId() === $description_field->getId();
         }
     }
     return $is_required_fields_valid;
 }
开发者ID:pombredanne,项目名称:tuleap,代码行数:15,代码来源:Tracker_ArtifactByEmailStatus.class.php


示例18: getFieldValue

 private function getFieldValue($fields_data, Tracker_Artifact $artifact, Tracker_FormElement_Field $field)
 {
     $field_id = $field->getId();
     if (isset($fields_data[$field_id])) {
         return $fields_data[$field_id];
     }
     return $this->getFieldValueFromLastChangeset($artifact, $field);
 }
开发者ID:rinodung,项目名称:tuleap,代码行数:8,代码来源:FieldNotEmpty.class.php


示例19: getSelectedValuesForField

 /**
  * Returns the selected values of a field
  *
  * @param Tracker_FormElement_Field $field
  * @param array $value_field_list the selected values to test for the artifact
  *
  * @return array the selected values
  */
 function getSelectedValuesForField($field, $value_field_list)
 {
     if (!is_array($value_field_list)) {
         $value_field_list = array($value_field_list);
     }
     $selected_values = array();
     foreach ($value_field_list as $value_field) {
         $selected_values[] = $field->getBind()->formatArtifactValue($value_field);
     }
     return $selected_values;
 }
开发者ID:bamboolsu,项目名称:tuleap,代码行数:19,代码来源:Tracker_RulesManager.class.php


示例20: setFieldValue

 public function setFieldValue(Tracker_FormElement_Field $field, Tracker_Artifact_ChangesetValue $value = null)
 {
     $this->values[$field->getId()] = $value;
 }
开发者ID:magarnier,项目名称:tuleap,代码行数:4,代码来源:Tracker_Artifact_Changeset.class.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Tracking类代码示例发布时间:2022-05-23
下一篇:
PHP Tracker_FormElementFactory类代码示例发布时间: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