本文整理汇总了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;
}