*sprint_sunjun_631

This commit is contained in:
sunjun
2022-05-13 02:53:47 +00:00
parent 93e5d9e108
commit 845c84a1eb
3 changed files with 72 additions and 17 deletions
+12 -3
View File
@@ -3138,7 +3138,7 @@ class execution extends control
foreach($executions as $execution)
{
if(isset($orderedExecutions[$execution->parent])) unset($orderedExecutions[$execution->parent]);
if(isset($orderedExecutions[$execution->parent]) and $project->model != 'waterfall') unset($orderedExecutions[$execution->parent]);
$execution->teams = zget($teams, $execution->id, array());
$orderedExecutions[$execution->id] = $execution;
}
@@ -3160,11 +3160,20 @@ class execution extends control
$projectExecutions = array();
$parentIdList = array();
$childrenIdList = array();
foreach($orderedExecutions as $execution)
{
$projectExecutions[$execution->project][] = $execution;
if($execution->type != 'stage') continue;
if($execution->grade == 2 and $execution->project != $execution->parent) $parentIdList[$execution->parent] = $execution->parent;
if($execution->grade == 2 and $execution->project != $execution->parent)
{
$parentIdList[$execution->parent] = $execution->parent;
$childrenIdList[$execution->parent][] = $execution->id;
}
}
foreach($orderedExecutions as $id => $execution)
{
$execution->children = isset($childrenIdList[$execution->id]) ? $childrenIdList[$execution->id] : array();
$projectExecutions[$execution->project][] = $execution;
}
$parents = array();
+49 -14
View File
@@ -71,7 +71,6 @@ foreach($executions as $projectID => $projectExecutions)
if($executionCounts[$projectID]['others']) $normalExecutionsHtml .= '<li><div class="hide-in-search"><a class="text-muted not-list-item" title="' . $projectName . '">' . $projectName . '</a> <label class="label">' . $lang->project->common . '</label></div><ul>';
if($executionCounts[$projectID]['closed']) $closedExecutionsHtml .= '<li><div class="hide-in-search"><a class="text-muted not-list-item" title="' . $projectName . '">' . $projectName . '</a> <label class="label">' . $lang->project->common . '</label></div><ul>';
}
foreach($projectExecutions as $index => $execution)
{
$kanbanLink = $this->createLink('execution', 'kanban', "executionID=%s");
@@ -80,27 +79,63 @@ foreach($executions as $projectID => $projectExecutions)
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])))
if(!empty($execution->children))
{
$myExecutionsHtml .= '<li>' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '</li>';
foreach($execution->children as $id)
{
$selected = $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 .= '<li>' . html::a(sprintf($link, $id), $executionNames[$id], '', "class='$selected clickable' title='{$executionNames[$id]}' data-key='" . zget($executionsPinYin, $executionNames[$id], '') . "' data-app='{$this->app->tab}'") . '</li>';
if($selected == 'selected') $tabActive = 'myExecution';
if($selected == 'selected') $tabActive = 'myExecution';
$myExecutions ++;
$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 .= '<li>' . html::a(sprintf($link, $id), $executionNames[$id], '', "class='$selected clickable' title='{$executionNames[$id]}' data-key='" . zget($executionsPinYin, $executionNames[$id], '') . "' data-app='{$this->app->tab}'") . '</li>';
if($selected == 'selected') $tabActive = 'other';
$others ++;
}
else if($execution->status == 'done' or $execution->status == 'closed')
{
$closedExecutionsHtml .= '<li>' . html::a(sprintf($link, $id), $executionNames[$id], '', "class='$selected clickable' title='{$executionNames[$id]}' data-key='" . zget($executionsPinYin, $executionNames[$id], '') . "' data-app='{$this->app->tab}'") . '</li>';
if($selected == 'selected') $tabActive = 'closed';
}
}
}
else if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM != $this->app->user->account and !isset($execution->teams[$this->app->user->account]))
elseif($execution->grade == 2 and $execution->parent != $execution->project)
{
$normalExecutionsHtml .= '<li>' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='{$execution->name}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '</li>';
if($selected == 'selected') $tabActive = 'other';
$others ++;
continue;
}
else if($execution->status == 'done' or $execution->status == 'closed')
else
{
$closedExecutionsHtml .= '<li>' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='$execution->name' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '</li>';
if($execution->status != 'done' and $execution->status != 'closed' and ($execution->PM == $this->app->user->account or isset($execution->teams[$this->app->user->account])))
{
$myExecutionsHtml .= '<li>' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='{$executionNames[$execution->id]}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '</li>';
if($selected == 'selected') $tabActive = 'closed';
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 .= '<li>' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='{$executionNames[$execution->id]}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '</li>';
if($selected == 'selected') $tabActive = 'other';
$others ++;
}
else if($execution->status == 'done' or $execution->status == 'closed')
{
$closedExecutionsHtml .= '<li>' . html::a(sprintf($link, $execution->id), $executionNames[$execution->id], '', "class='$selected clickable' title='{$executionNames[$execution->id]}' data-key='" . zget($executionsPinYin, $execution->name, '') . "' data-app='{$this->app->tab}'") . '</li>';
if($selected == 'selected') $tabActive = 'closed';
}
}
/* If the execution is the last one in the project, print the closed label. */
+11
View File
@@ -2285,6 +2285,17 @@ class projectModel extends model
}
/* In the case of the waterfall model, calculate the sub-stage. */
if($projectID == 0)
{
foreach($executions as $key => $execution)
{
if($execution->type == 'stage')
{
$execution->children = isset($children[$execution->id]) ? $children[$execution->id] : array();
unset($children[$execution->id]);
}
}
}
$project = $this->getByID($projectID);
if($project and $project->model == 'waterfall')
{