diff --git a/module/execution/control.php b/module/execution/control.php index 8cec15cec8..453acd3dc3 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -4022,9 +4022,9 @@ class execution extends control public function all($status = 'undone', $orderBy = 'order_asc', $productID = 0, $param = '', $recTotal = 0, $recPerPage = 100, $pageID = 1) { $this->app->loadLang('my'); - $this->app->loadLang('product'); $this->app->loadLang('stage'); $this->app->loadLang('programplan'); + $this->loadModel('product'); $this->loadModel('datatable'); $from = $this->app->tab; @@ -4044,25 +4044,22 @@ class execution extends control $actionURL = $this->createLink('execution', 'all', "status=bySearch&orderBy=$orderBy&productID=$productID¶m=myQueryID"); $this->execution->buildSearchForm($queryID, $actionURL); - $this->view->title = $this->lang->execution->allExecutions; - $this->view->position[] = $this->lang->execution->allExecutions; - $executionStats = $this->execution->getStatData(0, $status, $productID, 0, false, $queryID, $orderBy, $pager); - $allExecutionsNum = $this->execution->getStatData(0, 'all'); - $this->view->allExecutionsNum = count($allExecutionsNum); - - $this->view->executionStats = $executionStats; - $this->view->productList = $this->loadModel('product')->getProductPairsByProject(0); - $this->view->productID = $productID; - $this->view->pager = $pager; - $this->view->orderBy = $orderBy; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->projects = array('') + $this->project->getPairsByProgram(); - $this->view->status = $status; - $this->view->from = $from; - $this->view->param = $param; - $this->view->showBatchEdit = $this->cookie->showExecutionBatchEdit; + $this->view->title = $this->lang->execution->allExecutions; + $this->view->position[] = $this->lang->execution->allExecutions; + $this->view->executionStats = $executionStats; + $this->view->allExecutionsNum = $this->execution->getStatData(0, 'all', 0, 0, false, '', 'id_asc', null, true); + $this->view->productList = $this->product->getProductPairsByProject(0); + $this->view->productID = $productID; + $this->view->pager = $pager; + $this->view->orderBy = $orderBy; + $this->view->users = $this->loadModel('user')->getPairs('noletter', '', 0, array_unique(array_column($executionStats, 'PM'))); + $this->view->projects = array('') + $this->project->getPairsByProgram(); + $this->view->status = $status; + $this->view->from = $from; + $this->view->param = $param; + $this->view->showBatchEdit = $this->cookie->showExecutionBatchEdit; $this->display(); } @@ -4073,14 +4070,14 @@ class execution extends control * @param int $executionID * @param string $module * @param string $objectType - * @param string $orderby + * @param string $orderBy * @param int $recTotal * @param int $recPerPage * @param int $pageID * @access public * @return void */ - public function whitelist($executionID = 0, $module='execution', $objectType = 'sprint', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function whitelist($executionID = 0, $module = 'execution', $objectType = 'sprint', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* use first execution if executionID does not exist. */ if(!isset($this->executions[$executionID])) $executionID = key($this->executions); diff --git a/module/execution/model.php b/module/execution/model.php index 70a0548461..b5926dfdeb 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1871,7 +1871,7 @@ class executionModel extends model * @access public * @return array */ - public function getStatData($projectID = 0, $browseType = 'undone', $productID = 0, $branch = 0, $withTasks = false, $param = '', $orderBy = 'id_asc', $pager = null) + public function getStatData($projectID = 0, $browseType = 'undone', $productID = 0, $branch = 0, $withTasks = false, $param = '', $orderBy = 'id_asc', $pager = null, $isCount = false) { if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getExecutionStats($browseType); @@ -1921,6 +1921,8 @@ class executionModel extends model ->page($pager, 't1.id') ->fetchAll('id'); + if($isCount) return count($executions); + if(empty($productID) and !empty($executions)) $projectProductIdList = $this->dao->select('project, GROUP_CONCAT(product) as product')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($executions))->groupBy('project')->fetchPairs(); $hours = $this->loadModel('project')->computerProgress($executions); @@ -5724,13 +5726,13 @@ class executionModel extends model * @param array $users * @param int $productID * @access public - * @return void + * @return array */ public function generateRow($executions, $users, $productID) { $today = helper::today(); $rows = array(); - foreach($executions as $id => $execution) + foreach($executions as $execution) { $label = $execution->type == 'stage' ? 'label-warning' : 'label-info'; $link = $execution->type == 'kanban' ? helper::createLink('execution', 'kanban', "id=$execution->id") : helper::createLink('execution', 'task', "id=$execution->id"); diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php index f5906f02d3..7553ce5af9 100644 --- a/module/execution/view/all.html.php +++ b/module/execution/view/all.html.php @@ -37,7 +37,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN());