diff --git a/module/execution/model.php b/module/execution/model.php index 2755c3eb16..89df994c85 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 35915340f8..0069f63973 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -844,18 +844,20 @@ class projectModel extends model * Get project pairs by id list. * * @param array $projectIdList - * @param string $mode + * @param string $model + * @param string $param * @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 +1032,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)