diff --git a/module/execution/control.php b/module/execution/control.php index de1faad15c..9881cf4be7 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1930,6 +1930,7 @@ class execution extends control $this->app->loadLang('programplan'); $browseExecutionLink = $this->createLink('execution', 'browse', "executionID=$executionID"); $execution = $this->execution->getById($executionID); + $project = $this->project->getById($execution->project); $branches = $this->project->getBranchesByProject($executionID); $linkedProductIdList = empty($branches) ? '' : array_keys($branches); @@ -2103,6 +2104,7 @@ class execution extends control $this->view->position = $position; $this->view->executions = $executions; $this->view->execution = $execution; + $this->view->project = $project; $this->view->poUsers = $poUsers; $this->view->pmUsers = $pmUsers; $this->view->qdUsers = $qdUsers; diff --git a/module/execution/js/common.js b/module/execution/js/common.js index 92ca8e7134..db31593818 100644 --- a/module/execution/js/common.js +++ b/module/execution/js/common.js @@ -285,3 +285,32 @@ function setCardCount(heightType) { heightType != 'custom' ? $('#cardBox').addClass('hidden') : $('#cardBox').removeClass('hidden'); } + +/** + * Hide plan box by stage's attribute. + * + * @param string attribute + * @access public + * @return void + */ +function hidePlanBox(attribute) +{ + if(attribute == 'request' || attribute == 'review') + { + $('.productsBox .planBox').addClass('hide'); + $('.productsBox .planBox select').attr('disabled', 'disabled'); + $('#productTitle').text(manageProductsLang); + + $('#plansBox').closest('tr').addClass('hide'); + $('#plansBox').attr('disabled', 'disabled'); + } + else + { + $('.productsBox .planBox').removeClass('hide'); + $('.productsBox .planBox select').attr('disabled', ''); + $('#productTitle').text(manageProductPlanLang); + + $('#plansBox').closest('tr').removeClass('hide'); + $('#plansBox').attr('disabled', ''); + } +} diff --git a/module/execution/js/create.js b/module/execution/js/create.js index 56ac637410..cb0c0e1091 100644 --- a/module/execution/js/create.js +++ b/module/execution/js/create.js @@ -82,14 +82,7 @@ $(function() $('#attribute').change(function() { var attribute = $(this).val(); - if(attribute == 'request' || attribute == 'design' || attribute == 'review') - { - $('#plansBox').closest('tr').addClass('hide'); - } - else - { - $('#plansBox').closest('tr').removeClass('hide'); - } + hidePlanBox(attribute); }) $('#attribute').change(); diff --git a/module/execution/js/edit.js b/module/execution/js/edit.js index 58f5d31712..05d613bebd 100644 --- a/module/execution/js/edit.js +++ b/module/execution/js/edit.js @@ -114,6 +114,17 @@ $(function() } $('[data-toggle="popover"]').popover(); + + if(isStage) + { + $('#attribute').change(function() + { + var attribute = $(this).val(); + hidePlanBox(attribute); + }) + + $('#attribute').change(); + } }) var lastProjectID = $("#project").val(); diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 7f3cc53419..429ecf2cb4 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -46,6 +46,8 @@ execution->cancelCopy);?> execution->copyNoExecution);?> model) ? $project->model : '');?> +project->manageProducts);?> +project->manageProductPlan);?>
@@ -148,7 +150,7 @@ project->manageProductPlan;?>
-
+
type != 'normal' and isset($branchGroups[$product->id]);?> @@ -168,7 +170,7 @@
-
+
> product->plan;?> id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), isset($product->plans) ? $product->plans : '', "class='form-control chosen' multiple");?> @@ -185,7 +187,7 @@ - hasProduct)):?> + hasProduct) and strpos($project->model, 'waterfall') === false):?> execution->linkPlan;?> @@ -200,7 +202,7 @@ project->manageProductPlan;?>
-
+
@@ -216,7 +218,7 @@
-
+
product->plan;?> diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index 3eb89bfe7e..4a01b82a84 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -14,6 +14,9 @@ +type == 'stage');?> +project->manageProducts);?> +project->manageProductPlan);?>
@@ -161,7 +164,7 @@ project->manageProductPlan;?>
-
+
type != 'normal' and isset($branchGroups[$product->id]);?> @@ -181,7 +184,7 @@
-
+
> product->plan;?> id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), $product->plans, "class='form-control chosen' multiple");?> @@ -213,7 +216,7 @@ project->manageProductPlan;?>
-
+
@@ -229,7 +232,7 @@
-
+
product->plan;?> @@ -243,7 +246,7 @@ - type == 'stage' and !in_array($execution->attribute, array('request', 'design', 'review'))) or $execution->type != 'stage'): ?> + hasProduct)):?> @@ -252,7 +255,7 @@ project->manageProductPlan;?>
-
+
type != 'normal' and isset($branchGroups[$product->id]);?> @@ -272,7 +275,7 @@
-
+
> product->plan;?> id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), isset($product->plans) ? $product->plans : '', "class='form-control chosen' multiple");?> @@ -283,10 +286,10 @@ - + - + execution->team;?>