From 0dfd65dd2dcac152043f412e726e738279574e5a Mon Sep 17 00:00:00 2001 From: daitingting Date: Fri, 7 Jun 2024 09:32:27 +0000 Subject: [PATCH] * [bug#31584,done,1h] Get project of execution. --- lib/zin/wg/executiontasklist/v1.php | 3 ++- module/story/model.php | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/zin/wg/executiontasklist/v1.php b/lib/zin/wg/executiontasklist/v1.php index 6286a99d36..c831e394bd 100644 --- a/lib/zin/wg/executiontasklist/v1.php +++ b/lib/zin/wg/executiontasklist/v1.php @@ -65,9 +65,10 @@ class executionTaskList extends wg foreach($executions as $executionID => $execution) { - if(isset($items[$executionID]) || !$execution->multiple) continue; + if(isset($items[$executionID])) continue; $executionLink = (isset($execution->type) && $execution->type == 'kanban' && $isInModal) ? null : createLink('execution', 'view', "executionID=$executionID"); + if(!$execution->multiple) $executionLink = createLink('project', 'view', "projectID=$execution->project"); $items[$executionID] = array ( 'icon' => 'run', diff --git a/module/story/model.php b/module/story/model.php index 32fd9b9f9f..0ea219d9af 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -48,12 +48,12 @@ class storyModel extends model $story->relationStoryID = $this->getRelationStoryID($story->id, $story->type); $storyIdList = $storyID . ($story->relationStoryID ? "," . trim($story->relationStoryID, ',') : '') . ($story->twins ? "," . trim($story->twins, ',') : ''); - $story->executions = $this->dao->select('t1.project, t2.id, t2.name, t2.status, t2.type, t2.multiple')->from(TABLE_PROJECTSTORY)->alias('t1') + $story->executions = $this->dao->select('t2.project, t2.id, 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') ->andWhere('t1.story')->in($storyIdList) ->orderBy('t1.`order` DESC') - ->fetchAll('project'); + ->fetchAll('id'); $story->tasks = $this->dao->select('id,name,assignedTo,execution,project,status,consumed,`left`,type')->from(TABLE_TASK)->where('deleted')->eq(0)->andWhere('story')->in($storyIdList)->orderBy('id DESC')->fetchGroup('execution');