当前位置: 首页>>代码示例>>PHP>>正文


PHP Issue::getAvailableWorkflowTransitions方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:RTechSoft,项目名称:thebuggenie,代码行数:33,代码来源:Mailing.php

示例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;
 }
开发者ID:founderio,项目名称:thebuggenie,代码行数:33,代码来源:Components.php


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