本文整理匯總了PHP中Tracker_Artifact::getWorkflow方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tracker_Artifact::getWorkflow方法的具體用法?PHP Tracker_Artifact::getWorkflow怎麽用?PHP Tracker_Artifact::getWorkflow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Tracker_Artifact
的用法示例。
在下文中一共展示了Tracker_Artifact::getWorkflow方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: saveNewChangesetForField
/**
* @see Tracker_Artifact_Changeset_NewChangesetCreatorBase::saveNewChangesetForField()
*/
protected function saveNewChangesetForField(Tracker_FormElement_Field $field, Tracker_Artifact $artifact, $previous_changeset, array $fields_data, PFUser $submitter, $changeset_id)
{
$is_submission = false;
$bypass_perms = true;
$workflow = $artifact->getWorkflow();
if ($this->isFieldSubmitted($field, $fields_data)) {
if ($field->userCanUpdate()) {
return $field->saveNewChangeset($artifact, $previous_changeset, $changeset_id, $fields_data[$field->getId()], $submitter, $is_submission);
} else {
if ($workflow && $workflow->bypassPermissions($field)) {
return $field->saveNewChangeset($artifact, $previous_changeset, $changeset_id, $fields_data[$field->getId()], $submitter, $is_submission, $bypass_perms);
} else {
return $field->saveNewChangeset($artifact, $previous_changeset, $changeset_id, null, $submitter, $is_submission);
}
}
} else {
return $field->saveNewChangeset($artifact, $previous_changeset, $changeset_id, null, $submitter, $is_submission);
}
}
示例2: saveNewChangesetForField
/**
* @see parent::saveNewChangesetForField()
*/
protected function saveNewChangesetForField(Tracker_FormElement_Field $field, Tracker_Artifact $artifact, array $fields_data, PFUser $submitter, $changeset_id)
{
$is_submission = true;
$bypass_perms = true;
$workflow = $artifact->getWorkflow();
if ($this->isFieldSubmitted($field, $fields_data)) {
if ($field->userCanSubmit()) {
$field->saveNewChangeset($artifact, null, $changeset_id, $fields_data[$field->getId()], $submitter, $is_submission);
} else {
if ($workflow && $workflow->bypassPermissions($field)) {
$field->saveNewChangeset($artifact, null, $changeset_id, $fields_data[$field->getId()], $submitter, $is_submission, $bypass_perms);
}
}
} else {
if (!$field->userCanSubmit() && $field->isSubmitable()) {
$this->pushDefaultValueInSubmittedValues($field, $fields_data);
$field->saveNewChangeset($artifact, null, $changeset_id, $fields_data[$field->getId()], $submitter, $is_submission, $bypass_perms);
}
}
}
示例3: askWorkflowToUpdateTheRequestAndCheckGlobalRules
private function askWorkflowToUpdateTheRequestAndCheckGlobalRules(Tracker_Artifact $artifact, array &$fields_data, PFUser $submitter)
{
$workflow = $artifact->getWorkflow();
if ($workflow) {
$workflow->before($fields_data, $submitter, $artifact);
$augmented_data = $this->field_initializator->process($artifact, $fields_data);
try {
$workflow->checkGlobalRules($augmented_data, $this->formelement_factory);
} catch (Tracker_Workflow_GlobalRulesViolationException $e) {
return false;
}
}
return true;
}