* Adjust menu logic.

This commit is contained in:
zhujinyong
2021-03-21 12:15:55 +08:00
parent c014179539
commit a6eff425ca
49 changed files with 1212 additions and 1390 deletions
+6 -9
View File
@@ -98,12 +98,11 @@ class program extends control
$programID = $this->program->saveState($programID, $this->program->getPairs());
setCookie("lastProgram", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$this->program->setMenu($programID);
$program = $this->program->getByID($programID);
if(empty($program) || $program->type != 'program') die(js::error($this->lang->notFound) . js::locate('back'));
$this->lang->program->switcherMenu = $this->program->getSwitcher($programID, true);
commonModel::setAppObjectID('program', $programID);
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
@@ -389,15 +388,14 @@ class program extends control
public function project($programID = 0, $browseType = 'all', $orderBy = 'order_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
$programID = $this->program->saveState($programID, $this->program->getPairs());
if(!$programID) $this->locate($this->createLink('program', 'browse'));
setCookie("lastProgram", $programID, $this->config->cookieLife, $this->config->webRoot, '', false, true);
if(!$programID) $this->locate($this->createLink('program', 'browse'));
$this->program->setMenu($programID);
$this->app->session->set('programProject', $this->app->getURI(true));
$this->app->session->set('projectList', $this->app->getURI(true));
$this->lang->program->switcherMenu = $this->program->getSwitcher($programID, true);
commonModel::setAppObjectID('program', $programID);
$this->loadModel('datatable');
/* Load pager and get tasks. */
@@ -436,8 +434,7 @@ class program extends control
*/
public function stakeholder($programID = 0, $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
{
$this->lang->program->switcherMenu = $this->program->getSwitcher($programID, true);
commonModel::setAppObjectID('program', $programID);
$this->program->setMenu($programID);
/* Load pager and get tasks. */
$this->app->loadClass('pager', $static = true);
+6
View File
@@ -834,4 +834,10 @@ class programModel extends model
return $budgetUnitList;
}
public function setMenu($programID)
{
$this->lang->switcherMenu = $this->getSwitcher($programID);
common::setMenuVars('program', $programID);
}
}