diff --git a/module/programplan/model.php b/module/programplan/model.php index e9287a1cc6..777f1afad4 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -1118,7 +1118,11 @@ class programplanModel extends model if(dao::isError()) return false; $this->setTreePath($planID); - if($plan->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'sprint'); + if($plan->acl != 'open') + { + $planIdList = $this->dao->select('id')->from(TABLE_EXECUTION)->where('path')->like("%,$planID,%")->andWhere('type')->eq('stage')->fetchAll('id'); + $this->loadModel('user')->updateUserView(array_keys($planIdList), 'sprint'); + } if($planChanged) { diff --git a/module/user/model.php b/module/user/model.php index ff2aa02a62..eea5c31733 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -2417,14 +2417,6 @@ class userModel extends model $parentIdList = array(); foreach($sprints as $sprint) $parentIdList[$sprint->project] = $sprint->project; - $childList = array(); - foreach($sprints as $sprint) - { - $children = $this->dao->select('id, project, PM, PO, QD, RD, openedBy, acl, parent, path, grade, type')->from(TABLE_EXECUTION)->where('path')->like("%,$sprint->id,%")->fetchAll('id'); - $childList = $childList + $children; - } - $sprints = $sprints + $childList; - /* Get team group. */ $teamGroups = array(); $stmt = $this->dao->select('root,account')->from(TABLE_TEAM)