diff --git a/module/personnel/js/addwhitelist.js b/module/personnel/js/addwhitelist.js index 97954df4d4..eb81369c64 100644 --- a/module/personnel/js/addwhitelist.js +++ b/module/personnel/js/addwhitelist.js @@ -1,7 +1,7 @@ /** * Users by department. * - * @param object obj + * @param object dept * @return void */ function setDeptUsers(dept) @@ -70,7 +70,7 @@ function showItem(val) /** * Hide the clicked item. * - * @param object ulObj + * @param object select * @param string val * @return void */ @@ -98,7 +98,7 @@ function changeUsers() { select = this; - /* Render the item of the value which is selected before the page loads.*/ + /* Render the item of the value which is selected before the page loads. */ $("input[name='realnames[]']").each(function() { hideItem(select, this.value); diff --git a/module/program/control.php b/module/program/control.php index 31e1966319..85b158b59f 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -1719,10 +1719,20 @@ class program extends control $this->loadModel('product'); $project = $this->project->getById($projectID); - - $allProducts = $this->program->getPGMProductPairs($project->parent, 'assign', 'noclosed'); - $linkedProducts = $this->project->getProducts($project->id); - $linkedBranches = array(); + /* If the story of the product which linked the execution under the project, you don't allow to remove the product. */ + $allProducts = $this->program->getPGMProductPairs($project->parent, 'assign', 'noclosed'); + $linkedProducts = $this->project->getProducts($project->id); + $linkedBranches = array(); + $projectStories = $this->dao->select('*')->from(TABLE_PROJECTSTORY)->where('project')->eq($projectID)->fetchAll('story'); + $projectStoryIdList = array_keys($projectStories); + $notRemoveProducts = array(); + foreach($linkedProducts as $productID => $linkedProduct) + { + $productStories = $this->loadModel('story')->getProductStories($productID); + $productStoryIdList = array_keys($productStories); + $storyIntersect = array_intersect($projectStoryIdList, $productStoryIdList); + if(!empty($storyIntersect)) array_push($notRemoveProducts, $productID); + } /* Merge allProducts and linkedProducts for closed product. */ foreach($linkedProducts as $product) @@ -1732,11 +1742,12 @@ class program extends control } /* Assign. */ - $this->view->title = $this->lang->project->manageProducts . $this->lang->colon . $project->name; - $this->view->position[] = $this->lang->project->manageProducts; - $this->view->allProducts = $allProducts; - $this->view->linkedProducts = $linkedProducts; - $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), '', $linkedBranches); + $this->view->title = $this->lang->project->manageProducts . $this->lang->colon . $project->name; + $this->view->position[] = $this->lang->project->manageProducts; + $this->view->allProducts = $allProducts; + $this->view->linkedProducts = $linkedProducts; + $this->view->notRemoveProducts = $notRemoveProducts; + $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), '', $linkedBranches); $this->display(); } diff --git a/module/program/lang/de.php b/module/program/lang/de.php index a64779f08c..4c87e593e1 100644 --- a/module/program/lang/de.php +++ b/module/program/lang/de.php @@ -165,26 +165,27 @@ $lang->program->endList[186] = 'Half yearly'; $lang->program->endList[365] = 'One year'; $lang->program->endList[999] = 'Longtime'; -$lang->program->noPRJ = 'No project.'; -$lang->program->accessDenied = 'Access denied!'; -$lang->program->chooseProgramType = 'Select the project management model'; -$lang->program->nextStep = 'Next step'; -$lang->program->hoursUnit = '%s hours'; -$lang->program->membersUnit = '%s men'; -$lang->program->lastIteration = 'Recent iterations'; -$lang->program->ongoingStage = 'Ongoing stage'; -$lang->program->scrum = 'Scrum'; -$lang->program->waterfall = 'CMMI'; -$lang->program->waterfallTitle = 'CMMI'; -$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; -$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.'; -$lang->program->confirmDelete = "Do you want to delete [%s]?"; -$lang->program->emptyPM = 'No manager'; -$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; -$lang->program->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; -$lang->program->parentBeginEnd = "Parent begin&end date: %s ~ %s"; -$lang->program->childLongTime = "If a child as long-term projects, the parent should be long-term too."; -$lang->program->readjustTime = 'Change the project begin&end date.'; +$lang->program->noPRJ = 'No project.'; +$lang->program->accessDenied = 'Access denied!'; +$lang->program->chooseProgramType = 'Select the project management model'; +$lang->program->nextStep = 'Next step'; +$lang->program->hoursUnit = '%s hours'; +$lang->program->membersUnit = '%s men'; +$lang->program->lastIteration = 'Recent iterations'; +$lang->program->ongoingStage = 'Ongoing stage'; +$lang->program->scrum = 'Scrum'; +$lang->program->waterfall = 'CMMI'; +$lang->program->waterfallTitle = 'CMMI'; +$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; +$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.'; +$lang->program->confirmDelete = "Do you want to delete [%s]?"; +$lang->program->emptyPM = 'No manager'; +$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; +$lang->program->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; +$lang->program->parentBeginEnd = "Parent begin&end date: %s ~ %s"; +$lang->program->childLongTime = "If a child as long-term projects, the parent should be long-term too."; +$lang->program->readjustTime = 'Change the project begin&end date.'; +$lang->program->notAllowRemoveProducts = 'The story of this product is linked with the project. Unlink it before doing any action.'; $lang->program->PRJProgramTitle['0'] = 'Hide'; $lang->program->PRJProgramTitle['base'] = 'Base-level program only'; diff --git a/module/program/lang/en.php b/module/program/lang/en.php index 969f40d7cd..4f558cdf4f 100644 --- a/module/program/lang/en.php +++ b/module/program/lang/en.php @@ -165,26 +165,27 @@ $lang->program->endList[186] = 'Half yearly'; $lang->program->endList[365] = 'One year'; $lang->program->endList[999] = 'Longtime'; -$lang->program->noPRJ = 'No project.'; -$lang->program->accessDenied = 'Access denied!'; -$lang->program->chooseProgramType = 'Select the project management model'; -$lang->program->nextStep = 'Next step'; -$lang->program->hoursUnit = '%s hours'; -$lang->program->membersUnit = '%s men'; -$lang->program->lastIteration = 'Recent iterations'; -$lang->program->ongoingStage = 'Ongoing stage'; -$lang->program->scrum = 'Scrum'; -$lang->program->waterfall = 'CMMI'; -$lang->program->waterfallTitle = 'CMMI'; -$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; -$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.'; -$lang->program->confirmDelete = "Do you want to delete [%s]?"; -$lang->program->emptyPM = 'No manager'; -$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; -$lang->program->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; -$lang->program->parentBeginEnd = "Parent begin&end date: %s ~ %s"; -$lang->program->childLongTime = "If a child as long-term projects, the parent should be long-term too."; -$lang->program->readjustTime = 'Change the project begin&end date.'; +$lang->program->noPRJ = 'No project.'; +$lang->program->accessDenied = 'Access denied!'; +$lang->program->chooseProgramType = 'Select the project management model'; +$lang->program->nextStep = 'Next step'; +$lang->program->hoursUnit = '%s hours'; +$lang->program->membersUnit = '%s men'; +$lang->program->lastIteration = 'Recent iterations'; +$lang->program->ongoingStage = 'Ongoing stage'; +$lang->program->scrum = 'Scrum'; +$lang->program->waterfall = 'CMMI'; +$lang->program->waterfallTitle = 'CMMI'; +$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; +$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.'; +$lang->program->confirmDelete = "Do you want to delete [%s]?"; +$lang->program->emptyPM = 'No manager'; +$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; +$lang->program->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; +$lang->program->parentBeginEnd = "Parent begin&end date: %s ~ %s"; +$lang->program->childLongTime = "If a child as long-term projects, the parent should be long-term too."; +$lang->program->readjustTime = 'Change the project begin&end date.'; +$lang->program->notAllowRemoveProducts = 'The story of this product is linked with the project. Unlink it before doing any action.'; $lang->program->PRJProgramTitle['0'] = 'Hide'; $lang->program->PRJProgramTitle['base'] = 'Base-level program only'; diff --git a/module/program/lang/fr.php b/module/program/lang/fr.php index 1b092b14a2..9f89f7d3c4 100644 --- a/module/program/lang/fr.php +++ b/module/program/lang/fr.php @@ -165,26 +165,27 @@ $lang->program->endList[186] = 'Half yearly'; $lang->program->endList[365] = 'One year'; $lang->program->endList[999] = 'Longtime'; -$lang->program->noPRJ = 'No project.'; -$lang->program->accessDenied = 'Access denied!'; -$lang->program->chooseProgramType = 'Select the project management model'; -$lang->program->nextStep = 'Next step'; -$lang->program->hoursUnit = '%s hours'; -$lang->program->membersUnit = '%s men'; -$lang->program->lastIteration = 'Recent iterations'; -$lang->program->ongoingStage = 'Ongoing stage'; -$lang->program->scrum = 'Scrum'; -$lang->program->waterfall = 'CMMI'; -$lang->program->waterfallTitle = 'CMMI'; -$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; -$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.'; -$lang->program->confirmDelete = "Do you want to delete [%s]?"; -$lang->program->emptyPM = 'No manager'; -$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; -$lang->program->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; -$lang->program->parentBeginEnd = "Parent begin&end date: %s ~ %s"; -$lang->program->childLongTime = "If a child as long-term projects, the parent should be long-term too."; -$lang->program->readjustTime = 'Change the project begin&end date.'; +$lang->program->noPRJ = 'No project.'; +$lang->program->accessDenied = 'Access denied!'; +$lang->program->chooseProgramType = 'Select the project management model'; +$lang->program->nextStep = 'Next step'; +$lang->program->hoursUnit = '%s hours'; +$lang->program->membersUnit = '%s men'; +$lang->program->lastIteration = 'Recent iterations'; +$lang->program->ongoingStage = 'Ongoing stage'; +$lang->program->scrum = 'Scrum'; +$lang->program->waterfall = 'CMMI'; +$lang->program->waterfallTitle = 'CMMI'; +$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; +$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.'; +$lang->program->confirmDelete = "Do you want to delete [%s]?"; +$lang->program->emptyPM = 'No manager'; +$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; +$lang->program->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; +$lang->program->parentBeginEnd = "Parent begin&end date: %s ~ %s"; +$lang->program->childLongTime = "If a child as long-term projects, the parent should be long-term too."; +$lang->program->readjustTime = 'Change the project begin&end date.'; +$lang->program->notAllowRemoveProducts = 'The story of this product is linked with the project. Unlink it before doing any action.'; $lang->program->PRJProgramTitle['0'] = 'Hide'; $lang->program->PRJProgramTitle['base'] = 'Base-level program only'; diff --git a/module/program/lang/vi.php b/module/program/lang/vi.php index 1b092b14a2..9f89f7d3c4 100644 --- a/module/program/lang/vi.php +++ b/module/program/lang/vi.php @@ -165,26 +165,27 @@ $lang->program->endList[186] = 'Half yearly'; $lang->program->endList[365] = 'One year'; $lang->program->endList[999] = 'Longtime'; -$lang->program->noPRJ = 'No project.'; -$lang->program->accessDenied = 'Access denied!'; -$lang->program->chooseProgramType = 'Select the project management model'; -$lang->program->nextStep = 'Next step'; -$lang->program->hoursUnit = '%s hours'; -$lang->program->membersUnit = '%s men'; -$lang->program->lastIteration = 'Recent iterations'; -$lang->program->ongoingStage = 'Ongoing stage'; -$lang->program->scrum = 'Scrum'; -$lang->program->waterfall = 'CMMI'; -$lang->program->waterfallTitle = 'CMMI'; -$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; -$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.'; -$lang->program->confirmDelete = "Do you want to delete [%s]?"; -$lang->program->emptyPM = 'No manager'; -$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; -$lang->program->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; -$lang->program->parentBeginEnd = "Parent begin&end date: %s ~ %s"; -$lang->program->childLongTime = "If a child as long-term projects, the parent should be long-term too."; -$lang->program->readjustTime = 'Change the project begin&end date.'; +$lang->program->noPRJ = 'No project.'; +$lang->program->accessDenied = 'Access denied!'; +$lang->program->chooseProgramType = 'Select the project management model'; +$lang->program->nextStep = 'Next step'; +$lang->program->hoursUnit = '%s hours'; +$lang->program->membersUnit = '%s men'; +$lang->program->lastIteration = 'Recent iterations'; +$lang->program->ongoingStage = 'Ongoing stage'; +$lang->program->scrum = 'Scrum'; +$lang->program->waterfall = 'CMMI'; +$lang->program->waterfallTitle = 'CMMI'; +$lang->program->cannotCreateChild = 'It is not empty, so you cannot add a child. You can add a parent for it, and then create a child.'; +$lang->program->hasChildren = 'It has child programs or projects. You cannot delete it.'; +$lang->program->confirmDelete = "Do you want to delete [%s]?"; +$lang->program->emptyPM = 'No manager'; +$lang->program->cannotChangeToCat = "It is not empty, so you cannot change it to a parent."; +$lang->program->cannotCancelCat = "It has child projects, so you cannot unmark the parent."; +$lang->program->parentBeginEnd = "Parent begin&end date: %s ~ %s"; +$lang->program->childLongTime = "If a child as long-term projects, the parent should be long-term too."; +$lang->program->readjustTime = 'Change the project begin&end date.'; +$lang->program->notAllowRemoveProducts = 'The story of this product is linked with the project. Unlink it before doing any action.'; $lang->program->PRJProgramTitle['0'] = 'Hide'; $lang->program->PRJProgramTitle['base'] = 'Base-level program only'; diff --git a/module/program/lang/zh-cn.php b/module/program/lang/zh-cn.php index 8f2e4a9990..cb74bd1527 100644 --- a/module/program/lang/zh-cn.php +++ b/module/program/lang/zh-cn.php @@ -166,26 +166,27 @@ $lang->program->endList[186] = '半年'; $lang->program->endList[365] = '一年'; $lang->program->endList[999] = '长期'; -$lang->program->noPRJ = '暂时没有项目'; -$lang->program->accessDenied = '您无权访问该项目!'; -$lang->program->chooseProgramType = '选中项目管理模型'; -$lang->program->nextStep = '下一步'; -$lang->program->hoursUnit = "%s $lang->hourCommon"; -$lang->program->membersUnit = '%s人'; -$lang->program->lastIteration = '近期迭代'; -$lang->program->ongoingStage = '进行中的阶段'; -$lang->program->scrum = 'Scrum'; -$lang->program->waterfall = '瀑布'; -$lang->program->waterfallTitle = '瀑布式项目管理'; -$lang->program->cannotCreateChild = '该项目已经有实际的内容,无法直接添加子项目。您可以为当前项目创建一个父项目,然后在新的父项目下面添加子项目。'; -$lang->program->hasChildren = '该项目集有子项目集或项目存在,不能删除。'; -$lang->program->confirmDelete = "您确定要删除吗?"; -$lang->program->emptyPM = '暂无'; -$lang->program->cannotChangeToCat = "该项目已经有实际的内容,无法修改为父项目"; -$lang->program->cannotCancelCat = "该项目下已经有子项目,无法取消父项目标记"; -$lang->program->parentBeginEnd = "父项目起止时间:%s ~ %s"; -$lang->program->childLongTime = "子项目中有长期项目,父项目也应该是长期项目"; -$lang->program->readjustTime = '重新调整项目起止时间'; +$lang->program->noPRJ = '暂时没有项目'; +$lang->program->accessDenied = '您无权访问该项目!'; +$lang->program->chooseProgramType = '选中项目管理模型'; +$lang->program->nextStep = '下一步'; +$lang->program->hoursUnit = "%s $lang->hourCommon"; +$lang->program->membersUnit = '%s人'; +$lang->program->lastIteration = '近期迭代'; +$lang->program->ongoingStage = '进行中的阶段'; +$lang->program->scrum = 'Scrum'; +$lang->program->waterfall = '瀑布'; +$lang->program->waterfallTitle = '瀑布式项目管理'; +$lang->program->cannotCreateChild = '该项目已经有实际的内容,无法直接添加子项目。您可以为当前项目创建一个父项目,然后在新的父项目下面添加子项目。'; +$lang->program->hasChildren = '该项目集有子项目集或项目存在,不能删除。'; +$lang->program->confirmDelete = "您确定要删除吗?"; +$lang->program->emptyPM = '暂无'; +$lang->program->cannotChangeToCat = "该项目已经有实际的内容,无法修改为父项目"; +$lang->program->cannotCancelCat = "该项目下已经有子项目,无法取消父项目标记"; +$lang->program->parentBeginEnd = "父项目起止时间:%s ~ %s"; +$lang->program->childLongTime = "子项目中有长期项目,父项目也应该是长期项目"; +$lang->program->readjustTime = '重新调整项目起止时间'; +$lang->program->notAllowRemoveProducts = '该产品中的需求已与项目进行了关联,请取消关联后再操作。'; $lang->program->PRJProgramTitle['0'] = '不显示'; $lang->program->PRJProgramTitle['base'] = '只显示一级项目集'; diff --git a/module/program/lang/zh-tw.php b/module/program/lang/zh-tw.php index d8a7404ccf..f69d1d7930 100644 --- a/module/program/lang/zh-tw.php +++ b/module/program/lang/zh-tw.php @@ -164,26 +164,27 @@ $lang->program->endList[186] = '半年'; $lang->program->endList[365] = '一年'; $lang->program->endList[999] = '長期'; -$lang->program->noPRJ = '暫時沒有項目'; -$lang->program->accessDenied = '您無權訪問該項目!'; -$lang->program->chooseProgramType = '選中項目管理模型'; -$lang->program->nextStep = '下一步'; -$lang->program->hoursUnit = '%s工時'; -$lang->program->membersUnit = '%s人'; -$lang->program->lastIteration = '近期迭代'; -$lang->program->ongoingStage = '進行中的階段'; -$lang->program->scrum = 'Scrum'; -$lang->program->waterfall = '瀑布'; -$lang->program->waterfallTitle = '瀑布式項目管理'; -$lang->program->cannotCreateChild = '該項目已經有實際的內容,無法直接添加子項目。您可以為當前項目創建一個父項目,然後在新的父項目下面添加子項目。'; -$lang->program->hasChildren = '該項目集有子項目集或項目存在,不能刪除。'; -$lang->program->confirmDelete = "您確定要刪除嗎?"; -$lang->program->emptyPM = '暫無'; -$lang->program->cannotChangeToCat = "該項目已經有實際的內容,無法修改為父項目"; -$lang->program->cannotCancelCat = "該項目下已經有子項目,無法取消父項目標記"; -$lang->program->parentBeginEnd = "父項目起止時間:%s ~ %s"; -$lang->program->childLongTime = "子項目中有長期項目,父項目也應該是長期項目"; -$lang->program->readjustTime = '重新調整項目起止時間'; +$lang->program->noPRJ = '暫時沒有項目'; +$lang->program->accessDenied = '您無權訪問該項目!'; +$lang->program->chooseProgramType = '選中項目管理模型'; +$lang->program->nextStep = '下一步'; +$lang->program->hoursUnit = '%s工時'; +$lang->program->membersUnit = '%s人'; +$lang->program->lastIteration = '近期迭代'; +$lang->program->ongoingStage = '進行中的階段'; +$lang->program->scrum = 'Scrum'; +$lang->program->waterfall = '瀑布'; +$lang->program->waterfallTitle = '瀑布式項目管理'; +$lang->program->cannotCreateChild = '該項目已經有實際的內容,無法直接添加子項目。您可以為當前項目創建一個父項目,然後在新的父項目下面添加子項目。'; +$lang->program->hasChildren = '該項目集有子項目集或項目存在,不能刪除。'; +$lang->program->confirmDelete = "您確定要刪除嗎?"; +$lang->program->emptyPM = '暫無'; +$lang->program->cannotChangeToCat = "該項目已經有實際的內容,無法修改為父項目"; +$lang->program->cannotCancelCat = "該項目下已經有子項目,無法取消父項目標記"; +$lang->program->parentBeginEnd = "父項目起止時間:%s ~ %s"; +$lang->program->childLongTime = "子項目中有長期項目,父項目也應該是長期項目"; +$lang->program->readjustTime = '重新調整項目起止時間'; +$lang->program->notAllowRemoveProducts = '該產品中的需求已與項目進行了關聯,請取消關聯後再操作。'; $lang->program->PRJProgramTitle['0'] = '不顯示'; $lang->program->PRJProgramTitle['base'] = '只顯示一級項目集'; diff --git a/module/program/view/prjmanageproducts.html.php b/module/program/view/prjmanageproducts.html.php index 5aac0cdcb7..da80fd6d95 100644 --- a/module/program/view/prjmanageproducts.html.php +++ b/module/program/view/prjmanageproducts.html.php @@ -24,11 +24,13 @@