diff --git a/db/update15.0.3.sql b/db/update15.0.3.sql index b3f3664e8f..5f9314cd79 100644 --- a/db/update15.0.3.sql +++ b/db/update15.0.3.sql @@ -6,6 +6,7 @@ ALTER TABLE `zt_storyestimate` MODIFY COLUMN `average` float NOT NULL; ALTER TABLE `zt_jenkins` ADD COLUMN `type` char(30) NOT NULL AFTER `id`; ALTER TABLE `zt_jenkins` ADD COLUMN `private` char(32) NOT NULL AFTER `token`; +UPDATE `zt_jenkins` SET `type`='jenkins'; RENAME TABLE `zt_jenkins` TO `zt_pipeline`; ALTER TABLE `zt_relation` DROP INDEX `relation`; diff --git a/module/execution/model.php b/module/execution/model.php index 95bedc8efb..f58abd70bd 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -982,11 +982,11 @@ class executionModel extends model /* Order by status's content whether or not done */ $executions = $this->dao->select('*, IF(INSTR("done,closed", status) < 2, 0, 1) AS isDone, INSTR("doing,wait,suspended,closed", status) AS sortStatus')->from(TABLE_EXECUTION) ->where('deleted')->eq(0) - ->beginIF($type == 'all' && $this->config->systemMode == 'new')->andWhere('type')->in('stage,sprint')->fi() - ->beginIF($projectID && $this->config->systemMode == 'new')->andWhere('project')->eq($projectID)->fi() - ->beginIF($type != 'all' && $this->config->systemMode == 'new')->andWhere('type')->eq($type)->fi() + ->beginIF($type == 'all')->andWhere('type')->in('stage,sprint')->fi() + ->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)->andWhere('project')->in($this->app->user->view->projects)->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();