* Fix bug.

This commit is contained in:
Yagami
2021-03-23 14:37:08 +08:00
parent 5af5c9a92c
commit 02fb955dc2
3 changed files with 21 additions and 13 deletions
+14 -6
View File
@@ -2543,18 +2543,26 @@ class execution extends control
$orderedExecutions = array();
$projects = $this->loadModel('program')->getProjectList(0, 'all', 0, 'order_asc');
$executionGroups = $this->dao->select('*')->from(TABLE_EXECUTION)
->where('id')->in($this->app->user->view->sprints)
->andWhere('deleted')->eq(0)
->andWhere('project')->in(array_keys($projects))
->orderBy('id_desc')
->fetchGroup('project', 'id');
$teams = $this->dao->select('root,account')->from(TABLE_TEAM)
->where('root')->in($this->app->user->view->sprints)
->andWhere('type')->eq('execution')
->fetchGroup('root', 'account');
foreach($projects as $project)
{
$executions = $this->dao->select('*')->from(TABLE_EXECUTION)
->where('id')->in($this->app->user->view->sprints)
->andWhere('deleted')->eq(0)
->andWhere('project')->eq($project->id)
->orderBy('id_desc')
->fetchAll('id');
$executions = zget($executionGroups, $project->id, array());
foreach($executions as $execution)
{
if(isset($orderedExecutions[$execution->parent])) unset($orderedExecutions[$execution->parent]);
$execution->teams = zget($teams, $execution->id, array());
$orderedExecutions[$execution->id] = $execution;
}
}
@@ -11,8 +11,8 @@ $normalProjectsHtml = '';
$closedProjectsHtml = '';
foreach($executions as $execution)
{
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM == $this->app->user->account) $iCharges++;
if($execution->status != 'done' and $execution->status != 'closed' and !($execution->PM == $this->app->user->account)) $others++;
if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account]))) $iCharges++;
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM != $this->app->user->account and !isset($execution->teams[$this->app->user->account])) $others++;
if($execution->status == 'done' or $execution->status == 'closed') $dones++;
$executionNames[] = $execution->name;
}
@@ -22,11 +22,11 @@ foreach($executions as $execution)
{
$selected = $execution->id == $executionID ? 'selected' : '';
$executionName = zget($projects, $execution->project) . '/' . $execution->name;
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM == $this->app->user->account)
if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account])))
{
$myProjectsHtml .= html::a(sprintf($link, $execution->id), "<i class='icon icon-{$lang->icons[$execution->type]}'></i> " . $executionName, '', "class='text-important $selected' title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
}
else if($execution->status != 'done' and $execution->status != 'closed' and !($execution->PM == $this->app->user->account))
else if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM != $this->app->user->account and !isset($execution->teams[$this->app->user->account]))
{
$normalProjectsHtml .= html::a(sprintf($link, $execution->id), "<i class='icon icon-{$lang->icons[$execution->type]}'></i> " . $executionName, '', "class='$selected' title='{$executionName}' data-key='" . zget($executionsPinYin, $execution->name, '') . "'");
}
@@ -39,7 +39,7 @@ foreach($executions as $execution)
<?php
if(!empty($myProjectsHtml))
{
echo "<div class='heading'>{$lang->execution->mine}</div>";
echo "<div class='heading'>{$lang->execution->involved}</div>";
echo $myProjectsHtml;
if(!empty($myProjectsHtml))
{
+2 -2
View File
@@ -75,7 +75,7 @@ class repo extends control
{
$repoID = $this->session->repoID;
$this->commonAction($repoID);
$this->repo->setMenu($this->repos, $repoID, false);
$this->lang->switcherMenu = '';
if(common::hasPriv('repo', 'create')) $this->lang->TRActions = html::a(helper::createLink('repo', 'create'), "<i class='icon icon-plus'></i> " . $this->lang->repo->create, '', "class='btn btn-primary'");
$repoList = $this->repo->getList(0, $orderBy);
@@ -765,7 +765,7 @@ class repo extends control
$repoID = $this->session->repoID;
$this->commonAction($repoID);
$this->repo->setMenu($this->repos, $repoID, false);
$this->lang->switcherMenu = '';
$this->app->loadLang('task');
$this->app->loadLang('bug');