* Fix bugs

This commit is contained in:
zenggang
2022-05-12 09:06:35 +00:00
parent 3e677efa79
commit e41dc21372
7 changed files with 31 additions and 19 deletions
+11 -1
View File
@@ -47,7 +47,7 @@ class program extends control
if(strtolower($status) == 'bysearch')
{
$queryID = (int)$param;
$programs = $this->program->getListBySearch($orderBy, $pager, $queryID);
$programs = $this->program->getListBySearch($orderBy, $queryID);
}
else
{
@@ -55,6 +55,15 @@ class program extends control
$programIds = array();
foreach($topPrograms as $programID => $program) $programIds[] = $programID;
$programs = $this->program->getList($status, $orderBy, null, 'child', $programIds);
/* Get summary. */
$topCount = $indCount = 0;
foreach($programs as $program)
{
if($program->type == 'program' and $program->parent == 0) $topCount ++;
if($program->type == 'project' and $program->parent == 0) $indCount ++;
}
$summary = sprintf($this->lang->program->summary, $topCount, $indCount);
}
}
@@ -78,6 +87,7 @@ class program extends control
$this->view->programs = $programs;
$this->view->status = $status;
$this->view->orderBy = $orderBy;
$this->view->summary = isset($summary) ? $summary : '';
$this->view->pager = $pager;
$this->view->users = $this->user->getPairs('noletter');
$this->view->userIdPairs = $this->user->getPairs('noletter|showid');