$projectExecutions)
{
$executionCounts[$projectID]['myExecution'] = 0;
$executionCounts[$projectID]['others'] = 0;
$executionCounts[$projectID]['closed'] = 0;
foreach($projectExecutions as $execution)
{
if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account]))) $executionCounts[$projectID]['myExecution'] ++;
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM != $this->app->user->account and !isset($execution->teams[$this->app->user->account])) $executionCounts[$projectID]['others'] ++;
if($execution->status == 'done' or $execution->status == 'closed') $executionCounts[$projectID]['closed'] ++;
$executionNames[] = $execution->name;
}
}
$executionsPinYin = common::convert2Pinyin($executionNames);
$myExecutionsHtml = $config->systemMode == 'new' ? '
' : '';
$normalExecutionsHtml = $config->systemMode == 'new' ? '' : '';
$closedExecutionsHtml = $config->systemMode == 'new' ? '' : '';
foreach($executions as $projectID => $projectExecutions)
{
/* Adapt to the old version. */
if($projectID and $config->systemMode == 'new')
{
$projectName = zget($projects, $projectID);
if($executionCounts[$projectID]['myExecution']) $myExecutionsHtml .= '';
if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '';
if($executionCounts[$projectID]['closed']) $closedExecutionsHtml .= '';
}
foreach($projectExecutions as $index => $execution)
{
$kanbanLink = $this->createLink('execution', 'kanban', "executionID=%s");
$taskLink = $this->createLink('execution', 'task', "executionID=%s");
if($execution->type != 'kanban' and $link == $kanbanLink) $link = $taskLink;
if($execution->type == 'kanban' and $link != $kanbanLink) $link = $kanbanLink;
$selected = $execution->id == $executionID ? 'selected' : '';
if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account])))
{
$myExecutionsHtml .= '- ' . html::a(sprintf($link, $execution->id), $execution->name, '', "class='$selected executionName' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
';
if($selected == 'selected') $tabActive = 'myExecution';
$myExecutions ++;
}
else if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM != $this->app->user->account and !isset($execution->teams[$this->app->user->account]))
{
$normalExecutionsHtml .= '- ' . html::a(sprintf($link, $execution->id), $execution->name, '', "class='$selected executionName' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
';
if($selected == 'selected') $tabActive = 'other';
$others ++;
}
else if($execution->status == 'done' or $execution->status == 'closed')
{
$closedExecutionsHtml .= '- ' . html::a(sprintf($link, $execution->id), $execution->name, '', "class='$selected executionName' title='$execution->name' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '
';
if($selected == 'selected') $tabActive = 'closed';
}
/* If the execution is the last one in the project, print the closed label. */
if(!isset($projectExecutions[$index + 1]))
{
if($executionCounts[$projectID]['myExecution']) $myExecutionsHtml .= '
';
if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '
';
if($executionCounts[$projectID]['closed']) $closedExecutionsHtml .= '
';
}
}
}
$myExecutionsHtml .= '
';
$normalExecutionsHtml .= '
';
$closedExecutionsHtml .= '
';
?>
- execution->involved, '', "data-toggle='tab' class='not-list-item not-clear-menu'");?>
-
- project->other, '', "data-toggle='tab' class='not-list-item not-clear-menu'")?>
-