From b6674ed079ad9178c8e9a32467634cd0fd8c4e47 Mon Sep 17 00:00:00 2001 From: tianshujie98 Date: Sat, 10 Oct 2020 09:06:11 +0800 Subject: [PATCH] * Finish task #8061. --- module/bug/control.php | 1 + module/bug/js/create.js | 23 +++++++++++++++++++++-- module/bug/lang/de.php | 13 +++++++------ module/bug/lang/en.php | 13 +++++++------ module/bug/lang/fr.php | 13 +++++++------ module/bug/lang/vi.php | 13 +++++++------ module/bug/lang/zh-cn.php | 13 +++++++------ module/bug/view/create.html.php | 2 ++ 8 files changed, 59 insertions(+), 32 deletions(-) diff --git a/module/bug/control.php b/module/bug/control.php index 6fadf6687b..0a7afd1dc7 100644 --- a/module/bug/control.php +++ b/module/bug/control.php @@ -482,6 +482,7 @@ class bug extends control $this->view->branch = $branch; $this->view->branches = $branches; $this->view->color = $color; + $this->view->stepsRequired = strpos($this->config->bug->create->requiredFields, 'steps'); $this->display(); } diff --git a/module/bug/js/create.js b/module/bug/js/create.js index f89fc3118c..09c3db92e3 100644 --- a/module/bug/js/create.js +++ b/module/bug/js/create.js @@ -83,13 +83,14 @@ function setAssignedTo(moduleID, productID) }); } +var stepsTemplate; $(function() { if($('#project').val()) loadProjectRelated($('#project').val()); $('[data-toggle=tooltip]').tooltip(); - // adjust size of bug type input group + /* Adjust size of bug type input group. */ var adjustBugTypeGroup = function() { var $group = $('#bugTypeInputGroup'); @@ -107,7 +108,7 @@ $(function() adjustBugTypeGroup(); $(window).on('resize', adjustBugTypeGroup); - // init pri and severity selector + /* Init pri and severity selector. */ $('#severity, #pri').on('change', function() { var $select = $(this); @@ -115,4 +116,22 @@ $(function() var value = $select.val(); $selector.find('.pri-text').html($selector.data('type') === 'severity' ? '' : '' + value + ''); }); + + /* Get steps template. */ + stepsTemplate = editor['steps'].html(); + $("a[id^='tplTitleBox']").on('click', function() + { + setTimeout("stepsTemplate = editor['steps'].html()", 100); + }); + + /* Judgment of required items for steps. */ + $('#submit').on('click', function() + { + var steps = editor['steps'].html(); + if(stepsRequired !== false && stepsTemplate == steps) + { + bootbox.alert(stepsNotEmpty); + return false; + } + }); }); diff --git a/module/bug/lang/de.php b/module/bug/lang/de.php index 25fe06bf3f..c251c86b16 100644 --- a/module/bug/lang/de.php +++ b/module/bug/lang/de.php @@ -172,12 +172,13 @@ $lang->bug->legendRelated = 'Sonstige Infos'; $lang->bug->buttonConfirm = 'Confirm'; /* 交互提示。*/ -$lang->bug->summary = "Bugs on this page : %s Total, %s Unresolved."; -$lang->bug->confirmChangeProduct = "Change {$lang->productCommon} will cause linked {$lang->projectCommon},Story and Task change. Do you want to do this?"; -$lang->bug->confirmDelete = 'Do you want to delete this bug?'; -$lang->bug->remindTask = 'This Bug has been converted to Task. Do you want to update Status of Task(ID %s)?'; -$lang->bug->skipClose = 'Bug %s is not resolved. You cannot close it.'; -$lang->bug->projectAccessDenied = "You access to the {$lang->projectCommon} to which this bug belongs is denied!"; +$lang->bug->summary = "Bugs on this page : %s Total, %s Unresolved."; +$lang->bug->confirmChangeProduct = "Change {$lang->productCommon} will cause linked {$lang->projectCommon},Story and Task change. Do you want to do this?"; +$lang->bug->confirmDelete = 'Do you want to delete this bug?'; +$lang->bug->remindTask = 'This Bug has been converted to Task. Do you want to update Status of Task(ID %s)?'; +$lang->bug->skipClose = 'Bug %s is not resolved. You cannot close it.'; +$lang->bug->projectAccessDenied = "You access to the {$lang->projectCommon} to which this bug belongs is denied!"; +$lang->bug->stepsNotEmpty = "The reproduction step cannot be empty."; /* 模板。*/ $lang->bug->tplStep = "

