Merge branch 'sprint/170_songchenxuan_43918' into 'sprint/170'
* Finish task #43918. See merge request easycorp/zentaopms!361
This commit is contained in:
@@ -391,7 +391,6 @@ class executionModel extends model
|
||||
$members = isset($_POST['teamMembers']) ? $_POST['teamMembers'] : array();
|
||||
array_push($members, $sprint->PO, $sprint->QD, $sprint->PM, $sprint->RD);
|
||||
$members = array_unique($members);
|
||||
$member = array_values($members);
|
||||
|
||||
$roles = $this->loadModel('user')->getUserRoles(array_values($members));
|
||||
foreach($members as $account)
|
||||
@@ -526,6 +525,7 @@ class executionModel extends model
|
||||
->exec();
|
||||
|
||||
$changedAccounts = array();
|
||||
$teamMembers = array();
|
||||
foreach($this->config->execution->ownerFields as $ownerField)
|
||||
{
|
||||
$owner = zget($execution, $ownerField, '');
|
||||
@@ -541,8 +541,10 @@ class executionModel extends model
|
||||
$member->hours = $this->config->execution->defaultWorkhours;
|
||||
$this->dao->replace(TABLE_TEAM)->data($member)->exec();
|
||||
|
||||
$changedAccounts[$owner] = $owner;
|
||||
$changedAccounts[$owner] = $owner;
|
||||
$teamMembers[$ownerField] = $member;
|
||||
}
|
||||
if($execution->project) $this->addProjectMembers($execution->project, $teamMembers);
|
||||
|
||||
$whitelist = explode(',', $execution->whitelist);
|
||||
$this->loadModel('personnel')->updateWhitelist($whitelist, 'sprint', $executionID);
|
||||
|
||||
@@ -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')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user