From 93f426a2f5c59a82ef646bf4aa76fc416d56febe Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 14 Dec 2023 10:34:07 +0800 Subject: [PATCH] * Code for task #107881, compatible with projects without products or iterations. --- module/story/model.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/story/model.php b/module/story/model.php index 41f797c518..6e6bb32e5d 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4874,6 +4874,9 @@ class storyModel extends model /* Adjust code, hide split entry. */ if(common::hasPriv('story', 'batchCreate') and !$execution->multiple and !$execution->hasProduct) { + static $taskGroups = array(); + if(empty($taskGroups[$story->id])) $taskGroups[$story->id] = $this->dao->select('id')->from(TABLE_TASK)->where('story')->eq($story->id)->fetch('id'); + $isClick = $this->isClickable($story, 'batchcreate'); $title = $story->type == 'story' ? $this->lang->story->subdivideSR : $this->lang->story->subdivide; if(!$isClick and $story->status != 'closed') @@ -4886,6 +4889,7 @@ class storyModel extends model { if($story->status != 'active') $title = sprintf($this->lang->story->subDivideTip['notActive'], $story->type == 'story' ? $this->lang->SRCommon : $this->lang->URCommon); if($story->status == 'active' and $story->stage != 'wait') $title = sprintf($this->lang->story->subDivideTip['notWait'], zget($this->lang->story->stageList, $story->stage)); + if($story->status == 'active' and !empty($taskGroups[$story->id])) $title = sprintf($this->lang->story->subDivideTip['notWait'], $this->lang->story->hasDividedTask); } }