diff --git a/module/execution/model.php b/module/execution/model.php index f9189e7435..1df64307e6 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -4722,38 +4722,6 @@ class executionModel extends model $this->dao->update(TABLE_PROJECT)->set('path')->eq($path['path'])->set('grade')->eq($path['grade'])->where('id')->eq($execution->id)->exec(); } - /** - * Build execution action menu. - * - * @param object $execution - * @param string $type - * @access public - * @return string - */ - public function buildOperateMenu($execution, $type = 'view') - { - if($execution->deleted) return ''; - - $menu = ''; - $params = "executionID=$execution->id"; - - $menu .= "
"; - $menu .= $this->buildMenu('execution', 'start', $params, $execution, $type, '', '', 'iframe', true); - $menu .= $this->buildMenu('execution', 'activate', $params, $execution, $type, '', '', 'iframe', true); - $menu .= $this->buildMenu('execution', 'putoff', $params, $execution, $type, '', '', 'iframe', true); - $menu .= $this->buildMenu('execution', 'suspend', $params, $execution, $type, '', '', 'iframe', true); - $menu .= $this->buildMenu('execution', 'close', $params, $execution, $type, '', '', 'iframe', true); - - $menu .= ""; - $menu .= $this->buildFlowMenu('execution', $execution, 'view', 'direct'); - $menu .= ""; - - $menu .= $this->buildMenu('execution', 'edit', "execution=$execution->id", $execution); - $menu .= $this->buildMenu('execution', 'delete', "execution=$execution->id", $execution, 'button', 'trash', 'hiddenwin'); - - return $menu; - } - /** * Generate row for dtable. * diff --git a/module/execution/test/execution.class.php b/module/execution/test/execution.class.php index 50fc1015e6..420f861596 100644 --- a/module/execution/test/execution.class.php +++ b/module/execution/test/execution.class.php @@ -2621,21 +2621,6 @@ class executionTest return $_SESSION['executionsearchParams']['queryID']; } - /** - * Test build operate menu. - * - * @param int $executionID - * @access public - * @return string - */ - public function buildOperateMenuTest($executionID = 0) - { - $execution = $this->executionModel->getByID($executionID); - if(empty($execution)) return '0'; - - return $this->executionModel->buildOperateMenu($execution); - } - /** * Test print nested list. * diff --git a/module/execution/test/model/buildoperatemenu.php b/module/execution/test/model/buildoperatemenu.php deleted file mode 100644 index 5d807a12f4..0000000000 --- a/module/execution/test/model/buildoperatemenu.php +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env php -id->range('1-5'); -$execution->name->range('项目1,项目2,迭代1,迭代2,迭代3'); -$execution->type->range('project{2},sprint,stage,kanban'); -$execution->status->range('doing'); -$execution->parent->range('0,0,1,1,2'); -$execution->project->range('0,0,1,1,2'); -$execution->grade->range('2{2},1{3}'); -$execution->path->range('1,2,`1,3`,`1,4`,`2,5`')->prefix(',')->postfix(','); -$execution->begin->range('20230102 000000:0')->type('timestamp')->format('YY/MM/DD'); -$execution->end->range('20230212 000000:0')->type('timestamp')->format('YY/MM/DD'); -$execution->gen(5); - -su('admin'); -/** - -title=测试 executionModel::buildOperateMenu(); -cid=1 -pid=1 - -执行不存在 >> 0 -执行存在 >> div - -*/ - -$executionTester = new executionTest(); -$menus1 = $executionTester->buildOperateMenuTest(0); -$menus2 = $executionTester->buildOperateMenuTest(3); - -r($menus1) && p() && e('0'); // 项目集不存在 -r(substr($menus2, 1, 3)) && p() && e('div'); // 项目集存在