From b07b1031ea80c00e121c679053295ae5b6e45ba9 Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 3 Nov 2022 03:15:41 +0000 Subject: [PATCH] * Finish task #74667. --- module/custom/js/mode.js | 41 +++++++++++++------------------- module/custom/lang/de.php | 11 +++++---- module/custom/lang/en.php | 11 +++++---- module/custom/lang/fr.php | 11 +++++---- module/custom/lang/zh-cn.php | 13 ++++++---- module/custom/view/mode.html.php | 37 ++++++++++++++-------------- 6 files changed, 64 insertions(+), 60 deletions(-) diff --git a/module/custom/js/mode.js b/module/custom/js/mode.js index b670ff28cc..e27ffe602c 100644 --- a/module/custom/js/mode.js +++ b/module/custom/js/mode.js @@ -9,39 +9,32 @@ $(function() $('#program').closest('tr').toggle(mode == 'ALM' && $(this).val() == 'light'); }); - $(document).on('click', '#submit', function() { - if(mode == $('[name=mode]:checked').val()) return false; + var selectedMode = $('[name=mode]:checked').val(); + if(mode == selectedMode) return false; - if($(this).hasClass('canSubmit')) + if(selectedMode == 'light') { - $(this).removeClass('canSubmit'); - $('#confirmModal').modal('hide'); - return true; + $('#selectProgramModal').modal('show'); + } + else + { + bootbox.confirm(changeModeTips, function(result) + { + if(result) $('#modeForm').submit(); + }); } - - $(this).addClass('canSubmit'); - - var $mode = $('[name=mode]:checked').val(); - var confirmTitle = changeModeTitleTips[$mode]; - var confirmContent = changeModeContentTips[$mode] - - $('#confirmModal .modal-title').html(confirmTitle); - $('#confirmModal .modal-body').html(confirmContent); - - $('#confirmModal').modal('show'); return false; }); - $(document).on('click', '.btn-confirm', function() + $(document).on('click', '.btn-save', function() { - $('#submit').click(); - }); - - $('#confirmModal').on('hide.zui.modal', function() - { - $('#submit').removeClass('canSubmit'); + setTimeout(function() + { + $('#selectProgramModal').modal('hide'); + $('#modeForm').submit(); + }, 1000); }); }) diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 1430b96e43..6a5912d82b 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -57,6 +57,7 @@ $lang->custom->code = $lang->code; $lang->custom->setCode = 'Enable or Disable Code'; $lang->custom->execution = 'Execution'; $lang->custom->defaultProgram = 'Default program'; +$lang->custom->selectDefaultProgram = 'Please select default program'; $lang->custom->unitList['efficiency'] = 'Working Hours/'; $lang->custom->unitList['manhour'] = 'Man-hour/'; @@ -240,10 +241,12 @@ $lang->custom->sprintConceptList[1] = 'Program Product Sprint'; $lang->custom->workingList['full'] = 'Full Management of Dev'; -$lang->custom->menuTip = 'Click to show/hide navigation bar. Drag to swtich display order.'; -$lang->custom->saveFail = 'Failed to save!'; -$lang->custom->page = ' Page'; -$lang->custom->changeModeTips = 'Historical deleted data does not participate in the data merging process. After switching the mode, it will not support restoration. Please know.'; +$lang->custom->menuTip = 'Click to show/hide the menu. Drag to switch display order.'; +$lang->custom->saveFail = 'Failed to save!'; +$lang->custom->page = ' Page'; +$lang->custom->currentModeTips = 'You are currently using %s, you can switch to the %s.'; +$lang->custom->changeModeTips = 'Please double confirm to switch to %s Mode.'; +$lang->custom->selectProgramTips = 'After switching to the Light Mode, in order to ensure the consistency of the data structure, you need to select a program as the default program, and subsequent new product and project data are associated with this default program.'; $lang->custom->changeModeTitleTips['ALM'] = 'Please double confirm to switch to ALM Mode.'; $lang->custom->changeModeTitleTips['light'] = 'Please double confirm to switch to Light Mode.'; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index ef36660265..5d7524bbc3 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -56,6 +56,7 @@ $lang->custom->dept = 'Dept'; $lang->custom->code = $lang->code; $lang->custom->setCode = 'Enable or Disable Code'; $lang->custom->execution = 'Execution'; +$lang->custom->selectDefaultProgram = 'Please select default program'; $lang->custom->defaultProgram = 'Default program'; $lang->custom->unitList['efficiency'] = 'Working Hours/'; @@ -240,10 +241,12 @@ $lang->custom->sprintConceptList[1] = 'Program Product Sprint'; $lang->custom->workingList['full'] = 'Application Lifecycle Management'; -$lang->custom->menuTip = 'Click to show/hide the menu. Drag to switch display order.'; -$lang->custom->saveFail = 'Failed to save!'; -$lang->custom->page = ' Page'; -$lang->custom->changeModeTips = 'Historical deleted data does not participate in the data merging process. After switching the mode, it will not support restoration. Please know.'; +$lang->custom->menuTip = 'Click to show/hide the menu. Drag to switch display order.'; +$lang->custom->saveFail = 'Failed to save!'; +$lang->custom->page = ' Page'; +$lang->custom->currentModeTips = 'You are currently using %s, you can switch to the %s.'; +$lang->custom->changeModeTips = 'Please double confirm to switch to %s Mode.'; +$lang->custom->selectProgramTips = 'After switching to the Light Mode, in order to ensure the consistency of the data structure, you need to select a program as the default program, and subsequent new product and project data are associated with this default program.'; $lang->custom->changeModeTitleTips['ALM'] = 'Please double confirm to switch to ALM Mode.'; $lang->custom->changeModeTitleTips['light'] = 'Please double confirm to switch to Light Mode.'; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 8bfa03c885..65f0d02055 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -56,6 +56,7 @@ $lang->custom->dept = 'Dept'; $lang->custom->code = $lang->code; $lang->custom->setCode = 'Activer ou Désactiver le Code'; $lang->custom->execution = 'Execution'; +$lang->custom->selectDefaultProgram = 'Please select default program'; $lang->custom->defaultProgram = 'Default program'; $lang->custom->unitList['efficiency'] = 'Working Hours/'; @@ -240,10 +241,12 @@ $lang->custom->sprintConceptList[1] = 'Program Product Sprint'; $lang->custom->workingList['full'] = 'Application Lifecycle Management'; -$lang->custom->menuTip = "Cliquez pour montrer/cacher le menu. Déplacez pour changer l'ordre d'affichage."; -$lang->custom->saveFail = 'Echec de la sauvegarde !'; -$lang->custom->page = ' Page'; -$lang->custom->changeModeTips = 'Historical deleted data does not participate in the data merging process. After switching the mode, it will not support restoration. Please know.'; +$lang->custom->menuTip = "Cliquez pour montrer/cacher le menu. Déplacez pour changer l'ordre d'affichage."; +$lang->custom->saveFail = 'Echec de la sauvegarde !'; +$lang->custom->page = ' Page'; +$lang->custom->currentModeTips = 'You are currently using %s, you can switch to the %s.'; +$lang->custom->changeModeTips = 'Please double confirm to switch to %s Mode.'; +$lang->custom->selectProgramTips = 'After switching to the Light Mode, in order to ensure the consistency of the data structure, you need to select a program as the default program, and subsequent new product and project data are associated with this default program.'; $lang->custom->changeModeTitleTips['ALM'] = 'Please double confirm to switch to ALM Mode.'; $lang->custom->changeModeTitleTips['light'] = 'Please double confirm to switch to Light Mode.'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 47f924062b..0e091dd63a 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -56,7 +56,8 @@ $lang->custom->dept = '部门'; $lang->custom->code = $lang->code; $lang->custom->setCode = '是否启用代号'; $lang->custom->execution = '执行'; -$lang->custom->defaultProgram = '选择默认项目集'; +$lang->custom->selectDefaultProgram = '请选择一个默认项目集'; +$lang->custom->defaultProgram = '默认项目集'; $lang->custom->unitList['efficiency'] = '工时/'; $lang->custom->unitList['manhour'] = '人时/'; @@ -241,10 +242,12 @@ $lang->custom->sprintConceptList[1] = '项目 产品 冲刺'; $lang->custom->workingList['full'] = '完整研发管理工具'; -$lang->custom->menuTip = '点击显示或隐藏导航条目,拖拽来更改显示顺序。'; -$lang->custom->saveFail = '保存失败!'; -$lang->custom->page = '页面'; -$lang->custom->changeModeTips = '历史删除数据不参与数据归并流程,切换模式后将不支持还原,请知悉'; +$lang->custom->menuTip = '点击显示或隐藏导航条目,拖拽来更改显示顺序。'; +$lang->custom->saveFail = '保存失败!'; +$lang->custom->page = '页面'; +$lang->custom->currentModeTips = '您当前使用的是%s, 您可以切换到%s'; +$lang->custom->changeModeTips = '您确定要切换到%s吗?'; +$lang->custom->selectProgramTips = '切换到轻量管理模式后,为确保数据结构一致,需要选择一个项目集作为默认项目集,后续新增的产品和项目数据都关联在这个默认的项目集下。'; $lang->custom->changeModeTitleTips['ALM'] = '您确定要切换到全生命周期管理模式吗?'; $lang->custom->changeModeTitleTips['light'] = '您确定要切换到轻量管理模式吗?'; diff --git a/module/custom/view/mode.html.php b/module/custom/view/mode.html.php index dfb40c38ae..b4df59ef54 100644 --- a/module/custom/view/mode.html.php +++ b/module/custom/view/mode.html.php @@ -32,17 +32,6 @@ - - - custom->defaultProgram;?> - - - - - custom->switch, 'disabled');?> @@ -51,24 +40,34 @@ -