* Code for task #107881, compatible with projects without products or iterations.

This commit is contained in:
hufangzhou
2023-12-14 10:34:12 +08:00
parent 7493ec9bb3
commit 93f426a2f5
+4
View File
@@ -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);
}
}