Merge branch 'sprint/170_songchenxuan_43918' into 'sprint/170'

* Finish task #43918.

See merge request easycorp/zentaopms!361
This commit is contained in:
李玉春
2021-11-09 06:00:23 +00:00
2 changed files with 29 additions and 7 deletions
+25 -5
View File
@@ -447,15 +447,35 @@ class programModel extends model
->beginIF($path)->andWhere('path')->like($path . '%')->fi()
->beginIF(!$queryAll and !$this->app->user->admin and $this->config->systemMode == 'new')->andWhere('id')->in($this->app->user->view->projects)->fi()
->beginIF(!$queryAll and !$this->app->user->admin and $this->config->systemMode == 'classic')->andWhere('id')->in($this->app->user->view->sprints)->fi()
->beginIF($this->cookie->involved or $involved)
->andWhere('openedBy', true)->eq($this->app->user->account)
->orWhere('PM')->eq($this->app->user->account)
->markRight(1)
->fi()
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
if($this->cookie->involved or $involved)
{
$stakeholderGroup = $this->dao->select('objectID,user')->from(TABLE_STAKEHOLDER)
->where('deleted')->eq('0')
->andWhere('objectID')->in(array_keys($projectList))
->fetchGroup('objectID', 'user');
$teamMembersGroup = $this->dao->select('root,account')->from(TABLE_TEAM)
->where('root')->in(array_keys($projectList))
->fetchGroup('root','account');
foreach($projectList as $id => $project)
{
$whitelist = explode(",", $project->whitelist);
if($project->openedBy == $this->app->user->account) continue;
if($project->PM == $this->app->user->account) continue;
if(in_array($this->app->user->account, $whitelist)) continue;
if(isset($teamMembersGroup[$project->id][$this->app->user->account])) continue;
if(isset($stakeholderGroup[$project->id][$this->app->user->account])) continue;
unset($projectList[$id]);
$pager->recTotal -= 1;
}
}
/* Determine how to display the name of the program. */
if($programTitle and $this->config->systemMode == 'new')
{