[Steps]


"; diff --git a/module/bug/lang/en.php b/module/bug/lang/en.php index 4090efbee7..601382889a 100644 --- a/module/bug/lang/en.php +++ b/module/bug/lang/en.php @@ -172,12 +172,13 @@ $lang->bug->legendRelated = 'Related Info'; $lang->bug->buttonConfirm = 'Confirm'; /* Interactive prompt. */ -$lang->bug->summary = "Total %s bugs on this page, and %s Active."; -$lang->bug->confirmChangeProduct = "Any change to {$lang->productCommon} will cause linked {$lang->projectCommon}s, stories and tasks change. Do you want to do this?"; -$lang->bug->confirmDelete = 'Do you want to delete this bug?'; -$lang->bug->remindTask = 'This bug has been converted to a task. Do you want to update the status of Task(ID %s)?'; -$lang->bug->skipClose = 'Bug %s is active. You cannot close it.'; -$lang->bug->projectAccessDenied = "You access to the {$lang->projectCommon} to which this bug belongs is denied!"; +$lang->bug->summary = "Total %s bugs on this page, and %s Active."; +$lang->bug->confirmChangeProduct = "Any change to {$lang->productCommon} will cause linked {$lang->projectCommon}s, stories and tasks change. Do you want to do this?"; +$lang->bug->confirmDelete = 'Do you want to delete this bug?'; +$lang->bug->remindTask = 'This bug has been converted to a task. Do you want to update the status of Task(ID %s)?'; +$lang->bug->skipClose = 'Bug %s is active. You cannot close it.'; +$lang->bug->projectAccessDenied = "You access to the {$lang->projectCommon} to which this bug belongs is denied!"; +$lang->bug->stepsNotEmpty = "The reproduction step cannot be empty."; /* Template. */ $lang->bug->tplStep = "

[Steps]


"; diff --git a/module/bug/lang/fr.php b/module/bug/lang/fr.php index f3b4835de2..6b83dc5cbd 100644 --- a/module/bug/lang/fr.php +++ b/module/bug/lang/fr.php @@ -172,12 +172,13 @@ $lang->bug->legendRelated = 'Infos connexes'; $lang->bug->buttonConfirm = 'Confirmer'; /* 交互提示。*/ -$lang->bug->summary = "Total de %s bugs sur cette page, et %s sont Actifs."; -$lang->bug->confirmChangeProduct = "Tout changement aux {$lang->productCommon} fera que les {$lang->projectCommon}s, stories et tâches associées vont changer. Voulez-vous faire cela ?"; -$lang->bug->confirmDelete = 'Voulez-vous supprimer ce bug ?'; -$lang->bug->remindTask = 'Ce bug a été converti en tâche. Voulez-vous mettre à jour le statut de la Tâche(ID %s) ?'; -$lang->bug->skipClose = 'Bug %s est actif. Vous ne pouvez pas le fermer.'; -$lang->bug->projectAccessDenied = "Votre accès à {$lang->projectCommon} auquel ce bug appartient est refusé !"; +$lang->bug->summary = "Total de %s bugs sur cette page, et %s sont Actifs."; +$lang->bug->confirmChangeProduct = "Tout changement aux {$lang->productCommon} fera que les {$lang->projectCommon}s, stories et tâches associées vont changer. Voulez-vous faire cela ?"; +$lang->bug->confirmDelete = 'Voulez-vous supprimer ce bug ?'; +$lang->bug->remindTask = 'Ce bug a été converti en tâche. Voulez-vous mettre à jour le statut de la Tâche(ID %s) ?'; +$lang->bug->skipClose = 'Bug %s est actif. Vous ne pouvez pas le fermer.'; +$lang->bug->projectAccessDenied = "Votre accès à {$lang->projectCommon} auquel ce bug appartient est refusé !"; +$lang->bug->stepsNotEmpty = "The reproduction step cannot be empty."; /* 模板。*/ $lang->bug->tplStep = "

[Etape]


