From 70b252f97cb9bf061333d1cf71e69cb3aa9478d6 Mon Sep 17 00:00:00 2001 From: daitingting Date: Tue, 11 Oct 2022 09:07:57 +0000 Subject: [PATCH 1/2] * Finish task #71598, #71599,#71600. --- module/execution/model.php | 5 +++-- module/project/model.php | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/module/execution/model.php b/module/execution/model.php index 8f38b465b3..c97485f90b 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1692,9 +1692,10 @@ class executionModel extends model $executionPairs = array(); foreach($executions as $execution) { - $executionPairs[$execution->id] = ''; - if(isset($projects[$execution->project])) $executionPairs[$execution->id] .= $projects[$execution->project] . ' / '; + $executionPairs[$execution->id] = ''; + $executionPairs[$execution->id] .= isset($projects[$execution->project]) ? ($projects[$execution->project] . ' / ') : ''; $executionPairs[$execution->id] .= $execution->name; + if(empty($execution->multiple)) $executionPairs[$execution->id] = $projects[$execution->project] . "({$this->lang->project->disableExecution})"; } $executions = $executionPairs; diff --git a/module/project/model.php b/module/project/model.php index 8a1985aab0..3f66f4ca5c 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -844,18 +844,19 @@ class projectModel extends model * Get project pairs by id list. * * @param array $projectIdList - * @param string $mode + * @param string $model * @access public * @return array */ - public function getPairsByIdList($projectIdList = array(), $mode = '') + public function getPairsByIdList($projectIdList = array(), $model = '', $param = '') { return $this->dao->select('id, name')->from(TABLE_PROJECT) ->where('type')->eq('project') ->andWhere('deleted')->eq(0) ->beginIF($projectIdList)->andWhere('id')->in($projectIdList)->fi() - ->beginIF(!$this->app->user->admin and $mode != 'all')->andWhere('id')->in($this->app->user->view->projects)->fi() - ->beginIF($mode != 'all' and !empty($mode))->andWhere('model')->in($mode)->fi() + ->beginIF(!$this->app->user->admin and $model != 'all')->andWhere('id')->in($this->app->user->view->projects)->fi() + ->beginIF($model != 'all' and !empty($model))->andWhere('model')->in($model)->fi() + ->beginIF(strpos($param, 'multiple') !== false)->andWhere('multiple')->eq('1')->fi() ->fetchPairs('id', 'name'); } @@ -1030,7 +1031,7 @@ class projectModel extends model ->beginIF($this->config->vision)->andWhere('vision')->eq($this->config->vision)->fi() ->beginIF($model != 'all')->andWhere('model')->eq($model)->fi() ->beginIF(strpos($param, 'noclosed') !== false)->andWhere('status')->ne('closed')->fi() - ->beginIF(strpos($param, 'nomultiple') !== false)->andWhere('multiple')->eq('1')->fi() + ->beginIF(strpos($param, 'multiple') !== false)->andWhere('multiple')->eq('1')->fi() ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi() ->beginIF(!empty($append))->orWhere('id')->in($append)->fi() ->orderBy($orderBy) From 0c15499b3d862dfd7c4220cba7abae3f7fc69e2a Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 17 Oct 2022 08:29:06 +0000 Subject: [PATCH 2/2] * Add param in note. --- module/project/model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/module/project/model.php b/module/project/model.php index 3f66f4ca5c..e83943bd4b 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -845,6 +845,7 @@ class projectModel extends model * * @param array $projectIdList * @param string $model + * @param string $param * @access public * @return array */