* Finish task #64972,64973.

This commit is contained in:
dongli
2022-08-23 06:59:18 +00:00
parent cedf77727b
commit 57528ecba5
4 changed files with 25 additions and 17 deletions
+6 -4
View File
@@ -119,28 +119,30 @@ class action extends control
if($browseType == 'execution')
{
$this->app->loadLang('execution');
$this->loadModel('project');
$projectIdList = array();
foreach($trashes as $trash) $projectIdList[] = $trash->project;
$this->view->projectList = $this->loadModel('project')->getByIdList($projectIdList, 'all');
$this->view->projectList = $this->project->getByIdList($projectIdList, 'all');
}
/* Get the products name of story. */
if($browseType == 'story')
{
$this->app->loadLang('project');
$this->loadModel('story');
$storyIdList = array();
foreach($trashes as $trash) $storyIdList[] = $trash->objectID;
$this->view->productList = $this->loadModel('story')->getByList($storyIdList, 'story');
$this->view->productList = $this->story->getByList($storyIdList, 'story', 'all');
}
/* Get the executions name of task. */
if($browseType == 'task')
{
$this->app->loadLang('task');
$this->app->loadLang('project');
$this->loadModel('execution');
$executionIdList = array();
foreach($trashes as $trash) $executionIdList[] = $trash->execution;
$this->view->executionList = $this->loadModel('execution')->getByIdList($executionIdList);
$this->view->executionList = $this->execution->getByIdList($executionIdList, 'all');
}
/* Title and position. */
$this->view->title = $this->lang->action->trash;
+8 -8
View File
@@ -154,18 +154,18 @@
<?php endif;?>
<?php if($currentObjectType == 'story'):?>
<td class="flex" title="<?php echo $productList[$action->objectID]->productTitle;?>">
<span class="text-ellipsis"><?php echo $productList[$action->objectID]->productTitle;?></span>
<?php if($productList[$action->objectID]->deleted):?>
<span class='label label-danger'><?php echo $this->lang->project->deleted;?></span>
<?php endif;?>
<span class="text-ellipsis"><?php echo $productList[$action->objectID]->productTitle;?></span>
<?php if($productList[$action->objectID]->productDeleted):?>
<span class='label label-danger'><?php echo $this->lang->story->deleted;?></span>
<?php endif;?>
</td>
<?php endif;?>
<?php if($currentObjectType == 'task'):?>
<td class="flex" title="<?php echo $executionList[$action->execution]->name;?>">
<span class="text-ellipsis"><?php echo $executionList[$action->execution]->name;?></span>
<?php if($executionList[$action->execution]->deleted):?>
<span class='label label-danger'><?php echo $this->lang->project->deleted;?></span>
<?php endif;?>
<span class="text-ellipsis"><?php echo $executionList[$action->execution]->name;?></span>
<?php if($executionList[$action->execution]->deleted):?>
<span class='label label-danger'><?php echo $this->lang->execution->deleted;?></span>
<?php endif;?>
</td>
<?php endif;?>
<td><?php echo zget($users, $action->actor);?></td>
+6 -2
View File
@@ -1303,12 +1303,16 @@ class executionModel extends model
* Get execution by idList.
*
* @param array $executionIdList
* @param string $mode all
* @access public
* @return array
*/
public function getByIdList($executionIdList = array())
public function getByIdList($executionIdList = array(), $mode = '')
{
return $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->in($executionIdList)->fetchAll('id');
return $this->dao->select('*')->from(TABLE_EXECUTION)
->where('id')->in($executionIdList)
->beginIF($mode != 'all')->andWhere('deleted')->eq(0)->fi()
->fetchAll('id');
}
/**
+5 -3
View File
@@ -86,16 +86,18 @@ class storyModel extends model
*
* @param int|array|string $storyIdList
* @param string $type requirement|story
* @param string $mode all
* @access public
* @return array
*/
public function getByList($storyIdList = 0, $type = 'story')
public function getByList($storyIdList = 0, $type = 'story', $mode = '')
{
return $this->dao->select('t1.*, t2.spec, t2.verify, t3.name as productTitle, t3.deleted')
return $this->dao->select('t1.*, t2.spec, t2.verify, t3.name as productTitle, t3.deleted as productDeleted')
->from(TABLE_STORY)->alias('t1')
->leftJoin(TABLE_STORYSPEC)->alias('t2')->on('t1.id=t2.story')
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product=t3.id')
->andWhere('t1.version=t2.version')
->beginIF($mode != 'all')->andWhere('t1.deleted')->eq(0)->fi()
->where('t1.version=t2.version')
->beginIF($storyIdList)->andWhere('t1.id')->in($storyIdList)->fi()
->beginIF(!$storyIdList)->andWhere('t1.type')->eq($type)->fi()
->fetchAll('id');