"; diff --git a/module/bug/lang/vi.php b/module/bug/lang/vi.php index d13b5f41f4..5bc4e82aba 100644 --- a/module/bug/lang/vi.php +++ b/module/bug/lang/vi.php @@ -172,12 +172,13 @@ $lang->bug->legendRelated = 'Thông tin liên quan'; $lang->bug->buttonConfirm = 'Xác nhận'; /* Interactive prompt. */ -$lang->bug->summary = "Tổng %s bugs, và %s kích hoạt."; -$lang->bug->confirmChangeProduct = "Mọi sự thay đổi tới {$lang->productCommon} sẽ là nguyên nhân liên kết {$lang->projectCommon}, câu chuyện và nhiệm vụ thay đổi. Bạn có muốn làm điều này?"; -$lang->bug->confirmDelete = 'Bạn có muốn xóa bug này?'; -$lang->bug->remindTask = 'Bug này đã chuyển thành một nhiệm vụ. Bạn có muốn cập nhật tình trạng của nhiệm vụ(ID %s)?'; -$lang->bug->skipClose = 'Bug %s được kích hoạt. Bạn không thể đóng nó.'; -$lang->bug->projectAccessDenied = "Truy cập của bạn tới {$lang->projectCommon} mà Bug này sở hữu bị từ chối!"; +$lang->bug->summary = "Tổng %s bugs, và %s kích hoạt."; +$lang->bug->confirmChangeProduct = "Mọi sự thay đổi tới {$lang->productCommon} sẽ là nguyên nhân liên kết {$lang->projectCommon}, câu chuyện và nhiệm vụ thay đổi. Bạn có muốn làm điều này?"; +$lang->bug->confirmDelete = 'Bạn có muốn xóa bug này?'; +$lang->bug->remindTask = 'Bug này đã chuyển thành một nhiệm vụ. Bạn có muốn cập nhật tình trạng của nhiệm vụ(ID %s)?'; +$lang->bug->skipClose = 'Bug %s được kích hoạt. Bạn không thể đóng nó.'; +$lang->bug->projectAccessDenied = "Truy cập của bạn tới {$lang->projectCommon} mà Bug này sở hữu bị từ chối!"; +$lang->bug->stepsNotEmpty = "The reproduction step cannot be empty."; /* Template. */ $lang->bug->tplStep = "

[Các bước]


"; diff --git a/module/bug/lang/zh-cn.php b/module/bug/lang/zh-cn.php index ff9aa1a2d7..0cef2c0e8f 100644 --- a/module/bug/lang/zh-cn.php +++ b/module/bug/lang/zh-cn.php @@ -172,12 +172,13 @@ $lang->bug->legendRelated = '其他信息'; $lang->bug->buttonConfirm = '确认'; /* 交互提示。*/ -$lang->bug->summary = "本页共 %s 个Bug,未解决 %s。"; -$lang->bug->confirmChangeProduct = "修改{$lang->productCommon}会导致相应的{$lang->projectCommon}、{$lang->storyCommon}和任务发生变化,确定吗?"; -$lang->bug->confirmDelete = '您确认要删除该Bug吗?'; -$lang->bug->remindTask = '该Bug已经转化为任务,是否更新任务(编号:%s)状态 ?'; -$lang->bug->skipClose = 'Bug %s 不是已解决状态,不能关闭。'; -$lang->bug->projectAccessDenied = "您无权访问该Bug所属的{$lang->projectCommon}!"; +$lang->bug->summary = "本页共 %s 个Bug,未解决 %s。"; +$lang->bug->confirmChangeProduct = "修改{$lang->productCommon}会导致相应的{$lang->projectCommon}、{$lang->storyCommon}和任务发生变化,确定吗?"; +$lang->bug->confirmDelete = '您确认要删除该Bug吗?'; +$lang->bug->remindTask = '该Bug已经转化为任务,是否更新任务(编号:%s)状态 ?'; +$lang->bug->skipClose = 'Bug %s 不是已解决状态,不能关闭。'; +$lang->bug->projectAccessDenied = "您无权访问该Bug所属的{$lang->projectCommon}!"; +$lang->bug->stepsNotEmpty = "重现步骤不能为空。"; /* 模板。*/ $lang->bug->tplStep = "

[步骤]


"; diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php index 42282830d6..886e0f7877 100644 --- a/module/bug/view/create.html.php +++ b/module/bug/view/create.html.php @@ -20,6 +20,8 @@ js::set('createRelease', $lang->release->create); js::set('createBuild', $lang->build->create); js::set('refresh', $lang->refresh); js::set('flow', $config->global->flow); +js::set('stepsRequired', $stepsRequired); +js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty); ?>