From aaac6a6d0ea8515b215b722b0d993cb2a55e4687 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 27 Feb 2023 13:42:15 +0800 Subject: [PATCH 1/2] * The tag output problem was rectified. --- module/custom/model.php | 29 +++++++++++++++++++++++------ module/my/view/todo.html.php | 2 +- module/todo/lang/de.php | 1 + module/todo/lang/en.php | 1 + module/todo/lang/fr.php | 1 + module/todo/lang/zh-cn.php | 1 + 6 files changed, 28 insertions(+), 7 deletions(-) diff --git a/module/custom/model.php b/module/custom/model.php index 4d965d2acb..b150b7d199 100644 --- a/module/custom/model.php +++ b/module/custom/model.php @@ -51,14 +51,31 @@ class customModel extends model $processedLang = array(); foreach($allCustomLang as $id => $customLang) { - if(isset($sectionLang[$customLang->module][$customLang->section]['all']) && isset($sectionLang[$customLang->module][$customLang->section][$currentLang]) && $customLang->lang == 'all') continue; + if(isset($sectionLang[$customLang->module][$customLang->section]['all']) and isset($sectionLang[$customLang->module][$customLang->section][$currentLang]) and $customLang->lang == 'all') continue; - $sections = explode('-', $customLang->section); - $sectionIndex = count($sections) - 1; - $sectionArr = array($customLang->key => $customLang->value); - for($index = $sectionIndex; $index >= 0; $index --) $sectionArr = array($sections[$index] => $sectionArr); + if(strpos($customLang->section, 'featureBar-') !== false) + { + $sections = explode('-', $customLang->section); + $sectionIndex = count($sections) - 1; + $sectionArr = array($customLang->key => $customLang->value); + $oldSectionArr = empty($processedLang[$customLang->module]) ? array() : $processedLang[$customLang->module]; + if(!empty($oldSectionArr)) + { + for($i = 0; $i <= $sectionIndex; $i ++) + { + $sectionKey = $sections[$i]; + $oldSectionArr = $oldSectionArr[$sectionKey]; + } + $sectionArr = array_merge($oldSectionArr, $sectionArr); + } - $processedLang[$customLang->module] = $sectionArr; + for($index = $sectionIndex; $index >= 0; $index --) $sectionArr = array($sections[$index] => $sectionArr); + $processedLang[$customLang->module] = $sectionArr; + } + else + { + $processedLang[$customLang->module][$customLang->section][$customLang->key] = $customLang->value; + } } return $processedLang; diff --git a/module/my/view/todo.html.php b/module/my/view/todo.html.php index 3f13469623..04fb88c2e6 100644 --- a/module/my/view/todo.html.php +++ b/module/my/view/todo.html.php @@ -123,7 +123,7 @@ $doingCount = 0; createLink('todo', 'view', "id=$todo->id&from=my", '', true), $todo->name, '', "data-toggle='modal' data-width='80%' data-type='iframe' data-title='" . $lang->todo->view . "' data-icon='check'");?> pri;?>' title='todo->priList, $todo->pri, $todo->pri);?>'>todo->priList, $todo->pri)?> - date == '2030-01-01' ? $lang->todo->featureBar['todo']['future'] : $todo->date;?> + date == '2030-01-01' ? $lang->todo->future : $todo->date;?> todo->statusList[$todo->status];?> todo->typeList, $todo->type, '');?> diff --git a/module/todo/lang/de.php b/module/todo/lang/de.php index 238f36745c..1f5dd607bf 100644 --- a/module/todo/lang/de.php +++ b/module/todo/lang/de.php @@ -36,6 +36,7 @@ $lang->todo->project = "Project"; $lang->todo->product = "Product"; $lang->todo->execution = $lang->executionCommon; $lang->todo->changeDate = "Change Date"; +$lang->todo->future = 'TBD'; $lang->todo->reasonList['story'] = "Story übertragen"; $lang->todo->reasonList['task'] = "Aufgabe übertragen"; diff --git a/module/todo/lang/en.php b/module/todo/lang/en.php index 09ff40e167..778cd46492 100644 --- a/module/todo/lang/en.php +++ b/module/todo/lang/en.php @@ -36,6 +36,7 @@ $lang->todo->project = "Project"; $lang->todo->product = "Product"; $lang->todo->execution = $lang->executionCommon; $lang->todo->changeDate = "Change Date"; +$lang->todo->future = 'TBD'; $lang->todo->reasonList['story'] = "Convert to Story"; $lang->todo->reasonList['task'] = "Convert to Task"; diff --git a/module/todo/lang/fr.php b/module/todo/lang/fr.php index 8d58bef8e0..814933e949 100644 --- a/module/todo/lang/fr.php +++ b/module/todo/lang/fr.php @@ -36,6 +36,7 @@ $lang->todo->project = "Project"; $lang->todo->product = "Product"; $lang->todo->execution = $lang->executionCommon; $lang->todo->changeDate = "Change Date"; +$lang->todo->future = 'TBD'; $lang->todo->reasonList['story'] = "Convertir en Story"; $lang->todo->reasonList['task'] = "Convertir en Tâche"; diff --git a/module/todo/lang/zh-cn.php b/module/todo/lang/zh-cn.php index 563487a90c..ebd1d81af0 100644 --- a/module/todo/lang/zh-cn.php +++ b/module/todo/lang/zh-cn.php @@ -36,6 +36,7 @@ $lang->todo->project = "所属项目"; $lang->todo->product = "所属产品"; $lang->todo->execution = "所属{$lang->execution->common}"; $lang->todo->changeDate = "修改日期"; +$lang->todo->future = '待定'; $lang->todo->reasonList['story'] = "转{$lang->SRCommon}"; $lang->todo->reasonList['task'] = "转任务"; From 20b129e8c44b164d60359bed62e2c34f6fd4588b Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 27 Feb 2023 14:11:40 +0800 Subject: [PATCH 2/2] * Code for finish task #85504. --- module/story/lang/de.php | 1 + module/story/lang/en.php | 1 + module/story/lang/fr.php | 1 + module/story/lang/zh-cn.php | 1 + module/story/model.php | 11 ++++++++--- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/module/story/lang/de.php b/module/story/lang/de.php index 0fc7259a0a..921c2b99d4 100644 --- a/module/story/lang/de.php +++ b/module/story/lang/de.php @@ -33,6 +33,7 @@ $lang->story->edit = "Bearbeiten"; $lang->story->editDraft = "Entwurf bearbeiten"; $lang->story->batchEdit = "Mehere bearbeiten"; $lang->story->subdivide = 'Aufteilen'; +$lang->story->subdivideSR = $lang->SRCommon . 'Aufteilen'; $lang->story->link = 'Link'; $lang->story->unlink = 'Unlink'; $lang->story->track = 'Track'; diff --git a/module/story/lang/en.php b/module/story/lang/en.php index 8df89bc064..ba4ef0b228 100644 --- a/module/story/lang/en.php +++ b/module/story/lang/en.php @@ -33,6 +33,7 @@ $lang->story->edit = "Edit Story"; $lang->story->editDraft = "Edit Draft"; $lang->story->batchEdit = "Batch Edit"; $lang->story->subdivide = 'Decompose'; +$lang->story->subdivideSR = $lang->SRCommon . 'Decompose'; $lang->story->link = 'Link'; $lang->story->unlink = 'Unlink'; $lang->story->track = 'Track'; diff --git a/module/story/lang/fr.php b/module/story/lang/fr.php index 61cd091ec8..7d7e31d5c5 100644 --- a/module/story/lang/fr.php +++ b/module/story/lang/fr.php @@ -33,6 +33,7 @@ $lang->story->edit = "Editer Story"; $lang->story->editDraft = "Modifier le projet"; $lang->story->batchEdit = "Editer par Lot"; $lang->story->subdivide = 'Décomposer'; +$lang->story->subdivideSR = $lang->SRCommon . 'Dé composer'; $lang->story->link = 'Link'; $lang->story->unlink = 'Unlink'; $lang->story->track = 'Track'; diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index 3a03f7a475..fd8c7b2a54 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -33,6 +33,7 @@ $lang->story->edit = "编辑"; $lang->story->editDraft = "编辑草稿"; $lang->story->batchEdit = "批量编辑"; $lang->story->subdivide = '细分'; +$lang->story->subdivideSR = $lang->SRCommon . '细分'; $lang->story->link = '关联'; $lang->story->unlink = '移除'; $lang->story->track = '跟踪矩阵'; diff --git a/module/story/model.php b/module/story/model.php index 3323d09ee6..7655c8d5ca 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -4596,7 +4596,7 @@ class storyModel extends model if($this->app->rawModule != 'projectstory' OR $this->config->vision == 'lite' OR $shadow) { $isClick = $this->isClickable($story, 'batchcreate'); - $title = $this->lang->story->subdivide; + $title = $story->type == 'story' ? $this->lang->story->subdivideSR : $this->lang->story->subdivide; if(!$isClick and $story->status != 'closed') { if($story->parent > 0) @@ -4650,7 +4650,12 @@ class storyModel extends model $menu .= $this->buildMenu('story', 'review', $params . "&from={$this->app->tab}&storyType=$story->type", $story, $type, 'search', '', 'showinonlybody'); $executionID = empty($execution) ? 0 : $execution->id; - if(!isonlybody()) $menu .= $this->buildMenu('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&$params&executionID=$executionID&plan=0&storyType=story", $story, $type, 'split', '', 'divideStory', true, "data-toggle='modal' data-type='iframe' data-width='95%'", $this->lang->story->subdivide); + if(!isonlybody()) + { + $subdivideTitle = $story->type == 'story' ? $this->lang->story->subdivideSR : $this->lang->story->subdivide; + $menu .= $this->buildMenu('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&$params&executionID=$executionID&plan=0&storyType=story", $story, $type, 'split', '', 'divideStory', true, "data-toggle='modal' data-type='iframe' data-width='95%'", $subdivideTitle); + + } $menu .= $this->buildMenu('story', 'assignTo', $params . "&kanbanGroup=default&from=&storyType=$story->type", $story, $type, '', '', 'iframe showinonlybody', true); $menu .= $this->buildMenu('story', 'close', $params . "&from=&storyType=$story->type", $story, $type, '', '', 'iframe showinonlybody', true); @@ -4780,7 +4785,7 @@ class storyModel extends model if(common::hasPriv('story', 'batchCreate') and !$execution->multiple and !$execution->hasProduct) { $isClick = $this->isClickable($story, 'batchcreate'); - $title = $this->lang->story->subdivide; + $title = $story->type == 'story' ? $this->lang->story->subdivideSR : $this->lang->story->subdivide; if(!$isClick and $story->status != 'closed') { if($story->parent > 0)