From ee39dcb34e0ddf29da36a2746428a5ca784476cd Mon Sep 17 00:00:00 2001 From: liumengyi Date: Fri, 1 Nov 2024 15:24:00 +0800 Subject: [PATCH] * [task#131539,done,1h] show all child id in the tip. --- module/task/js/batchedit.ui.js | 5 +---- module/task/lang/de.php | 1 - module/task/lang/en.php | 1 - module/task/lang/fr.php | 1 - module/task/lang/zh-cn.php | 1 - module/task/ui/batchedit.html.php | 1 - module/task/ui/edit.html.php | 5 +---- 7 files changed, 2 insertions(+), 13 deletions(-) diff --git a/module/task/js/batchedit.ui.js b/module/task/js/batchedit.ui.js index 0f7cf55646..7a8eeb6627 100644 --- a/module/task/js/batchedit.ui.js +++ b/module/task/js/batchedit.ui.js @@ -75,7 +75,6 @@ window.clickSubmit = async function(e) const $taskBatchFormTrs = $taskBatchForm.find('tbody tr'); var confirmID = ''; - var tipAll = true; for(let i = 0; i < $taskBatchFormTrs.length; i++) { const $currentTr = $($taskBatchFormTrs[i]); @@ -94,7 +93,6 @@ window.clickSubmit = async function(e) const nonStoryChildTaskIdList = Object.keys(nonStoryChildTasks[taskID]); if(nonStoryChildTaskIdList.length == 0) continue; - if(tipAll) tipAll = Object.keys(childTasks[taskID]).length == nonStoryChildTaskIdList.length; for(let j = 0; j < nonStoryChildTaskIdList.length; j++) confirmID += 'ID' + nonStoryChildTaskIdList[j].toString() + ', '; } @@ -102,8 +100,7 @@ window.clickSubmit = async function(e) if(confirmID.endsWith(', ')) confirmID = confirmID.slice(0, -2); - let confirmTip = tipAll ? syncStoryToAllChildrenTip : syncStoryToChildrenTip; - confirmTip = confirmTip.replace('%s', confirmID); + let confirmTip = syncStoryToChildrenTip.replace('%s', confirmID); zui.Modal.confirm(confirmTip).then((res) => { $taskBatchForm.find('[name=syncChildren]').remove(); diff --git a/module/task/lang/de.php b/module/task/lang/de.php index 4cf016c3b4..1c52bd6077 100644 --- a/module/task/lang/de.php +++ b/module/task/lang/de.php @@ -286,7 +286,6 @@ $lang->task->cannotDeleteParent = 'Cannot delete parent task'; $lang->task->addChildTask = 'Because the task has already consumed consumption, to ensure data consistency, we will help you create a subtask with the same name to record the consumption.'; $lang->task->selectTestStoryTip = "The following {$lang->SRCommon} will be subtasks of this task"; $lang->task->effortOperateTips = 'Only the project manager, the executive supervisor, and the department head have the authority to %s logs belonging to others.'; -$lang->task->syncStoryToAllChildrenTip = "Will be {$lang->SRCommon} synchronised with all child tasks?"; $lang->task->syncStoryToChildrenTip = "Child tasks of %s do not have {$lang->SRCommon}, will {$lang->SRCommon} be synchronised with these child tasks?"; $lang->task->error = new stdclass(); diff --git a/module/task/lang/en.php b/module/task/lang/en.php index a59de06763..7e4e827692 100755 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -286,7 +286,6 @@ $lang->task->cannotDeleteParent = 'Cannot delete parent task'; $lang->task->addChildTask = 'Because the task has cost hours, ZenTao will create a child task with the same name to record the cost housrs to ensure data consistency.'; $lang->task->selectTestStoryTip = "The following {$lang->SRCommon} will be subtasks of this task"; $lang->task->effortOperateTips = 'Only the project manager, the executive supervisor, and the department head have the authority to %s logs belonging to others.'; -$lang->task->syncStoryToAllChildrenTip = "Will be {$lang->SRCommon} synchronised with all child tasks?"; $lang->task->syncStoryToChildrenTip = "Child tasks of %s do not have {$lang->SRCommon}, will {$lang->SRCommon} be synchronised with these child tasks?"; $lang->task->error = new stdclass(); diff --git a/module/task/lang/fr.php b/module/task/lang/fr.php index 5f51abe0ca..d7c78079d1 100644 --- a/module/task/lang/fr.php +++ b/module/task/lang/fr.php @@ -286,7 +286,6 @@ $lang->task->cannotDeleteParent = 'Impossible de supprimer la tâche pare $lang->task->addChildTask = 'Because the task has already consumed consumption, to ensure data consistency, we will help you create a subtask with the same name to record the consumption.'; $lang->task->selectTestStoryTip = "The following {$lang->SRCommon} will be subtasks of this task"; $lang->task->effortOperateTips = 'Only the project manager, the executive supervisor, and the department head have the authority to %s logs belonging to others.'; -$lang->task->syncStoryToAllChildrenTip = "Will be {$lang->SRCommon} synchronised with all child tasks?"; $lang->task->syncStoryToChildrenTip = "Child tasks of %s do not have {$lang->SRCommon}, will {$lang->SRCommon} be synchronised with these child tasks?"; $lang->task->error = new stdclass(); diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index dd3e61d807..638c685754 100755 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -286,7 +286,6 @@ $lang->task->cannotDeleteParent = '不能删除父任务。'; $lang->task->addChildTask = '因该任务已经产生消耗,为保证数据一致性,我们会帮您创建一条同名子任务记录该消耗。'; $lang->task->selectTestStoryTip = "以下{$lang->SRCommon}将作为此任务的子任务"; $lang->task->effortOperateTips = '只有项目负责人、执行负责人、所属部门负责人才能%s他人日志。'; -$lang->task->syncStoryToAllChildrenTip = "是否同步更新所有子任务的相关{$lang->SRCommon}?"; $lang->task->syncStoryToChildrenTip = "子任务%s没有关联{$lang->SRCommon},是否同步更新这些子任务的相关{$lang->SRCommon}?"; $lang->task->error = new stdclass(); diff --git a/module/task/ui/batchedit.html.php b/module/task/ui/batchedit.html.php index 0b8c535b5e..5eeebd922f 100644 --- a/module/task/ui/batchedit.html.php +++ b/module/task/ui/batchedit.html.php @@ -22,7 +22,6 @@ jsVar('childTasks', $childTasks); jsVar('nonStoryChildTasks', $nonStoryChildTasks); jsVar('tasks', $tasks); jsVar('stories', $stories); -jsVar('syncStoryToAllChildrenTip', $lang->task->syncStoryToAllChildrenTip); jsVar('syncStoryToChildrenTip', $lang->task->syncStoryToChildrenTip); jsVar('parentTasks', $parentTasks); jsVar('ignoreLang', $lang->project->ignore); diff --git a/module/task/ui/edit.html.php b/module/task/ui/edit.html.php index ad66a5358a..f19970c208 100644 --- a/module/task/ui/edit.html.php +++ b/module/task/ui/edit.html.php @@ -38,10 +38,7 @@ jsVar('overParentEstStartedLang', isset($parentTask) ? sprintf($lang->task->over jsVar('overParentDeadlineLang', isset($parentTask) ? sprintf($lang->task->overParentDeadline, $parentTask->deadline) : ''); $confirmSyncTip = ''; -if(!empty($syncChildren) && !empty($task->children)) -{ - $confirmSyncTip = count($syncChildren) == count($task->children) ? $lang->task->syncStoryToAllChildrenTip : sprintf($lang->task->syncStoryToChildrenTip, 'ID' . implode(', ID', $syncChildren)); -} +if(!empty($syncChildren) && !empty($task->children)) $confirmSyncTip = sprintf($lang->task->syncStoryToChildrenTip, 'ID' . implode(', ID', $syncChildren)); jsVar('confirmSyncTip', $confirmSyncTip); jsVar('taskID', $task->id); jsVar('taskStory', $task->story);