* Finish task #82075.

This commit is contained in:
daitingting
2023-01-08 02:29:13 +00:00
parent b6f3986894
commit 40f8690b60
2 changed files with 14 additions and 23 deletions
+1 -1
View File
@@ -1401,7 +1401,7 @@ class story extends control
}
elseif($from == 'project')
{
$projectID = (isset($story->projects[$this->session->project]) || empty($story->projects)) ? $this->session->project : key($story->projects);
$projectID = $param ? $param : $this->session->project;
$this->loadModel('project')->setMenu($projectID);
}
elseif($from == 'qa')
+13 -22
View File
@@ -47,30 +47,14 @@ class storyModel extends model
if($setImgSize) $story->spec = $this->file->setImgSize($story->spec);
if($setImgSize) $story->verify = $this->file->setImgSize($story->verify);
$projects = $this->dao->select('t1.project, t2.name, t2.status, t2.type, t2.multiple, t2.project AS parentProject')->from(TABLE_PROJECTSTORY)->alias('t1')
$story->executions = $this->dao->select('t1.project, t2.name, t2.status, t2.type, t2.multiple')->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project = t2.id')
->where('t2.type')->in('sprint,stage,kanban,project')
->where('t2.type')->in('sprint,stage,kanban')
->beginIF($story->twins)->andWhere('t1.story')->in(ltrim($story->twins, ',') . $story->id)
->beginIF(!$story->twins)->andWhere('t1.story')->in($story->id)
->orderBy('t1.`order` DESC')
->fetchAll('project');
$story->projects = array();
$story->executions = array();
foreach($projects as $project)
{
if($project->type == 'project')
{
$story->projects[$project->project] = $project->project;
}
else
{
$story->executions[$project->project] = $project;
if(!$project->multiple) $story->projects[$project->parentProject] = $project->parentProject;
}
}
$story->tasks = $this->dao->select('id, name, assignedTo, execution, project, status, consumed, `left`,type')->from(TABLE_TASK)
->where('deleted')->eq(0)
->beginIF($story->twins)->andWhere('story')->in(ltrim($story->twins, ',') . $story->id)
@@ -4990,13 +4974,20 @@ class storyModel extends model
$tab = $this->app->tab;
$executionID = empty($execution) ? $this->session->execution : $execution->id;
$account = $this->app->user->account;
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0&param=0&storyType=$story->type");
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0&param=&storyType=$story->type");
$canView = common::hasPriv($story->type, 'view', null, "storyType=$story->type");
if($tab == 'project' and $this->session->multiple)
if($tab == 'project')
{
$storyLink = helper::createLink('projectstory', 'view', "storyID=$story->id&project={$this->session->project}");
$canView = common::hasPriv('projectstory', 'view');
if($this->session->multiple)
{
$storyLink = helper::createLink('projectstory', 'view', "storyID=$story->id&project={$this->session->project}");
$canView = common::hasPriv('projectstory', 'view');
}
else
{
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0&param={$this->session->project}&storyType=$story->type");
}
}
elseif($tab == 'execution')
{