From 756576f2e4b8cc7affd48bd1cb627004b6b71ed0 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 14 Oct 2021 09:00:36 +0800 Subject: [PATCH 1/9] * Finish task #43205. --- module/personnel/model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module/personnel/model.php b/module/personnel/model.php index 1959bcb97b..b653bc762f 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -677,10 +677,10 @@ class personnelModel extends model */ public function deleteProductWhitelist($productID, $account = '') { - $product = $this->dao->select('id,whitelist')->from(TABLE_PRODUCT)->where('id')->eq($productID)->fetch('whitelist'); + $whitelist = $this->dao->select('id,whitelist')->from(TABLE_PRODUCT)->where('id')->eq($productID)->fetch('whitelist'); if(empty($product)) return false; - $newWhitelist = str_replace(',' . $account, '', $product->whitelist); + $newWhitelist = str_replace(',' . $account, '', $whitelist); $this->dao->update(TABLE_PRODUCT)->set('whitelist')->eq($newWhitelist)->where('id')->eq($productID)->exec(); $this->dao->delete()->from(TABLE_ACL) ->where('objectID')->eq($productID) From 02717dbe648e9bc839ab02720658e422e4ef5df1 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 14 Oct 2021 09:19:56 +0800 Subject: [PATCH 2/9] * Fix bug#15512. --- module/install/js/step4.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/module/install/js/step4.js b/module/install/js/step4.js index 864d84cd63..8ce4d661c9 100644 --- a/module/install/js/step4.js +++ b/module/install/js/step4.js @@ -8,3 +8,16 @@ function showVideo() { $('video').removeClass('hidden'); } + +$(function() +{ + $('#modeclassic').click(function() + { + $('#selectedModeTips').show(); + }); + + $('#modenew').click(function() + { + $('#selectedModeTips').hide(); + }); +}) From 04fce5278bf5b116af9232a6d52dc433d2408d08 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 14 Oct 2021 09:37:41 +0800 Subject: [PATCH 3/9] * Fix bug #15500. --- module/action/lang/de.php | 2 +- module/action/lang/en.php | 2 +- module/action/lang/fr.php | 4 ++-- module/action/lang/vi.php | 2 +- module/action/lang/zh-cn.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/action/lang/de.php b/module/action/lang/de.php index d5f35b9bdb..7d8d8eaca2 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -12,7 +12,7 @@ $lang->action->common = 'Log'; $lang->action->product = $lang->productCommon; $lang->action->project = 'Project'; -$lang->action->execution = $lang->executionCommon; +$lang->action->execution = $lang->execution->common; $lang->action->objectType = 'Object Type'; $lang->action->objectID = 'ID'; $lang->action->objectName = 'Objekt Name'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index a1a1e823dc..a74203313e 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -15,7 +15,7 @@ $lang->action->common = 'Log'; $lang->action->id = 'ID'; $lang->action->product = $lang->productCommon; $lang->action->project = 'Project'; -$lang->action->execution = $lang->executionCommon; +$lang->action->execution = $lang->execution->common; $lang->action->objectType = 'Object Type'; $lang->action->objectID = 'ID'; $lang->action->objectName = 'Object Name'; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 8cfb507284..0754fd1130 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -11,8 +11,8 @@ */ $lang->action->common = 'Log'; $lang->action->product = $lang->productCommon; -$lang->action->project = $lang->executionCommon; -$lang->action->execution = $lang->executionCommon; +$lang->action->project = 'Project'; +$lang->action->execution = $lang->execution->common; $lang->action->objectType = "Type d'objet"; $lang->action->objectID = 'ID'; $lang->action->objectName = "Nom de l'object"; diff --git a/module/action/lang/vi.php b/module/action/lang/vi.php index 4f3a7ffef2..67a7ae7567 100644 --- a/module/action/lang/vi.php +++ b/module/action/lang/vi.php @@ -12,7 +12,7 @@ $lang->action->common = 'Nhật ký'; $lang->action->product = $lang->productCommon; $lang->action->project = 'Project'; -$lang->action->execution = $lang->executionCommon; +$lang->action->execution = $lang->execution->common; $lang->action->objectType = 'Loại đối tượng'; $lang->action->objectID = 'ID'; $lang->action->objectName = 'Tên đối tượng'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index eada01b40c..2f1e82893b 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -15,7 +15,7 @@ $lang->action->common = '系统日志'; $lang->action->id = '编号'; $lang->action->product = $lang->productCommon; $lang->action->project = '项目'; -$lang->action->execution = $lang->executionCommon; +$lang->action->execution = $lang->execution->common; $lang->action->objectType = '对象类型'; $lang->action->objectID = '对象ID'; $lang->action->objectName = '对象名称'; From 01e57a1c570e5263852a074e7262fa89a26d0312 Mon Sep 17 00:00:00 2001 From: liyuchun Date: Thu, 14 Oct 2021 10:05:53 +0800 Subject: [PATCH 4/9] * Fix bug #15514. --- module/personnel/model.php | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/module/personnel/model.php b/module/personnel/model.php index b653bc762f..ae4372e890 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -677,17 +677,26 @@ class personnelModel extends model */ public function deleteProductWhitelist($productID, $account = '') { - $whitelist = $this->dao->select('id,whitelist')->from(TABLE_PRODUCT)->where('id')->eq($productID)->fetch('whitelist'); + $product = $this->dao->select('id,whitelist')->from(TABLE_PRODUCT)->where('id')->eq($productID)->fetch(); if(empty($product)) return false; - $newWhitelist = str_replace(',' . $account, '', $whitelist); + $newWhitelist = str_replace(',' . $account, '', $product->whitelist); $this->dao->update(TABLE_PRODUCT)->set('whitelist')->eq($newWhitelist)->where('id')->eq($productID)->exec(); - $this->dao->delete()->from(TABLE_ACL) + $result = $this->dao->delete()->from(TABLE_ACL) ->where('objectID')->eq($productID) ->andWhere('account')->eq($account) ->andWhere('objectType')->eq('product') ->andWhere('source')->eq('sync') ->exec(); + + /* Update user view when delete success. */ + if($result) + { + $viewProducts = $this->dao->select('products')->from(TABLE_USERVIEW)->where('account')->eq($account)->fetch('products'); + $newViewProducts = trim(str_replace(",$productID,", '', ",$viewProducts,"), ','); + $this->dao->update(TABLE_USERVIEW)->set('products')->eq($newViewProducts)->where('account')->eq($account)->exec(); + } + } /** @@ -711,12 +720,20 @@ class personnelModel extends model { $newWhitelist = str_replace(',' . $account, '', $program->whitelist); $this->dao->update(TABLE_PROGRAM)->set('whitelist')->eq($newWhitelist)->where('id')->eq($programID)->exec(); - $this->dao->delete()->from(TABLE_ACL) + $result = $this->dao->delete()->from(TABLE_ACL) ->where('objectID')->eq($programID) ->andWhere('account')->eq($account) ->andWhere('objectType')->eq('program') ->andWhere('source')->eq('sync') ->exec(); + + /* Update user view when delete success. */ + if($result) + { + $viewPrograms = $this->dao->select('programs')->from(TABLE_USERVIEW)->where('account')->eq($account)->fetch('programs'); + $newViewPrograms = trim(str_replace(",$programID,", '', ",$viewPrograms,"), ','); + $this->dao->update(TABLE_USERVIEW)->set('programs')->eq($newViewPrograms)->where('account')->eq($account)->exec(); + } } $this->loadModel('user')->updateUserView($programID, 'program', array($account)); } @@ -734,7 +751,7 @@ class personnelModel extends model $project = $this->dao->select('id,project,whitelist')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch(); if(empty($project)) return false; - $projectID = $project->project; + $projectID = $project->project ? $project->project : $objectID; $sprints = $this->dao->select('id')->from(TABLE_PROJECT)->where('project')->eq($projectID)->andWhere('deleted')->eq('0')->fetchPairs('id'); $whitelist = $this->dao->select('*')->from(TABLE_ACL)->where('objectID')->in($sprints)->andWhere('account')->eq($account)->andWhere('objectType')->eq('sprint')->fetch(); @@ -743,12 +760,20 @@ class personnelModel extends model { $newWhitelist = str_replace(',' . $account, '', $project->whitelist); $this->dao->update(TABLE_PROJECT)->set('whitelist')->eq($newWhitelist)->where('id')->eq($projectID)->exec(); - $this->dao->delete()->from(TABLE_ACL) + $result = $this->dao->delete()->from(TABLE_ACL) ->where('objectID')->eq($projectID) ->andWhere('account')->eq($account) ->andWhere('objectType')->eq('project') ->andWhere('source')->eq('sync') ->exec(); + + /* Update user view when delete success. */ + if($result) + { + $viewProjects = $this->dao->select('projects')->from(TABLE_USERVIEW)->where('account')->eq($account)->fetch('projects'); + $newViewProjects = trim(str_replace(",$projectID,", '', ",$viewProjects,"), ','); + $this->dao->update(TABLE_USERVIEW)->set('projects')->eq($newViewProjects)->where('account')->eq($account)->exec(); + } } $this->loadModel('user')->updateUserView($projectID, 'project', array($account)); } From b811e3c80d5916ef4fc5a7ce24bdd5263b0ea7c0 Mon Sep 17 00:00:00 2001 From: xieqiyu Date: Thu, 14 Oct 2021 10:05:42 +0800 Subject: [PATCH 5/9] * Fix bug#15513. --- module/product/view/create.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index f728b63cc5..179d5646a2 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -29,7 +29,7 @@ product->line;?> - + systemMode == 'classic' or $programID):?>
From 264a20d583d8d83f599d0af3a29f2efeaac1e71d Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 14 Oct 2021 10:47:07 +0800 Subject: [PATCH 6/9] * Fix bug #15516. --- module/upgrade/control.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/module/upgrade/control.php b/module/upgrade/control.php index 57ca5c038b..46e71911f4 100644 --- a/module/upgrade/control.php +++ b/module/upgrade/control.php @@ -350,17 +350,22 @@ class upgrade extends control if(dao::isError()) die(js::error(dao::getError())); /* Process merged independent projects. */ + $productIdList = array(); + if($type == 'noProject') + { + $productIdList = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->in($linkedSprints)->fetchPairs(); + } if($_POST['projectType'] == 'execution') { /* Use historical projects as execution upgrades. */ - $this->upgrade->processMergedData($programID, $projectList, $lineID, array(), $linkedSprints); + $this->upgrade->processMergedData($programID, $projectList, $lineID, $productIdList, $linkedSprints); } else { /* Use historical projects as project upgrades. */ foreach($linkedSprints as $sprint) { - $this->upgrade->processMergedData($programID, $projectList[$sprint], $lineID, array(), array($sprint => $sprint)); + $this->upgrade->processMergedData($programID, $projectList[$sprint], $lineID, $productIdList, array($sprint => $sprint)); } } } From 993a02eb781f08a481b4369cc0bf0f65232530ec Mon Sep 17 00:00:00 2001 From: tianshujie Date: Thu, 14 Oct 2021 11:31:38 +0800 Subject: [PATCH 7/9] * Fix bug #15521. --- module/upgrade/js/mergeprogram.js | 5 ++++- module/upgrade/view/createprogram.html.php | 3 +-- module/upgrade/view/mergeprogram.html.php | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/module/upgrade/js/mergeprogram.js b/module/upgrade/js/mergeprogram.js index f84d05390b..31d28afec3 100644 --- a/module/upgrade/js/mergeprogram.js +++ b/module/upgrade/js/mergeprogram.js @@ -522,6 +522,7 @@ $(function() setProgramBegin(programBegin); setProgramEnd(programEnd); setProjectPM(); + toggleProgram(); hiddenProject(); }) @@ -638,7 +639,7 @@ function getLineByProgram() function toggleProgram(obj) { var $obj = $(obj); - if($obj.length == 0) return false; + if($obj.length == 0 && type != 'noProject') return false; var $programs = $obj.closest('table').find('#programs'); if($obj.prop('checked')) @@ -647,6 +648,7 @@ function toggleProgram(obj) $('form .pgm-exist').addClass('hidden'); $programs.attr('disabled', 'disabled'); $('.programStatus').show(); + $('#programStatus').removeAttr('disabled').trigger("chosen:updated"); $('form #newProject0').prop('checked', true); $('form #newLine0').prop('checked', true); @@ -658,6 +660,7 @@ function toggleProgram(obj) $('form .pgm-exist').removeClass('hidden'); $('form .pgm-no-exist').addClass('hidden'); $('.programStatus').hide(); + $('#programStatus').attr('disabled', 'disabled'); if(!$('#newProgram0').prop('disabled')) { diff --git a/module/upgrade/view/createprogram.html.php b/module/upgrade/view/createprogram.html.php index 3ece464deb..37fa143e4b 100644 --- a/module/upgrade/view/createprogram.html.php +++ b/module/upgrade/view/createprogram.html.php @@ -13,8 +13,7 @@
- - + diff --git a/module/upgrade/view/mergeprogram.html.php b/module/upgrade/view/mergeprogram.html.php index b89dc5ab7c..3104e3d5b6 100644 --- a/module/upgrade/view/mergeprogram.html.php +++ b/module/upgrade/view/mergeprogram.html.php @@ -12,6 +12,7 @@ ?> execution->weekend);?> +