Merge branch 'sprint/app10'
This commit is contained in:
@@ -440,43 +440,30 @@ class programModel extends model
|
||||
$path = $program->path;
|
||||
}
|
||||
|
||||
$projectList = $this->dao->select('*')->from(TABLE_PROJECT)
|
||||
->where('deleted')->eq('0')
|
||||
->beginIF($this->config->systemMode == 'new')->andWhere('type')->eq('project')->fi()
|
||||
->beginIF($browseType != 'all' and $browseType != 'undone')->andWhere('status')->eq($browseType)->fi()
|
||||
->beginIF($browseType == 'undone')->andWhere('status')->in('wait,doing')->fi()
|
||||
->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()
|
||||
$projectList = $this->dao->select('distinct t1.*')->from(TABLE_PROJECT)->alias('t1')
|
||||
->leftJoin(TABLE_TEAM)->alias('t2')->on('t1.id=t2.root')
|
||||
->leftJoin(TABLE_STAKEHOLDER)->alias('t3')->on('t1.id=t3.objectID')
|
||||
->where('t1.deleted')->eq('0')
|
||||
->beginIF($this->config->systemMode == 'new')->andWhere('t1.type')->eq('project')->fi()
|
||||
->beginIF($this->config->systemMode == 'new' and ($this->cookie->involved or $involved))->andWhere('t2.type')->eq('project')->fi()
|
||||
->beginIF($this->config->systemMode == 'new' and ($this->cookie->involved or $involved))->andWhere('t3.objectType')->eq('project')->fi()
|
||||
->beginIF($browseType != 'all' and $browseType != 'undone')->andWhere('t1.status')->eq($browseType)->fi()
|
||||
->beginIF($browseType == 'undone')->andWhere('t1.status')->in('wait,doing')->fi()
|
||||
->beginIF($path)->andWhere('t1.path')->like($path . '%')->fi()
|
||||
->beginIF(!$queryAll and !$this->app->user->admin and $this->config->systemMode == 'new')->andWhere('t1.id')->in($this->app->user->view->projects)->fi()
|
||||
->beginIF(!$queryAll and !$this->app->user->admin and $this->config->systemMode == 'classic')->andWhere('t1.id')->in($this->app->user->view->sprints)->fi()
|
||||
->beginIF($this->cookie->involved or $involved)
|
||||
->andWhere('t1.openedBy', true)->eq($this->app->user->account)
|
||||
->orWhere('t1.PM')->eq($this->app->user->account)
|
||||
->orWhere('t2.account')->eq($this->app->user->account)
|
||||
->orWhere('t3.user')->eq($this->app->user->account)
|
||||
->orWhere("CONCAT(',', t1.whitelist, ',')")->like("%,{$this->app->user->account},%")
|
||||
->markRight(1)
|
||||
->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->page($pager, 't1.id')
|
||||
->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')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user