* Finish task #62947.

This commit is contained in:
tianshujie
2022-08-03 13:41:05 +08:00
parent 6a6218bc41
commit 167c36d6d5
9 changed files with 103 additions and 6 deletions
+33
View File
@@ -119,6 +119,39 @@ $config->execution->search['params']['canceledDate'] = array('operator' => '='
$config->execution->search['params']['lastEditedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->search['params']['activatedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$app->loadLang('execution');
$config->execution->all = new stdclass();
$config->execution->all->search['module'] = 'execution';
$config->execution->all->search['fields']['name'] = $lang->execution->execName;
$config->execution->all->search['fields']['id'] = $lang->execution->execId;
$config->execution->all->search['fields']['status'] = $lang->execution->execStatus;
$config->execution->all->search['fields']['project'] = $lang->execution->project;
$config->execution->all->search['fields']['PM'] = $lang->execution->owner;
$config->execution->all->search['fields']['openedBy'] = $lang->execution->openedBy;
$config->execution->all->search['fields']['openedDate'] = $lang->execution->openedDate;
$config->execution->all->search['fields']['begin'] = $lang->execution->begin;
$config->execution->all->search['fields']['end'] = $lang->execution->end;
$config->execution->all->search['fields']['realBegan'] = $lang->execution->realBegan;
$config->execution->all->search['fields']['realEnd'] = $lang->execution->realEnd;
$config->execution->all->search['fields']['closedBy'] = $lang->execution->closedBy;
$config->execution->all->search['fields']['lastEditedDate'] = $lang->execution->lastEditedDate;
$config->execution->all->search['fields']['closedDate'] = $lang->execution->closedDate;
$config->execution->all->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
$config->execution->all->search['params']['id'] = array('operator' => '=', 'control' => 'input', 'values' => '');
$config->execution->all->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => array('') + $lang->execution->statusList);
$config->execution->all->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->execution->all->search['params']['PM'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->execution->all->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->execution->all->search['params']['openedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->all->search['params']['begin'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->all->search['params']['end'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->all->search['params']['realBegan'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->all->search['params']['realEnd'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->all->search['params']['closedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->execution->all->search['params']['lastEditedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->execution->all->search['params']['closedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->printKanban = new stdClass();
$config->printKanban->col['story'] = 1;
$config->printKanban->col['wait'] = 2;
+8 -2
View File
@@ -3678,13 +3678,14 @@ class execution extends control
* @param int $projectID
* @param string $orderBy
* @param int $productID
* @param string $param
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
public function all($status = 'undone', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $recTotal = 0, $recPerPage = 100, $pageID = 1)
public function all($status = 'undone', $projectID = 0, $orderBy = 'order_asc', $productID = 0, $param = '', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
$this->app->loadLang('my');
$this->app->loadLang('product');
@@ -3714,10 +3715,14 @@ class execution extends control
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
$queryID = ($status == 'bySearch') ? (int)$param : 0;
$actionURL = $this->createLink('execution', 'all', "status=bySearch&projectID=$projectID&orderBy=$orderBy&productID=$productID&param=myQueryID");
$this->execution->buildSearchFrom($queryID, $actionURL);
$this->view->title = $this->lang->execution->allExecutions;
$this->view->position[] = $this->lang->execution->allExecutions;
$executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager);
$executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager, false, $queryID);
$parentIdList = array();
foreach($executionStats as $execution)
@@ -3742,6 +3747,7 @@ class execution extends control
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->status = $status;
$this->view->from = $from;
$this->view->param = $param;
$this->view->isStage = (isset($project->model) and $project->model == 'waterfall') ? true : false;
$this->display();
+1
View File
@@ -137,6 +137,7 @@ $lang->execution->batchCreateTask = 'Batch create task';
$lang->execution->kanbanNoLinkProduct = "Kanban not linked {$lang->productCommon}";
$lang->execution->myTask = "My Task";
$lang->execution->list = "{$lang->executionCommon} List";
$lang->execution->allProject = 'All';
/* Fields of zt_team. */
$lang->execution->root = 'Root';
+3 -2
View File
@@ -137,11 +137,12 @@ $lang->execution->batchCreateTask = 'Batch create task';
$lang->execution->kanbanNoLinkProduct = "Kanban not linked {$lang->productCommon}";
$lang->execution->myTask = "My Task";
$lang->execution->list = 'List';
$lang->execution->allProject = 'All';
/* Fields of zt_team. */
$lang->execution->root = 'Root';
$lang->execution->estimate = 'estimate';
$lang->execution->consumed = 'consumed';
$lang->execution->estimate = 'Estimate';
$lang->execution->consumed = 'Consumed';
$lang->execution->left = 'Left';
if($this->config->systemMode == 'new') $lang->execution->copyTeamTip = "copy Project/{$lang->execution->common} team members";
+1
View File
@@ -137,6 +137,7 @@ $lang->execution->batchCreateTask = 'Batch create task';
$lang->execution->kanbanNoLinkProduct = "Kanban not linked {$lang->productCommon}";
$lang->execution->myTask = "My Task";
$lang->execution->list = "{$lang->executionCommon} List";
$lang->execution->allProject = 'Tous';
/* Fields of zt_team. */
$lang->execution->root = 'Root';
+1
View File
@@ -137,6 +137,7 @@ $lang->execution->batchCreateTask = '批量建任务';
$lang->execution->kanbanNoLinkProduct = "看板没有关联{$lang->productCommon}";
$lang->execution->myTask = "我的任务";
$lang->execution->list = '列表';
$lang->execution->allProject = '全部项目';
/* Fields of zt_team. */
$lang->execution->root = '源ID';
+19
View File
@@ -4722,4 +4722,23 @@ class executionModel extends model
echo '</td>';
}
}
/*
* Build search form
*
* @param int $queryID
* @param string $actionURL
* @return void
* */
public function buildSearchFrom($queryID, $actionURL)
{
$this->config->execution->all->search['queryID'] = $queryID;
$this->config->execution->all->search['actionURL'] = $actionURL;
$projectPairs = array(0 => '');
$projectPairs += $this->loadModel('project')->getPairsByProgram();
$this->config->execution->all->search['params']['project']['values'] = $projectPairs + array('all' => $this->lang->execution->allProject);
$this->loadModel('search')->setSearchParams($this->config->execution->all->search);
}
}
+3 -1
View File
@@ -58,6 +58,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
<?php echo html::select('project', $projects, $projectID, "class='form-control chosen' data-placeholder='{$lang->execution->selectProject}'");?>
</div>
<?php endif;?>
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->execution->byQuery;?></a>
</div>
<div class='btn-toolbar pull-right'>
<?php common::printLink('execution', 'export', "status=$status&productID=$productID&orderBy=$orderBy&from=$from", "<i class='icon-export muted'> </i> " . $lang->export, '', "class='btn btn-link export'")?>
@@ -69,6 +70,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
</div>
</div>
<div id='mainContent' class="main-row fade">
<div class="cell<?php if($status == 'bySearch') echo ' show';?>" id="queryBox" data-module='execution'></div>
<?php if(empty($executionStats)):?>
<div class="table-empty-tip">
<p>
@@ -91,7 +93,7 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
<nav class="btn-toolbar pull-right setting"></nav>
</div>
<?php
$vars = "status=$status&projectID=$projectID&orderBy=%s&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
$vars = "status=$status&projectID=$projectID&orderBy=%s&productID=$productID&param=$param&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
if($useDatatable) include '../../common/view/datatable.html.php';
else include '../../common/view/tablesorter.html.php';
+34 -1
View File
@@ -2329,17 +2329,49 @@ class projectModel extends model
* @param int $projectID
* @param string $status
* @param int $productID
* @param int $branch
* @param int $itemCounts
* @param string $orderBy
* @param object $pager
* @param bool $withTasks
* @param int $queryID
* @access public
* @return array
*/
public function getStats($projectID = 0, $status = 'undone', $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'id_asc', $pager = null, $withTasks = false)
public function getStats($projectID = 0, $status = 'undone', $productID = 0, $branch = 0, $itemCounts = 30, $orderBy = 'id_asc', $pager = null, $withTasks = false, $queryID = 0)
{
if(empty($productID))
{
$myExecutionIDList = array();
$query = '';
if($status == 'bySearch')
{
$status = 'all';
if($queryID)
{
$query = $this->loadModel('search')->getQuery($queryID);
if($query)
{
$this->session->set('executionQuery', $query->sql);
$this->session->set('executionForm', $query->form);
}
else
{
$this->session->set('executionQuery', ' 1 = 1');
}
}
else
{
if($this->session->executionQuery == false) $this->session->set('executionQuery', ' 1 = 1');
}
$query = $this->session->executionQuery;
$allProject = "`project` = 'all'";
if(strpos($query, $allProject) !== false) $query = str_replace($allProject, '1', $query);
$query = str_replace(array('`id`', '`name`', '`status`', '`project`', '`PM`', '`openedBy`', '`openedDate`', '`begin`', '`end`', '`realBegan`', '`realEnd`', '`closedBy`', '`lastEditedDate`', '`closedDate`'), array('t1.`id`', 't1.`name`', 't1.`status`', 't1.`project`', 't1.`PM`', 't1.`openedBy`', 't1.`openedDate`', 't1.`begin`', 't1.`end`', 't1.`realBegan`', 't1.`realEnd`', 't1.`closedBy`', 't1.`lastEditedDate`', 't1.`closedDate`'), $query);
}
if($status == 'involved')
{
$myExecutionIDList = $this->dao->select('root')->from(TABLE_TEAM)
@@ -2351,6 +2383,7 @@ class projectModel extends model
$executions = $this->dao->select('t1.*,t2.name projectName, t2.model as projectModel')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.type')->in('sprint,stage,kanban')
->beginIF(!empty($query))->andWhere($query)->fi()
->beginIF($projectID != 0)->andWhere('t1.project')->eq($projectID)->fi()
->beginIF($projectID == 0 and $this->config->vision)->andWhere('t1.vision')->eq($this->config->vision)->fi()
->beginIF(!empty($myExecutionIDList))->andWhere('t1.id')->in(array_keys($myExecutionIDList))->fi()