diff --git a/module/action/control.php b/module/action/control.php index e2eba9357b..0baf2fcad8 100755 --- a/module/action/control.php +++ b/module/action/control.php @@ -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; diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php index 985d5dff6d..752c2d4ab7 100755 --- a/module/action/view/trash.html.php +++ b/module/action/view/trash.html.php @@ -154,18 +154,18 @@ - objectID]->productTitle;?> - objectID]->deleted):?> - lang->project->deleted;?> - + objectID]->productTitle;?> + objectID]->productDeleted):?> + lang->story->deleted;?> + - execution]->name;?> - execution]->deleted):?> - lang->project->deleted;?> - + execution]->name;?> + execution]->deleted):?> + lang->execution->deleted;?> + actor);?> diff --git a/module/execution/model.php b/module/execution/model.php index b07229429f..62c75cb607 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -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'); } /** diff --git a/module/story/model.php b/module/story/model.php index 1a41d03e6c..b709a367e4 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -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');