$projectExecutions)
{
$executionCounts[$projectID]['myExecution'] = 0;
$executionCounts[$projectID]['others'] = 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') $dones ++;
$executionNames[] = $execution->name;
}
}
$executionsPinYin = common::convert2Pinyin($executionNames);
$myExecutionsHtml = $config->systemMode == 'new' ? '
' : '';
$normalExecutionsHtml = $config->systemMode == 'new' ? '' : '';
foreach($executions as $projectID => $projectExecutions)
{
/* Adapt to the old version. */
if($projectID and $config->systemMode == 'new')
{
$projectName = zget($projects, $projectID);
$preFix = $projectName . ' / ';
if($executionCounts[$projectID]['myExecution']) $myExecutionsHtml .= '';
if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '';
}
foreach($projectExecutions as $index => $execution)
{
$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->openApp}'") . '
';
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->openApp}'") . '
';
if($selected == 'selected') $tabActive = 'other';
$others ++;
}
else if($execution->status == 'done' or $execution->status == 'closed')
{
$closedExecutionsHtml .= html::a(sprintf($link, $execution->id), $preFix . $execution->name, '', "class='$selected' title='" . $preFix . $execution->name . "' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->openApp}'");
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 .= '
';
}
}
}
$myExecutionsHtml .= '
';
$normalExecutionsHtml .= '
';
?>
- execution->involved, '', "data-toggle='tab' class='not-list-item not-clear-menu'");?>
-
- project->other, '', "data-toggle='tab' class='not-list-item not-clear-menu'")?>
-