diff --git a/module/execution/control.php b/module/execution/control.php index 4b6cddece1..4bc1ba9ad3 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1733,7 +1733,7 @@ class execution extends control $this->view->linkedBranches = $linkedBranches; } - if(!empty($project->hasProduct)) + if(empty($project->hasProduct)) { $shadowProduct = $this->loadModel('product')->getShadowProductByProject($project->id); $productPlan = $this->loadModel('productplan')->getPairs($shadowProduct->id, '0,0', 'noclosed,unexpired', true); @@ -1744,7 +1744,7 @@ class execution extends control if(isset($_POST['attribute']) and in_array($_POST['attribute'], array('request', 'design', 'review'))) unset($_POST['plans']); /* No product execution link plans. */ - if(!empty($project->hasProduct) and !empty($_POST['plans'])) + if(empty($project->hasProduct) and !empty($_POST['plans'])) { $plansItem = array(); foreach($_POST['plans'] as $planItem) diff --git a/module/project/js/create.js b/module/project/js/create.js index 502b08126f..f140841f41 100644 --- a/module/project/js/create.js +++ b/module/project/js/create.js @@ -146,7 +146,9 @@ function setParentProgram(parentProgram) selectedParent = parentProgram != 0 ? data.selectedProgramPath[1] : 0; lastSelectedParent = lastSelectedID != 0 ? data.objectPath[1] : 0; - if(selectedParent != lastSelectedParent) + var hasProduct = $('[name=hasProduct]:checked').val(); + + if((selectedParent != lastSelectedParent) && hasProduct == 1) { $('#budget').val('');