getById($executionID);
if(isset($this->lang->execution->menu->kanban))
{
$this->loadModel('project')->setMenu($execution->project);
$this->lang->kanbanProject->menu->execution['subMenu'] = new stdClass();
if($this->app->rawModule == 'tree') unset($this->lang->kanbanProject->menu->execution['subMenu']);
}
$kanbanList = $this->getList($execution->project, 'kanban', 'all');
$currentKanban = zget($kanbanList, $execution->id, '');
if(empty($currentKanban)) $this->accessDenied();
$subMenu = $this->lang->execution->menu;
foreach($subMenu as $key => $value)
{
if(common::hasPriv('execution', $key))
{
$tmpValue = explode('|', $value['link']);
$subMenu->{$key}['name'] = $tmpValue[0];
$subMenu->{$key}['module'] = $tmpValue[1];
$subMenu->{$key}['method'] = $tmpValue[2];
$subMenu->{$key}['vars'] = $tmpValue[3];
}
else
{
unset($subMenu->$key);
}
}
$this->setSubNav($kanbanList, $currentKanban);
}
/**
* 设置三级导航。
* Set sub navigation.
*
* @param array $kanbanList
* @param object $currentKanban
* @access public
* @return void
*/
public function setSubNav(array $kanbanList, object $currentKanban): void
{
$lowerModule = strtolower($this->app->rawModule);
$lowerMethod = strtolower($this->app->rawMethod);
$modulePageNav = "";
$modulePageNav .= "
";
$modulePageNav .= "";
$modulePageNav .= "
";
if($lowerModule == 'execution' and strpos('|kanban|task|calendar|gantt|tree|grouptask|', "|{$lowerMethod}|") !== false)
{
$this->session->set('kanbanview', $lowerMethod);
setcookie('kanbanview', $lowerMethod, $this->config->cookieLife, $this->config->webRoot, '', false, true);
}
if(strpos('|task|calendar|gantt|tree|grouptask|', "|{$lowerMethod}|") !== false) $this->lang->TRActions = $this->getTRActions($lowerMethod);
if(strpos('|relation|maintainrelation|', "|{$lowerMethod}|") !== false) $this->lang->TRActions = $this->getTRActions('gantt');
if($lowerModule == 'task' or ($lowerModule == 'execution' and strpos('|kanban|task|calendar|gantt|tree|grouptask|', "|{$lowerMethod}|") === false))
{
if($this->session->kanbanview)
{
$this->lang->TRActions = $this->getTRActions($this->session->kanbanview);
}
elseif($this->cookie->kanbanview)
{
$this->lang->TRActions = $this->getTRActions($this->cookie->kanbanview);
}
}
$this->lang->modulePageNav = $modulePageNav;
}
/**
* 设置右上角页面切换按钮。
* Set right top page switch button.
*
* @param int $currentMethod
* @access public
* @return void
*/
public function getTRActions(string $currentMethod)
{
$subMenu = $this->lang->execution->menu;
foreach($subMenu as $key => $value)
{
if(common::hasPriv('execution', $key))
{
$tmpValue = explode('|', $value['link']);
$subMenu->{$key}['name'] = $tmpValue[0];
$subMenu->{$key}['module'] = $tmpValue[1];
$subMenu->{$key}['method'] = $tmpValue[2];
$subMenu->{$key}['vars'] = $tmpValue[3];
}
else
{
unset($subMenu->$key);
}
}
$TRActions = '';
$TRActions .= "";
$TRActions .= html::a("javascript:;", " " . $subMenu->{$currentMethod}['name'] . " ", '', "class='btn btn-link' data-toggle='dropdown'");
$TRActions .= "
";
return $TRActions;
}