diff --git a/module/execution/control.php b/module/execution/control.php
index 5068b485e1..4bd148740c 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -1646,6 +1646,26 @@ class execution extends control
$this->view->linkedBranches = $linkedBranches;
}
+ if(!$project->division)
+ {
+ $products = $this->loadModel('product')->getProducts($projectID);
+ $branches = $this->project->getBranchesByProject($projectID);
+ $plans = $this->loadModel('productplan')->getGroupByProduct(array_keys($products), 'skipParent|unexpired');
+
+ $linkedBranches = array();
+ foreach($products as $productID => $product)
+ {
+ foreach($branches[$productID] as $branchID => $branch)
+ {
+ $linkedBranches[$productID][$branchID] = $branchID;
+ $productPlans[$productID][$branchID] = isset($plans[$productID][$branchID]) ? $plans[$productID][$branchID] : array();
+ }
+ }
+
+ $this->view->branches = $branches;
+ $this->view->linkedBranches = $linkedBranches;
+ }
+
if(!empty($_POST))
{
$executionID = $this->execution->create($copyExecutionID);
diff --git a/module/execution/js/common.js b/module/execution/js/common.js
index 1ede120620..499bff5775 100644
--- a/module/execution/js/common.js
+++ b/module/execution/js/common.js
@@ -124,13 +124,15 @@ function loadBranches(product)
{
if($('#productsBox .input-group:last select:first').val() != 0)
{
- var length = $('#productsBox .input-group').size();
- $('#productsBox .row').append('
' + $('#productsBox .col-sm-4:last').html().replace('required', '') + '
');
- if($('#productsBox .input-group:last select').size() >= 2) $('#productsBox .input-group:last select:last').remove();
- $('#productsBox .input-group:last .chosen-container').remove();
- $('#productsBox .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length);
- $('#productsBox .input-group:last .chosen').chosen();
-
+ if(model !== 'waterfall')
+ {
+ var length = $('#productsBox .input-group').size();
+ $('#productsBox .row').append('' + $('#productsBox .col-sm-4:last').html().replace('required', '') + '
');
+ if($('#productsBox .input-group:last select').size() >= 2) $('#productsBox .input-group:last select:last').remove();
+ $('#productsBox .input-group:last .chosen-container').remove();
+ $('#productsBox .input-group:last select:first').attr('name', 'products[' + length + ']').attr('id', 'products' + length);
+ $('#productsBox .input-group:last .chosen').chosen();
+ }
adjustProductBoxMargin();
}
diff --git a/module/execution/model.php b/module/execution/model.php
index d60d43d29a..eefd118e6f 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -339,6 +339,12 @@ class executionModel extends model
$type = 'sprint';
if($project) $type = zget($this->config->execution->modelList, $project->model, 'sprint');
+ if($project->model == 'waterfall')
+ {
+ $this->checkWorkload('create', $_POST['percent'], $project);
+ if(dao::isError()) return false;
+ }
+
$this->config->execution->create->requiredFields .= ',project';
}
@@ -1175,7 +1181,7 @@ class executionModel extends model
}
/* The total workload of the first stage should not exceed 100%. */
- if($type == 'create' or (empty($oldExecution) and $oldExecution->grade == 1))
+ if($type == 'create' or (!empty($oldExecution) and $oldExecution->grade == 1))
{
$oldPercentTotal = $this->dao->select('SUM(t2.percent) as total')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id')
@@ -4616,6 +4622,7 @@ class executionModel extends model
$burns = join(',', $execution->burns);
echo "";
+ if(!empty($execution->division)) echo "| {$execution->productName} | ";
echo "";
if(common::hasPriv('execution', 'batchEdit')) echo "id class='table-nest-icon icon table-nest-toggle'>";
if($this->config->systemMode == 'new')
diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php
index 4da8c28962..25bc3cdfe3 100644
--- a/module/execution/view/create.html.php
+++ b/module/execution/view/create.html.php
@@ -48,6 +48,7 @@
execution->cancelCopy);?>
execution->copyNoExecution);?>
+model);?>
@@ -137,12 +138,14 @@
+ division ? '' : 'disabled';?>
type != 'normal' and isset($branchGroups[$product->id]));?>
id] as $branchID => $branch):?>
- id, "class='form-control chosen' onchange='loadBranches(this)' data-last='" . $product->id . "'");?>
+ id, "class='form-control chosen' $class onchange='loadBranches(this)' data-last='" . $product->id . "'");?>
+ id);?>
id], $branchID, "class='form-control chosen' onchange=\"loadPlans('#products{$i}', this.value)\"");?>
@@ -150,12 +153,14 @@
+ division):?>
+
|
|
diff --git a/module/programplan/control.php b/module/programplan/control.php
index efb2988be9..e0414d396e 100644
--- a/module/programplan/control.php
+++ b/module/programplan/control.php
@@ -110,6 +110,7 @@ class programplan extends control
$this->view->title = $this->lang->programplan->browse;
$this->view->position[] = $this->lang->programplan->browse;
$this->view->projectID = $projectID;
+ $this->view->project = $this->project->getByID($projectID);
$this->view->productID = $this->productID;
$this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID);
$this->view->type = $type;
diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php
index e68b128d0e..f766ce1705 100644
--- a/module/programplan/view/gantt.html.php
+++ b/module/programplan/view/gantt.html.php
@@ -80,6 +80,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
app->getModuleName() == 'programplan'):?>