From a9ce5f8e01a0cd37bd29903c51722d22c13e3fd4 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Fri, 27 May 2022 02:17:08 +0800 Subject: [PATCH] * Restore code for task#54988. --- module/program/control.php | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/module/program/control.php b/module/program/control.php index 2cf8857a21..c8aa0be0f8 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -55,32 +55,10 @@ 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. */ - $authorizedPrograms = $programs; - ksort($authorizedPrograms); - foreach($authorizedPrograms as $programInfo) - { - if($programInfo->type == 'program' and strpos(",{$this->app->user->view->programs},", ",$programInfo->id,") === false) - { - unset($authorizedPrograms[$programInfo->id]); - continue; - } - foreach(explode(',', trim($programInfo->path, ',')) as $pathID) - { - if(!isset($authorizedPrograms[$pathID])) $authorizedPrograms[$pathID] = $programs[$pathID]; - } - } - /* Get summary. */ $topCount = $indCount = 0; foreach($programs as $program) { - if(!isset($authorizedPrograms[$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 ++; }