diff --git a/module/execution/model.php b/module/execution/model.php index 8019d389c8..58e17f0edb 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -1145,6 +1145,9 @@ class executionModel extends model { return $this->dao->select('*,whitelist')->from(TABLE_EXECUTION) ->where('id')->in($executionIdList) + ->andWhere('(isTpl')->eq('0') + ->orWhere('isTpl')->eq('1') + ->markRight(1) ->beginIF($mode != 'all')->andWhere('deleted')->eq(0)->fi() ->fetchAll('id'); } @@ -1448,9 +1451,9 @@ class executionModel extends model ->andWhere('t1.deleted')->eq('0') ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t1.multiple')->eq('1') + ->andWhere('t1.isTpl')->eq($project->isTpl) ->beginIF($project->model == 'ipd')->andWhere('t1.enabled')->eq('on')->fi() - ->beginIF($project->isTpl)->andWhere('t1.isTpl')->eq('1')->fi() - ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() + ->beginIF(!$this->app->user->admin && !$project->isTpl)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() ->beginIF(!empty($executionQuery))->andWhere($executionQuery)->fi() ->beginIF($productID)->andWhere('t3.product')->eq($productID)->fi() ->beginIF($projectID)->andWhere('t1.project')->eq($projectID)->fi() @@ -1986,6 +1989,9 @@ class executionModel extends model ->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->where('t1.deleted')->eq(0) + ->andWhere('(t1.isTpl')->eq('0') + ->orWhere('t1.isTpl')->eq('1') + ->markRight(1) ->beginIF($filterStatus)->andWhere('t1.status')->notin('closed,cancel')->fi() ->andWhere('t1.execution')->in($executionIdList) ->orderBy('t1.order_asc, t1.id_desc') @@ -3756,6 +3762,9 @@ class executionModel extends model ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account') ->where('t1.deleted')->eq(0) + ->andWhere('(t1.isTpl')->eq('0') + ->orWhere('t1.isTpl')->eq('1') + ->markRight(1) ->andWhere($condition) ->orderBy($orderBy) ->page($pager, 't1.id') @@ -5244,6 +5253,9 @@ class executionModel extends model return $this->dao->select('id,name')->from(TABLE_EXECUTION) ->where('id')->in($executionIdList) + ->andWhere('(isTpl')->eq('1') + ->orWhere('isTpl')->eq('0') + ->markRight(1) ->beginIF(!empty($type))->andWhere('type')->in($type)->fi() ->orderBy($orderBy) ->fetchPairs(); diff --git a/module/programplan/model.php b/module/programplan/model.php index 8634d78d33..f1d62fafea 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -867,6 +867,9 @@ class programplanModel extends model $tasks = $this->dao->select('t1.*,t2.version AS latestStoryVersion, t2.status AS storyStatus')->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') ->where('t1.deleted')->eq(0) + ->andWhere('(t1.isTpl')->eq('0') + ->orWhere('t1.isTpl')->eq('1') + ->markRight(1) ->andWhere('t1.project')->eq($projectID) ->andWhere('t1.execution')->in($planIdList) ->orderBy('execution_asc, order_asc, id_asc') diff --git a/module/project/zen.php b/module/project/zen.php index e6c8884eaf..cdefdb4e7c 100755 --- a/module/project/zen.php +++ b/module/project/zen.php @@ -329,7 +329,7 @@ class projectZen extends project $hasProduct = isset($copyProject->hasProduct) ? $copyProject->hasProduct : 1; if($this->config->edition != 'open') { - $workflowGroups = $this->loadModel('workflowgroup')->getPairs('project', $model, $hasProduct, 'normal', '0'); + $workflowGroups = $this->loadModel('workflowgroup')->getPairs('project', $model, (int)$hasProduct, 'normal', '0'); $this->view->workflowGroupPairs = $workflowGroups; $this->view->workflowGroups = $this->workflowgroup->appendBuildinLabel($workflowGroups); } diff --git a/module/task/tao.php b/module/task/tao.php index d3fb94ff4d..1661a4353d 100644 --- a/module/task/tao.php +++ b/module/task/tao.php @@ -486,6 +486,8 @@ class taskTao extends taskModel $actionIDList = array(); if($type == 'assignedbyme') $actionIDList = $this->dao->select('objectID')->from(TABLE_ACTION)->where('objectType')->eq('task')->andWhere('action')->eq('assigned')->andWhere('actor')->eq($this->app->user->account)->fetchPairs('objectID', 'objectID'); + $execution = $this->fetchByID($executionID, 'project'); + $tasks = $this->dao->select($fields) ->from(TABLE_TASK)->alias('t1') ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') @@ -493,6 +495,7 @@ class taskTao extends taskModel ->beginIF($productID)->leftJoin(TABLE_MODULE)->alias('t4')->on('t1.module = t4.id')->fi() ->beginIF($this->config->edition == 'max' or $this->config->edition == 'ipd')->leftJoin(TABLE_DESIGN)->alias('t5')->on('t1.design= t5.id')->fi() ->where('t1.execution')->eq((int)$executionID) + ->beginIF($execution->isTpl)->andWhere('t1.isTpl')->eq('1')->fi() ->beginIF($type == 'myinvolved') ->andWhere("((t3.`account` = '{$this->app->user->account}') OR t1.`assignedTo` = '{$this->app->user->account}' OR t1.`finishedby` = '{$this->app->user->account}')") ->fi()