本文整理汇总了PHP中Tracker_FormElementFactory::getUsedFields方法的典型用法代码示例。如果您正苦于以下问题:PHP Tracker_FormElementFactory::getUsedFields方法的具体用法?PHP Tracker_FormElementFactory::getUsedFields怎么用?PHP Tracker_FormElementFactory::getUsedFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracker_FormElementFactory
的用法示例。
在下文中一共展示了Tracker_FormElementFactory::getUsedFields方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getIndexedFields
private function getIndexedFields(Tracker $tracker)
{
$indexed_fields = array();
foreach ($this->formelement_factory->getUsedFields($tracker) as $field) {
$indexed_fields[$field->getId()] = $field;
}
return $indexed_fields;
}
示例2: trackerHasOnlyTitleRequired
private function trackerHasOnlyTitleRequired(Tracker $tracker, Tracker_Semantic_Title $semantic_title)
{
$used_fields = $this->form_element_factory->getUsedFields($tracker);
foreach ($used_fields as $used_field) {
if ($used_field->isRequired() && $used_field->getId() != $semantic_title->getFieldId()) {
return false;
}
}
return true;
}
示例3: saveArtifactAfterNewChangeset
/**
* Should we move this method outside of changeset creation
* so that we can remove the dependency on artifact factory
* and enforce SRP ?
*/
protected function saveArtifactAfterNewChangeset(Tracker_Artifact $artifact, array $fields_data, PFUser $submitter, Tracker_Artifact_Changeset $new_changeset, Tracker_Artifact_Changeset $previous_changeset = null)
{
if ($this->artifact_factory->save($artifact)) {
$used_fields = $this->formelement_factory->getUsedFields($artifact->getTracker());
foreach ($used_fields as $field) {
$field->postSaveNewChangeset($artifact, $submitter, $new_changeset, $previous_changeset);
}
$artifact->getWorkflow()->after($fields_data, $new_changeset, $previous_changeset);
return true;
}
return false;
}
示例4: validate
/**
* Validate the fields contained in $fields_data, and update $fields_data for invalid data
* $fields_data is an array of [field_id] => field_data
*
* @param array $fields_data The field data
*
* @return boolean true if all fields are valid, false otherwise. This function update $field_data (set values to null if not valid)
*/
public function validate(Tracker_Artifact $artifact, $fields_data)
{
$is_valid = true;
$used_fields = $this->formelement_factory->getUsedFields($artifact->getTracker());
foreach ($used_fields as $field) {
$submitted_value = $this->getSubmittedValue($field, $fields_data);
if ($this->canValidateField($artifact, $field)) {
$is_valid = $this->validateField($artifact, $field, $submitted_value) && $is_valid;
}
}
return $is_valid;
}
示例5: getTrackerFields
/**
* getTrackerFields - returns an array of TrackerFields used in the tracker tracker_id of the project identified by group_id
*
* @param string $session_key the session hash associated with the session opened by the person who calls the service
* @param int $group_id the ID of the project
* @param int $tracker_id the ID of the Tracker
* @return array the array of SOAPTrackerFields used in the tracker $tracker_id in the project identified by $group_id,
* or a soap fault if tracker_id or group_id does not match with a valid project/tracker.
*/
public function getTrackerFields($session_key, $group_id, $tracker_id)
{
try {
$current_user = $this->soap_request_validator->continueSession($session_key);
$project = $this->getProjectById($group_id, 'getTrackerFields');
$this->checkUserCanAccessProject($current_user, $project);
$tracker = $this->getTrackerById($group_id, $tracker_id, 'getTrackerFields');
// The function getTrackerFields returns all tracker fields,
// even those the user is NOT allowed to view -> we will filter in trackerlist_to_soap
$tracker_fields = $this->formelement_factory->getUsedFields($tracker);
return $this->trackerfields_to_soap($current_user, $tracker, $tracker_fields);
} catch (Exception $e) {
return new SoapFault((string) $e->getCode(), $e->getMessage());
}
}