* Finish task #40118.
This commit is contained in:
@@ -112,6 +112,19 @@ class stakeholderModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
if($stakeholder->objectType == 'program' and $stakeholder->objectID)
|
||||
{
|
||||
$programID = $stakeholder->objectID;
|
||||
/* Update children user view. */
|
||||
$childPrograms = $this->dao->select('id')->from(TABLE_PROJECT)->where('path')->like("%,$programID,%")->andWhere('type')->eq('program')->fetchPairs();
|
||||
$childProjects = $this->dao->select('id')->from(TABLE_PROJECT)->where('path')->like("%,$programID,%")->andWhere('type')->eq('project')->fetchPairs();
|
||||
$childProducts = $this->dao->select('id')->from(TABLE_PRODUCT)->where('program')->eq($programID)->fetchPairs();
|
||||
|
||||
if(!empty($childPrograms)) $this->user->updateUserView($childPrograms, 'program', $stakeholder->user);
|
||||
if(!empty($childProjects)) $this->user->updateUserView($childProjects, 'project', $stakeholder->user);
|
||||
if(!empty($childProducts)) $this->user->updateUserView($childProducts, 'product', $stakeholder->user);
|
||||
}
|
||||
|
||||
return $stakeholderID;
|
||||
}
|
||||
return false;
|
||||
@@ -168,6 +181,19 @@ class stakeholderModel extends model
|
||||
foreach($products as $productID => $productName) $this->user->updateUserView($productID, 'product', $changedAccounts);
|
||||
}
|
||||
|
||||
if($stakeholder->objectType == 'program' and $stakeholder->objectID)
|
||||
{
|
||||
$programID = $stakeholder->objectID;
|
||||
/* Update children user view. */
|
||||
$childPrograms = $this->dao->select('id')->from(TABLE_PROJECT)->where('path')->like("%,$programID,%")->andWhere('type')->eq('program')->fetchPairs();
|
||||
$childProjects = $this->dao->select('id')->from(TABLE_PROJECT)->where('path')->like("%,$programID,%")->andWhere('type')->eq('project')->fetchPairs();
|
||||
$childProducts = $this->dao->select('id')->from(TABLE_PRODUCT)->where('program')->eq($programID)->fetchPairs();
|
||||
|
||||
if(!empty($childPrograms)) $this->user->updateUserView($childPrograms, 'program', $stakeholder->user);
|
||||
if(!empty($childProjects)) $this->user->updateUserView($childProjects, 'project', $stakeholder->user);
|
||||
if(!empty($childProducts)) $this->user->updateUserView($childProducts, 'product', $stakeholder->user);
|
||||
}
|
||||
|
||||
return $stakeholderList;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user