Merge branch 'sprint/master_zhouxudong_60393' into 'master'

* Finish task #60393.

See merge request easycorp/zentaopms!4468
This commit is contained in:
王怡栋
2022-07-12 07:23:46 +00:00
9 changed files with 39 additions and 8 deletions
+13 -1
View File
@@ -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;
@@ -3706,6 +3712,12 @@ 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;
+1 -1
View File
@@ -73,7 +73,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $from == 'execution' ? $lang->execution->noExecutions : $lang->execution->noExecution;?></span>
<?php if($status == "all"):?>
<?php if(empty($allExecutionsNum->count)):?>
<?php if(common::hasPriv('programplan', 'create') and $isStage):?>
<?php echo html::a($this->createLink('programplan', 'create', "projectID=$projectID&productID=$productID"), "<i class='icon icon-plus'></i> " . $lang->programplan->create, '', "class='btn btn-info'");?>
<?php else: ?>
+1 -1
View File
@@ -198,7 +198,7 @@ body {margin-bottom: 25px;}
<div class="table-empty-tip">
<p>
<span class="text-muted"><?php echo $lang->task->noTask;?></span>
<?php if($canBeChanged and common::hasPriv('task', 'create') and $status == "all"):?>
<?php if($canBeChanged and common::hasPriv('task', 'create') and empty($allTasksNum->count)):?>
<?php echo html::a($taskCreateLink, "<i class='icon icon-plus'></i> " . $lang->task->create, '', "class='btn btn-info'");?>
<?php endif;?>
</p>