From 951d41d721a8614d253704cc33c97f22ee55aed5 Mon Sep 17 00:00:00 2001 From: zhouxudong Date: Tue, 12 Jul 2022 02:54:06 +0000 Subject: [PATCH] * Finish task #60393. --- module/execution/control.php | 15 ++++++++++++++- module/execution/view/all.html.php | 2 +- module/execution/view/task.html.php | 2 +- module/productplan/control.php | 7 ++++++- module/productplan/view/browsebylist.html.php | 2 +- module/program/control.php | 9 ++++++++- module/program/view/project.html.php | 2 +- module/project/control.php | 6 ++++++ module/project/view/browsebylist.html.php | 2 +- 9 files changed, 39 insertions(+), 8 deletions(-) diff --git a/module/execution/control.php b/module/execution/control.php index 637f63c38b..816618e072 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -107,7 +107,7 @@ class execution extends control * @access public * @return void */ - public function task($executionID = 0, $status = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 100, $pageID = 1) + public function task($executionID = 0, $status = 'all', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 100, $pageID = 1) { $this->loadModel('tree'); $this->loadModel('search'); @@ -219,8 +219,14 @@ class execution extends control $showModule = !empty($this->config->datatable->executionTask->showModule) ? $this->config->datatable->executionTask->showModule : ''; $this->view->modulePairs = $showModule ? $this->tree->getModulePairs($executionID, 'task', $showModule) : array(); + $allTasksNum = $this->dao->select('COUNT(id) AS count')->from(TABLE_TASK) + ->where('execution')->eq($executionID) + ->andWhere('deleted')->eq(0) + ->fetch(); + /* Assign. */ $this->view->tasks = $tasks; + $this->view->allTasksNum = $allTasksNum; $this->view->summary = $this->execution->summary($tasks); $this->view->tabID = 'task'; $this->view->pager = $pager; @@ -3680,6 +3686,13 @@ class execution extends control $parents = array(); if($parentIdList) $parents = $this->execution->getByIdList($parentIdList); + + $allExecutionsNum = $this->dao->select('COUNT(id) AS count')->from(TABLE_PROJECT) + ->where('project')->eq($projectID) + ->andWhere('deleted')->eq(0) + ->fetch(); + $this->view->allExecutionsNum = $allExecutionsNum; + $this->view->executionStats = $executionStats; $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID); $this->view->productID = $productID; diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php index 5c9cc4abb9..d99ca0f0fe 100644 --- a/module/execution/view/all.html.php +++ b/module/execution/view/all.html.php @@ -73,7 +73,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())

execution->noExecutions : $lang->execution->noExecution;?> - + count)):?> createLink('programplan', 'create', "projectID=$projectID&productID=$productID"), " " . $lang->programplan->create, '', "class='btn btn-info'");?> diff --git a/module/execution/view/task.html.php b/module/execution/view/task.html.php index fe53a70b9b..90a87eb965 100644 --- a/module/execution/view/task.html.php +++ b/module/execution/view/task.html.php @@ -198,7 +198,7 @@ body {margin-bottom: 25px;}

task->noTask;?> - + count)):?> " . $lang->task->create, '', "class='btn btn-info'");?>

diff --git a/module/productplan/control.php b/module/productplan/control.php index ff03f410c3..66ae055a2a 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -292,7 +292,7 @@ class productplan extends control * @access public * @return void */ - public function browse($productID = 0, $branch = '', $browseType = 'undone', $queryID = 0, $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 ) + public function browse($productID = 0, $branch = '', $browseType = 'all', $queryID = 0, $orderBy = 'begin_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1 ) { $branchID = $branch === '' ? 'all' : $branch; if(!$branch) $branch = 0; @@ -350,6 +350,11 @@ class productplan extends control $this->view->branchID = $branchID; $this->view->kanbanData = $this->loadModel('kanban')->getPlanKanban($product, $branchID, $planGroup); } + $productPlansNum = $this->dao->select('COUNT(id) AS count')->from(TABLE_PRODUCTPLAN) + ->where('product')->eq($productID) + ->andWhere('deleted')->eq(0) + ->fetch(); + $this->view->productPlansNum = $productPlansNum; $this->view->title = $productName . $this->lang->colon . $this->lang->productplan->browse; $this->view->position[] = $this->lang->productplan->browse; diff --git a/module/productplan/view/browsebylist.html.php b/module/productplan/view/browsebylist.html.php index ae079f3c75..d49fed5427 100644 --- a/module/productplan/view/browsebylist.html.php +++ b/module/productplan/view/browsebylist.html.php @@ -41,7 +41,7 @@

productplan->noPlan;?> - + count)):?> createLink('productplan', 'create', "productID=$product->id&branch=$branch"), " " . $lang->productplan->create, '', "class='btn btn-info'");?>

diff --git a/module/program/control.php b/module/program/control.php index 2ffb89c3ae..92cf9137b6 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -450,7 +450,7 @@ class program extends control * @access public * @return void */ - public function project($programID = 0, $browseType = 'doing', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) + public function project($programID = 0, $browseType = 'all', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) { $programID = $this->program->saveState($programID, $this->program->getPairs()); setCookie("lastProgram", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true); @@ -473,6 +473,13 @@ class program extends control $sortField = zget($this->config->program->sortFields, $order[0], 'id') . '_' . $order[1]; $projectStats = $this->program->getProjectStats($programID, $browseType, 0, $sortField, $pager, $programTitle); + $allProjectsNum = $this->dao->select('COUNT(id) AS count')->from(TABLE_PROJECT) + ->where('parent')->eq($programID) + ->andWhere('type')->eq('project') + ->andWhere('deleted')->eq(0) + ->fetch(); + $this->view->allProjectsNum = $allProjectsNum; + $this->view->title = $this->lang->program->project; $this->view->position[] = $this->lang->program->project; diff --git a/module/program/view/project.html.php b/module/program/view/project.html.php index fbd22eeb5d..23617123b9 100644 --- a/module/program/view/project.html.php +++ b/module/program/view/project.html.php @@ -35,7 +35,7 @@ js::set('browseType', $browseType);

project->empty;?> - ' . $lang->project->create, '', 'class="btn btn-info btn-wide " data-toggle="modal"');?> + count)) common::printLink('project', 'createGuide', "programID=$programID", ' ' . $lang->project->create, '', 'class="btn btn-info btn-wide " data-toggle="modal"');?>

diff --git a/module/project/control.php b/module/project/control.php index d0aa65a093..e67c4917a4 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -309,6 +309,12 @@ class project extends control $programTitle = $this->loadModel('setting')->getItem('owner=' . $this->app->user->account . '&module=project&key=programTitle'); $projectStats = $this->loadModel('program')->getProjectStats($programID, $browseType, $queryID, $orderBy, $pager, $programTitle); + $allProjectsNum = $this->dao->select('COUNT(id) AS count')->from(TABLE_PROJECT) + ->where('type')->eq('project') + ->andWhere('deleted')->eq(0) + ->fetch(); + $this->view->allProjectsNum = $allProjectsNum; + $this->view->title = $this->lang->project->browse; $this->view->position[] = $this->lang->project->browse; diff --git a/module/project/view/browsebylist.html.php b/module/project/view/browsebylist.html.php index 5991184811..f0c078b870 100644 --- a/module/project/view/browsebylist.html.php +++ b/module/project/view/browsebylist.html.php @@ -73,7 +73,7 @@

project->empty;?> - + count)):?> ' . $lang->project->create, '', 'class="btn btn-info" data-toggle="modal"');?>