* Fix bug#23185.
This commit is contained in:
@@ -131,12 +131,12 @@ class programModel extends model
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param string $type top|child
|
||||
* @param array $topIdList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($status = 'all', $orderBy = 'id_asc', $pager = NULL, $type = '')
|
||||
public function getList($status = 'all', $orderBy = 'id_asc', $pager = NULL, $type = '', $topIdList = '')
|
||||
{
|
||||
$objectIdList = array();
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$objectIdList = trim($this->app->user->view->programs, ',') . ',' . trim($this->app->user->view->projects, ',');
|
||||
@@ -145,9 +145,20 @@ class programModel extends model
|
||||
|
||||
if($this->app->rawMethod == 'browse')
|
||||
{
|
||||
$pathList = $this->dao->select('id,path')->from(TABLE_PROJECT)->where('id')->in($objectIdList)->andWhere('deleted')->eq(0)->fetchPairs('id');
|
||||
$pathList = $this->dao->select('id,path')->from(TABLE_PROJECT)
|
||||
->where('id')->in($objectIdList)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetchPairs('id');
|
||||
|
||||
$objectIdList = array();
|
||||
foreach($pathList as $path)
|
||||
{
|
||||
if($type == 'child' and !empty($topIdList))
|
||||
{
|
||||
$topID = $this->getTopByPath($path);
|
||||
if(!in_array($topID, $topIdList)) continue;
|
||||
}
|
||||
|
||||
foreach(explode(',', trim($path, ',')) as $pathID) $objectIdList[$pathID] = $pathID;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user