* Finish task #43918

This commit is contained in:
root
2021-11-09 08:35:27 +08:00
parent 9285f2424f
commit b9dc220fd9
+40
View File
@@ -447,15 +447,55 @@ 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');
a($projectList);
if($this->cookie->involved or $involved)
{
$stakeholder = $this->dao->select('objectID,user')->from(TABLE_STAKEHOLDER)
->where('deleted')->eq('0')
->andWhere('objectID')->in(array_keys($projectList))
->fetchGroup('objectID', 'user');
a($stakeholder);
foreach($projectList as $id => $project)
{
$whitelist = explode(",", $project->whitelist);
a($whitelist);
$executionList = $this->dao->select('id,PO,PM,QD,RD')->from(TABLE_EXECUTION)
->where('deleted')->eq('0')
->andWhere('project')->eq($project->id)
->fetchAll();
a($executionList);
$members = array();
foreach($executionList as $execution)
{
array_push($members, $execution->PO, $execution->PM, $execution->QD, $execution->RD);
}
$members = array_unique($members);
$members = array_values($members);
a($members);
if($project->openedBy == $this->app->user->account || $project->PM == $this->app->user->account || in_array($this->app->user->account, $whitelist) || in_array($this->app->user->account, $members) || isset($stakeholder[$project->id][$this->app->user->account]))
{
;
}
else
{
unset($projectList[$id]);
$pager->recTotal -= 1;
}
}
}
/* Determine how to display the name of the program. */
if($programTitle and $this->config->systemMode == 'new')
{