diff --git a/module/execution/model.php b/module/execution/model.php index 10416cdcf5..5e1969c1d9 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1005,7 +1005,6 @@ class executionModel extends model ->beginIF($projectID and $this->config->systemMode == 'new')->andWhere('project')->eq($projectID)->fi() ->beginIF($type != 'all' and $this->config->systemMode == 'new')->andWhere('type')->eq($type)->fi() ->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi() - ->beginIF(!$this->app->user->admin and $this->config->systemMode == 'new')->andWhere('project')->in($this->app->user->view->projects)->fi() ->beginIF(!$this->app->user->admin and strpos($mode, 'all') === false)->andWhere('id')->in($this->app->user->view->sprints)->fi() ->orderBy($orderBy) ->fetchAll(); @@ -1069,7 +1068,6 @@ class executionModel extends model ->beginIF($status == 'undone')->andWhere('t2.status')->notIN('done,closed')->fi() ->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi() ->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi() - ->beginIF(!$this->app->user->admin)->andWhere('t2.project')->in($this->app->user->view->projects)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() ->orderBy('order_desc') ->beginIF($limit)->limit($limit)->fi() @@ -1084,7 +1082,6 @@ class executionModel extends model ->beginIF($projectID)->andWhere('project')->eq($projectID)->fi() ->beginIF($status == 'undone')->andWhere('status')->notIN('done,closed')->fi() ->beginIF($status != 'all' and $status != 'undone')->andWhere('status')->in($status)->fi() - ->beginIF(!$this->app->user->admin)->andWhere('project')->in($this->app->user->view->projects)->fi() ->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi() ->orderBy('order_desc') ->beginIF($limit)->limit($limit)->fi() @@ -1113,7 +1110,6 @@ class executionModel extends model ->where('t1.product')->eq($productID) ->andWhere('t2.deleted')->eq(0) ->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi() - ->beginIF(!$this->app->user->admin)->andWhere('t2.project')->in($this->app->user->view->projects)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t2.id')->in($this->app->user->view->sprints)->fi() ->andWhere('t2.openedBy', true)->eq($this->app->user->account) ->orWhere('t3.account')->eq($this->app->user->account) @@ -1129,7 +1125,6 @@ class executionModel extends model return $this->dao->select('t1.*, IF(INSTR(" done,closed", t1.status) < 2, 0, 1) AS isDone')->from(TABLE_EXECUTION)->alias('t1') ->leftJoin(TABLE_TEAM)->alias('t2')->on('t2.root=t1.id') ->where('t1.deleted')->eq(0) - ->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in($this->app->user->view->projects)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() ->andWhere('t1.openedBy', true)->eq($this->app->user->account) ->orWhere('t2.account')->eq($this->app->user->account) @@ -1430,7 +1425,6 @@ class executionModel extends model $list = $this->dao->select('t1.id,t1.name,t1.status,t2.product')->from(TABLE_EXECUTION)->alias('t1') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id = t2.project') ->where('t1.deleted')->eq(0) - ->beginIF(!$this->app->user->admin)->andWhere('t1.project')->in($this->app->user->view->projects)->fi() ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() ->fetchGroup('product'); diff --git a/module/project/model.php b/module/project/model.php index a94be4a324..dba7681ca5 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -464,16 +464,17 @@ class projectModel extends model * Get project pairs by id list. * * @param array $projectIdList + * @param string $mode * @access public * @return array */ - public function getPairsByIdList($projectIdList = array()) + public function getPairsByIdList($projectIdList = array(), $mode = '') { 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)->andWhere('id')->in($this->app->user->view->projects)->fi() + ->beginIF(!$this->app->user->admin and $mode != 'all')->andWhere('id')->in($this->app->user->view->projects)->fi() ->fetchPairs('id', 'name'); }