* @package execution * @link https://www.zentao.net */ class executionTao extends executionModel { /** * 将执行ID保存到session中。 * Save the execution ID to the session. * * @param int $executionID * @access protected * @return void */ protected function saveSession(int $executionID): void { $this->session->set('execution', $executionID, $this->app->tab); $this->setProjectSession($executionID); } /** * 获取执行团队成员数量。 * Get execution team member count. * * @param array $executionIdList * @access protected * @return void */ protected function getMemberCountGroup(array $executionIdList): array { return $this->dao->select('t1.root,count(t1.id) as teams')->from(TABLE_TEAM)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account=t2.account') ->where('t1.root')->in($executionIdList) ->andWhere('t1.type')->ne('project') ->andWhere('t2.deleted')->eq(0) ->groupBy('t1.root') ->fetchAll('root'); } /** * 获取执行关联的产品信息。 * Get product information of the linked execution. * * @param int $projectID * @access protected * @return array */ protected function getProductList(int $projectID): array { $executions = $this->dao->select('t1.id,t2.product,t3.name')->from(TABLE_EXECUTION)->alias('t1') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id=t2.project') ->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t2.product=t3.id') ->where('t1.project')->eq($projectID) ->andWhere('t1.type')->in('kanban,sprint,stage') ->fetchAll(); $productList = array(); foreach($executions as $execution) { if(!isset($productList[$execution->id])) { $productList[$execution->id] = new stdclass(); $productList[$execution->id]->product = ''; $productList[$execution->id]->productName = ''; } $productList[$execution->id]->product .= $execution->product . ','; $productList[$execution->id]->productName .= $execution->name . ','; } return $productList; } /** * 设置看板执行的菜单。 * Set kanban menu. * * @access protected * @return void */ protected function setKanbanMenu() { global $lang; $lang->executionCommon = $lang->execution->kanban; include $this->app->getModulePath('', 'execution') . 'lang/' . $this->app->getClientLang() . '.php'; $this->lang->execution->menu = new stdclass(); $this->lang->execution->menu->kanban = array('link' => "{$this->lang->kanban->common}|execution|kanban|executionID=%s", 'subModule' => 'task'); $this->lang->execution->menu->CFD = array('link' => "{$this->lang->execution->CFD}|execution|cfd|executionID=%s"); $this->lang->execution->menu->build = array('link' => "{$this->lang->build->common}|execution|build|executionID=%s"); $this->lang->execution->menu->settings = array('link' => "{$this->lang->settings}|execution|view|executionID=%s", 'subModule' => 'personnel', 'alias' => 'edit,manageproducts,team,whitelist,addwhitelist,managemembers', 'class' => 'dropdown dropdown-hover'); $this->lang->execution->dividerMenu = ''; $this->lang->execution->menu->settings['subMenu'] = new stdclass(); $this->lang->execution->menu->settings['subMenu']->view = array('link' => "{$this->lang->overview}|execution|view|executionID=%s", 'subModule' => 'view', 'alias' => 'edit,start,suspend,putoff,close'); $this->lang->execution->menu->settings['subMenu']->products = array('link' => "{$this->lang->productCommon}|execution|manageproducts|executionID=%s"); $this->lang->execution->menu->settings['subMenu']->team = array('link' => "{$this->lang->team->common}|execution|team|executionID=%s", 'alias' => 'managemembers'); $this->lang->execution->menu->settings['subMenu']->whitelist = array('link' => "{$this->lang->whitelist}|execution|whitelist|executionID=%s", 'subModule' => 'personnel', 'alias' => 'addwhitelist'); } }