* Finish task#54988.
This commit is contained in:
@@ -55,10 +55,32 @@ class program extends control
|
||||
$topPrograms = $this->program->getList($status, $orderBy, $pager, 'top');
|
||||
$programs = $this->program->getList($status, $orderBy, null, 'child', $topPrograms);
|
||||
|
||||
/* Filter programs that do not need to be displayed. */
|
||||
$copyPrograms = $programs;
|
||||
ksort($copyPrograms);
|
||||
foreach($copyPrograms as $programInfo)
|
||||
{
|
||||
if($programInfo->type == 'program' and strpos(",{$this->app->user->view->programs},", ",$programInfo->id,") === false)
|
||||
{
|
||||
unset($copyPrograms[$programInfo->id]);
|
||||
continue;
|
||||
}
|
||||
foreach(explode(',', trim($programInfo->path, ',')) as $pathID)
|
||||
{
|
||||
if(!isset($copyPrograms[$pathID])) $copyPrograms[$pathID] = $programs[$pathID];
|
||||
}
|
||||
}
|
||||
|
||||
/* Get summary. */
|
||||
$topCount = $indCount = 0;
|
||||
foreach($programs as $program)
|
||||
{
|
||||
if(!isset($copyPrograms[$program->id]))
|
||||
{
|
||||
unset($programs[$program->id]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if($program->type == 'program' and $program->parent == 0) $topCount ++;
|
||||
if($program->type == 'project' and $program->parent == 0) $indCount ++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user