本文整理汇总了PHP中thebuggenie\core\entities\Issue::getAvailableWorkflowTransitions方法的典型用法代码示例。如果您正苦于以下问题:PHP Issue::getAvailableWorkflowTransitions方法的具体用法?PHP Issue::getAvailableWorkflowTransitions怎么用?PHP Issue::getAvailableWorkflowTransitions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thebuggenie\core\entities\Issue
的用法示例。
在下文中一共展示了Issue::getAvailableWorkflowTransitions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processIncomingEmailCommand
public function processIncomingEmailCommand($content, Issue $issue)
{
if (!$issue->isWorkflowTransitionsAvailable()) {
return false;
}
$lines = preg_split("/(\r?\n)/", $content);
$first_line = array_shift($lines);
$commands = explode(" ", trim($first_line));
$command = array_shift($commands);
foreach ($issue->getAvailableWorkflowTransitions() as $transition) {
if (strpos(str_replace(array(' ', '/'), array('', ''), mb_strtolower($transition->getName())), str_replace(array(' ', '/'), array('', ''), mb_strtolower($command))) !== false) {
foreach ($commands as $single_command) {
if (mb_strpos($single_command, '=')) {
list($key, $val) = explode('=', $single_command);
switch ($key) {
case 'resolution':
if (($resolution = Resolution::getByKeyish($val)) instanceof Resolution) {
framework\Context::getRequest()->setParameter('resolution_id', $resolution->getID());
}
break;
case 'status':
if (($status = Status::getByKeyish($val)) instanceof Status) {
framework\Context::getRequest()->setParameter('status_id', $status->getID());
}
break;
}
}
}
framework\Context::getRequest()->setParameter('comment_body', join("\n", $lines));
return $transition->transitionIssueToOutgoingStepWithoutRequest($issue);
}
}
}
示例2: componentBulkWorkflow
public function componentBulkWorkflow()
{
$workflow_items = array();
$project = null;
$issues = array();
$first = true;
foreach ($this->issue_ids as $issue_id) {
$issue = new entities\Issue($issue_id);
$issues[$issue_id] = $issue;
if ($first) {
$workflow_items = $issue->getAvailableWorkflowTransitions();
$project = $issue->getProject();
$first = false;
} else {
$transitions = $issue->getAvailableWorkflowTransitions();
foreach ($workflow_items as $transition_id => $transition) {
if (!array_key_exists($transition_id, $transitions)) {
unset($workflow_items[$transition_id]);
}
}
if ($issue->getProject()->getID() != $project->getID()) {
$project = null;
break;
}
}
if (!count($workflow_items)) {
break;
}
}
$this->issues = $issues;
$this->project = $project;
$this->available_transitions = $workflow_items;
}