From 7c46d9c61db90516ae53427a5220203e234447c7 Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 25 Mar 2022 12:51:59 +0800 Subject: [PATCH 1/3] * Fix bug #17291. --- module/project/js/common.js | 15 +++++++++++++++ module/project/lang/en.php | 1 + module/project/lang/zh-cn.php | 1 + module/project/view/create.html.php | 1 + module/project/view/edit.html.php | 1 + 5 files changed, 19 insertions(+) diff --git a/module/project/js/common.js b/module/project/js/common.js index 48aa7f8f1d..c83b42b3e0 100644 --- a/module/project/js/common.js +++ b/module/project/js/common.js @@ -309,3 +309,18 @@ function setBudgetTipsAndAclList(programID) $('.aclBox').html($('#PGMAcl').html()); } } + +$(document).on('change', "#plansBox select[name^='plans']", function() +{ + var $plan = $(this); + $("#plansBox select[name^='plans']").each(function() + { + if($plan.val() != 0 && $plan.val() == $(this).val() && $plan.closest('div').attr('id') != $(this).closest('div').attr('id')) + { + bootbox.alert(errorSamePlans); + $plan.val(0); + $plan.trigger("chosen:updated"); + return false; + } + }); +}); diff --git a/module/project/lang/en.php b/module/project/lang/en.php index 74d15684ad..6b7dc30d31 100644 --- a/module/project/lang/en.php +++ b/module/project/lang/en.php @@ -44,6 +44,7 @@ $lang->project->manageProducts = 'Manage Products'; $lang->project->copyTitle = 'Please select an project to copy'; $lang->project->errorSameProducts = 'Project cannot be associated with multiple identical products.'; $lang->project->errorSameBranches = 'Project cannot be associated with multiple identical branches.'; +$lang->project->errorSamePlans = 'Project cannot be associated with multiple identical plans.'; $lang->project->errorNoProducts = 'At least one product is associated'; $lang->project->copyNoProject = 'There are no items available to copy.'; $lang->project->searchByName = 'Enter the project name to retrieve'; diff --git a/module/project/lang/zh-cn.php b/module/project/lang/zh-cn.php index b73ddad11a..b4188b6d1a 100644 --- a/module/project/lang/zh-cn.php +++ b/module/project/lang/zh-cn.php @@ -44,6 +44,7 @@ $lang->project->manageProducts = '关联产品'; $lang->project->copyTitle = '请选择要复制的项目'; $lang->project->errorSameProducts = '项目不能关联多个相同的产品。'; $lang->project->errorSameBranches = '项目不能关联多个相同的分支。'; +$lang->project->errorSamePlans = '项目不能关联多个相同的计划。'; $lang->project->errorNoProducts = '最少关联一个产品'; $lang->project->copyNoProject = '没有可用的项目来复制'; $lang->project->searchByName = '输入项目名称进行检索'; diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index 2cb1c3cc66..e9a9753a2d 100644 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -19,6 +19,7 @@ execution->weekend);?> project->errorSameProducts);?> project->errorSameBranches);?> +project->errorSamePlans);?> project->longTime);?> diff --git a/module/project/view/edit.html.php b/module/project/view/edit.html.php index 460a2b7bef..a87819b88c 100644 --- a/module/project/view/edit.html.php +++ b/module/project/view/edit.html.php @@ -16,6 +16,7 @@ execution->weekend);?> project->errorSameProducts);?> project->errorSameBranches);?> +project->errorSamePlans);?> parent);?> id);?> project->longTime);?> From eca3d6a43fa041eab0d190ed74b92678e520609e Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 25 Mar 2022 13:48:06 +0800 Subject: [PATCH 2/3] * Fix bug #17965. --- module/projectrelease/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php index 0d729c5199..e8d92d0fdc 100644 --- a/module/projectrelease/control.php +++ b/module/projectrelease/control.php @@ -121,7 +121,7 @@ class projectrelease extends control $this->commonAction($projectID); /* Get the builds that can select. */ - $builds = $this->build->getBuildPairs(array_keys($this->products), 0, 'notrunk,withbranch', $projectID, 'project'); + $builds = $this->build->getBuildPairs(array_keys($this->products), 'all', 'notrunk,withbranch', $projectID, 'project'); $releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID); foreach($releasedBuilds as $build) unset($builds[$build]); unset($builds['trunk']); From d3e63841faf30af2d23855b5b27a7311fb6d63db Mon Sep 17 00:00:00 2001 From: tianshujie Date: Fri, 25 Mar 2022 15:00:30 +0800 Subject: [PATCH 3/3] * Fix bug #20559. --- module/personnel/model.php | 4 ++-- module/project/css/create.css | 1 + module/project/view/create.html.php | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module/personnel/model.php b/module/personnel/model.php index f6746fc6a0..80da5f7ff5 100644 --- a/module/personnel/model.php +++ b/module/personnel/model.php @@ -38,12 +38,12 @@ class personnelModel extends model } /* Determine who can be accessed based on access control. */ - $program = $this->loadModel('program')->getByID($programID); + $program = $this->loadModel('program')->getByID($programID); $personnelList = array(); $personnelList = $this->dao->select('t2.id,t2.dept,t2.account,t2.role,t2.realname,t2.gender')->from(TABLE_USERVIEW)->alias('t1') ->leftJoin(TABLE_USER)->alias('t2')->on('t1.account=t2.account') ->where('t2.deleted')->eq(0) - ->beginIF($program->acl != 'open')->andWhere("CONCAT(',', t1.programs, ',')")->like("%,$programID,%") + ->beginIF($program->acl != 'open')->andWhere("CONCAT(',', t1.programs, ',')")->like("%,$programID,%")->fi() ->beginIF($deptID > 0)->andWhere('t2.dept')->eq($deptID)->fi() ->beginIF($browseType == 'bysearch')->andWhere($accessibleQuery)->fi() ->fetchAll('id'); diff --git a/module/project/css/create.css b/module/project/css/create.css index 29f7111b19..92825f4fa9 100644 --- a/module/project/css/create.css +++ b/module/project/css/create.css @@ -12,3 +12,4 @@ #budget {border-right: 0px;} #budgetUnit {border-left: 0px;} #projectName {display: inline-block; width: 32%;} +#productsBox a {border-radius: 2px !important;} diff --git a/module/project/view/create.html.php b/module/project/view/create.html.php index e9a9753a2d..bae762bbb3 100644 --- a/module/project/view/create.html.php +++ b/module/project/view/create.html.php @@ -119,7 +119,9 @@
' style="padding-right: 6px;">
+ project->addProduct, '', "onchange=addNewProduct(this);");?> +