From f3bee6424f583564c826d3448477f9f040c9b137 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Thu, 12 Nov 2020 10:14:14 +0800 Subject: [PATCH] * Finish task #8326. --- framework/router.class.php | 18 +++++++++--------- module/project/model.php | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/framework/router.class.php b/framework/router.class.php index f2bae43a23..236c02fc86 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -150,15 +150,6 @@ class router extends baseRouter $productIndex = $storyIndex = $hourIndex = $planIndex = $URAndSR = 0; $projectIndex = empty($this->config->isINT) ? 0 : 1; - $model = new stdclass(); - $model->model = 'scrum'; - if($this->session->PRJ) $model = $this->dbh->query('SELECT model FROM' . TABLE_PROJECT . "WHERE id = {$this->session->PRJ}")->fetch(); - - if(isset($model->model) && $model->model == 'waterfall') - { - $projectIndex = 2; - } - foreach($commonSettings as $setting) { if($setting->key == 'productProject') list($productIndex, $projectIndex) = explode('_', $setting->value); @@ -174,6 +165,15 @@ class router extends baseRouter } } + $model = new stdclass(); + $model->model = 'scrum'; + if($this->session->PRJ) $model = $this->dbh->query('SELECT model FROM' . TABLE_PROJECT . "WHERE id = {$this->session->PRJ}")->fetch(); + + if(isset($model->model) && $model->model == 'waterfall') + { + $projectIndex = 2; + } + $config->storyCommon = $storyIndex; $config->URAndSR = $URAndSR; diff --git a/module/project/model.php b/module/project/model.php index 7736e17b7f..6dac1a5345 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -872,6 +872,7 @@ class projectModel extends model $projects = $this->dao->select('t1.*,t2.product as productID')->from(TABLE_PROJECT)->alias('t1') ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t2')->on('t1.id=t2.project') ->where('t1.project')->eq((int)$program->id) + ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi() ->andWhere('t1.deleted')->eq('0') ->orderBy('t1.id_desc') ->fetchAll('id');