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 = '对象名称'; diff --git a/module/action/model.php b/module/action/model.php index 7b99908cdf..61cf3e0d9b 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -864,8 +864,8 @@ class actionModel extends model } if($this->session->actionQuery == false) $this->session->set('actionQuery', ' 1 = 1'); - $allProducts = "`product` = 'all'"; - $allProjects = "`project` = 'all'"; + $allProducts = "`product` = 'all'"; + $allProjects = "`project` = 'all'"; $allExecutions = "`execution` = 'all'"; $actionQuery = $this->session->actionQuery; diff --git a/module/execution/lang/en.php b/module/execution/lang/en.php index 020ad9641b..916ae5454e 100644 --- a/module/execution/lang/en.php +++ b/module/execution/lang/en.php @@ -10,7 +10,7 @@ * @link http://www.zentao.net */ /* Fields. */ -$lang->execution->allExecutions = 'All ' . $lang->executionCommon . 's'; +$lang->execution->allExecutions = 'All ' . $lang->execution->common . 's'; $lang->execution->allExecutionAB = 'Execution List'; $lang->execution->id = $lang->executionCommon . ' ID'; $lang->execution->type = $lang->executionCommon . 'Type'; diff --git a/module/execution/lang/fr.php b/module/execution/lang/fr.php index a610f60e2e..bb698b546b 100644 --- a/module/execution/lang/fr.php +++ b/module/execution/lang/fr.php @@ -10,7 +10,7 @@ * @link https://www.zentao.pm */ /* Fields. */ -$lang->execution->allExecutions = 'Tous les ' . $lang->executionCommon . 's'; +$lang->execution->allExecutions = 'Tous les ' . $lang->execution->common . 's'; $lang->execution->allExecutionAB = 'Execution List'; $lang->execution->id = $lang->executionCommon . ' ID'; $lang->execution->type = $lang->executionCommon . 'Type'; diff --git a/module/execution/lang/vi.php b/module/execution/lang/vi.php index 6459ca8a02..c6bfcd7051 100644 --- a/module/execution/lang/vi.php +++ b/module/execution/lang/vi.php @@ -10,7 +10,7 @@ * @link http://www.zentao.net */ /* Fields. */ -$lang->execution->allExecutions = 'Tất cả ' . $lang->executionCommon; +$lang->execution->allExecutions = 'Tất cả ' . $lang->execution->common; $lang->execution->allExecutionAB = 'Execution List'; $lang->execution->id = 'ID '.$lang->executionCommon; $lang->execution->type = 'Loại'; diff --git a/module/execution/lang/zh-cn.php b/module/execution/lang/zh-cn.php index dd084192c6..ce76413e38 100644 --- a/module/execution/lang/zh-cn.php +++ b/module/execution/lang/zh-cn.php @@ -10,7 +10,7 @@ * @link http://www.zentao.net */ /* 字段列表。*/ -$lang->execution->allExecutions = '所有' . $lang->executionCommon; +$lang->execution->allExecutions = '所有' . $lang->execution->common; $lang->execution->allExecutionAB = "{$lang->execution->common}列表"; $lang->execution->id = $lang->executionCommon . '编号'; $lang->execution->type = $lang->executionCommon . '类型'; 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(); + }); +}) diff --git a/module/personnel/model.php b/module/personnel/model.php index 1959bcb97b..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 = '') { - $product = $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, '', $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)); } 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):?>
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)); } } } diff --git a/module/upgrade/js/mergeprogram.js b/module/upgrade/js/mergeprogram.js index f84d05390b..aef89fa23c 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,8 @@ function toggleProgram(obj) $('form .pgm-exist').addClass('hidden'); $programs.attr('disabled', 'disabled'); $('.programStatus').show(); + $('#programStatus').val('wait'); + $('#programStatus').removeAttr('disabled').trigger("chosen:updated"); $('form #newProject0').prop('checked', true); $('form #newLine0').prop('checked', true); @@ -658,6 +661,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);?> +