diff --git a/db/update18.4.alpha1.sql b/db/update18.4.alpha1.sql new file mode 100644 index 0000000000..e3cec0f886 --- /dev/null +++ b/db/update18.4.alpha1.sql @@ -0,0 +1,4 @@ +ALTER TABLE `zt_project` ADD `stageBy` enum('project', 'product') NOT NULL DEFAULT 'product' AFTER `division`; +UPDATE `zt_project` SET `stageBy` = 'project' WHERE `division` = '0'; +UPDATE `zt_project` SET `stageBy` = 'product' WHERE `division` = '1'; +ALTER TABLE `zt_project` DROP `division`; diff --git a/db/zentao.sql b/db/zentao.sql index 06b2dea9c9..1f1fca3af5 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1354,7 +1354,7 @@ CREATE TABLE IF NOT EXISTS `zt_project` ( `whitelist` text NULL, `order` mediumint(8) unsigned NOT NULL DEFAULT '0', `vision` varchar(10) NOT NULL DEFAULT 'rnd', - `division` enum('0','1') NOT NULL DEFAULT '1', + `stageBy` enum('project','product') NOT NULL DEFAULT 'product', `displayCards` smallint(6) NOT NULL default '0', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `multiple` enum('0','1') NOT NULL DEFAULT '1', diff --git a/module/execution/control.php b/module/execution/control.php index e6dc952c14..ca6f804aee 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -1770,7 +1770,7 @@ class execution extends control $this->view->linkedBranches = $linkedBranches; } - if(!empty($project) and !$project->division) + if(!empty($project) and $project->stageBy == 'project') { $products = $this->loadModel('product')->getProducts($projectID); $branches = $this->project->getBranchesByProject($projectID); @@ -1916,7 +1916,7 @@ class execution extends control $this->view->from = $this->app->tab; $this->view->isStage = (isset($project->model) and ($project->model == 'waterfall' or $project->model == 'waterfallplus')) ? true : false; $this->view->project = $project; - $this->view->division = !empty($project) ? $project->division : 1; + $this->view->stageBy = $project->stageBy; $this->view->type = $type; $this->display(); } diff --git a/module/execution/model.php b/module/execution/model.php index 44bf967d40..f1aa8f66c7 100755 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -2052,7 +2052,7 @@ class executionModel extends model if(isset($project->model) and in_array($project->model, array('waterfall', 'waterfallplus'))) { $executionProducts = array(); - if($project->hasProduct and $project->division) + if($project->hasProduct and ($project->stageBy == 'product')) { $executionList = array(); $executionProducts = $this->dao->select('t1.project, t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1') @@ -5267,7 +5267,7 @@ class executionModel extends model } } } - if(!empty($execution->division) and $execution->hasProduct) echo "{$execution->productName}"; + if(($execution->stageBy == 'project') and $execution->hasProduct) echo "{$execution->productName}"; echo "" . zget($this->lang->project->statusList, $execution->status) . ''; echo '' . zget($users, $execution->PM) . ''; echo helper::isZeroDate($execution->begin) ? '' : '' . $execution->begin . ''; @@ -5322,7 +5322,7 @@ class executionModel extends model { foreach($execution->children as $child) { - $child->division = $execution->division; + $child->stageBy = $execution->stageBy; $this->printNestedList($child, true, $users, $productID); } } diff --git a/module/execution/test/model/data/sql/project.sql b/module/execution/test/model/data/sql/project.sql index bb14bbcb80..4a40c242e7 100644 --- a/module/execution/test/model/data/sql/project.sql +++ b/module/execution/test/model/data/sql/project.sql @@ -73,7 +73,7 @@ CREATE TABLE `zt_project` ( `whitelist` text NOT NULL, `order` mediumint(8) unsigned NOT NULL, `vision` varchar(10) NOT NULL DEFAULT 'rnd', - `division` enum('0','1') NOT NULL DEFAULT '1', + `stageBy` enum('product','project') NOT NULL DEFAULT 'product', `displayCards` smallint(6) NOT NULL DEFAULT 0, `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `multiple` enum('0','1') NOT NULL DEFAULT '1', diff --git a/module/execution/view/create.html.php b/module/execution/view/create.html.php index 2781a20e1a..a3876d7efb 100644 --- a/module/execution/view/create.html.php +++ b/module/execution/view/create.html.php @@ -157,9 +157,9 @@ type != 'normal' and isset($branchGroups[$product->id]);?>
'> productCommon;?> - division) ? "disabled='disabled'" : '';?> + stageBy == 'project') ? "disabled='disabled'" : '';?> id, "class='form-control chosen' $disabled onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='" . $product->type . "'");?> - division) echo html::hidden("products[$i]", $product->id);?> + stageBy == 'project') echo html::hidden("products[$i]", $product->id);?>
'> @@ -177,7 +177,7 @@ product->plan;?> id)) echo html::select("plans[$product->id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), isset($product->plans) ? $product->plans : '', "class='form-control chosen' multiple");?> id) echo html::select("plans[$product->id][]", !empty($productPlan) ? $productPlan : array(), isset($productPlan[$plan->id]) ? $plan->id : '', "class='form-control chosen' multiple");?> - division)):?> + stageBy == 'project')):?>
> @@ -225,7 +225,7 @@
product->plan;?> - division)):?> + stageBy == 'product')):?>
diff --git a/module/execution/view/edit.html.php b/module/execution/view/edit.html.php index e3b878b4ef..d420db2c7e 100644 --- a/module/execution/view/edit.html.php +++ b/module/execution/view/edit.html.php @@ -169,9 +169,9 @@ type != 'normal' and isset($branchGroups[$product->id]);?>
'> productCommon;?> - type == 'stage' and !$execution->division) ? "disabled='disabled'" : '';?> + type == 'stage' and $execution->stageBy == 'project') ? "disabled='disabled'" : '';?> id, "class='form-control chosen' $disabled onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='" . $product->type . "'");?> - type == 'stage' and !$execution->division) echo html::hidden("products[$i]", $product->id);?> + type == 'stage' and $execution->stageBy == 'project') echo html::hidden("products[$i]", $product->id);?>
'> @@ -187,7 +187,7 @@
> product->plan;?> id][]", isset($productPlans[$product->id]) ? $productPlans[$product->id] : array(), $product->plans, "class='form-control chosen' multiple");?> - type == 'stage' and !$execution->division)):?> + type == 'stage' and $execution->stageBy == 'project')):?>
> @@ -262,7 +262,7 @@ productCommon;?> model == 'waterfall' or $project->model == 'waterfallplus') ? "disabled='disabled'" : '';?> id, "class='form-control chosen' $disabled onchange='loadBranches(this)' data-last='" . $product->id . "' data-type='" . $product->type . "'");?> - type == 'stage' and !$project->division) echo html::hidden("products[$i]", $product->id);?> + type == 'stage' and $project->stageBy == 'product') echo html::hidden("products[$i]", $product->id);?>
'> diff --git a/module/programplan/model.php b/module/programplan/model.php index d98a32ecc9..c8e7ea712a 100755 --- a/module/programplan/model.php +++ b/module/programplan/model.php @@ -873,7 +873,7 @@ class programplanModel extends model $linkProducts = array(); $linkBranches = array(); $productList = $this->loadModel('product')->getProducts($projectID); - if($project->division) + if($project->stageBy == 'product') { $linkProducts = array(0 => $productID); $linkBranches = array(0 => $productList[$productID]->branches); @@ -954,7 +954,7 @@ class programplanModel extends model { unset($plan->id); $plan->status = 'wait'; - $plan->division = $project->division; + $plan->stageBy = $project->stageBy; $plan->version = 1; $plan->parentVersion = $plan->parent == 0 ? 0 : $this->dao->findByID($plan->parent)->from(TABLE_PROJECT)->fetch('version'); $plan->team = substr($plan->name,0, 30); diff --git a/module/programplan/view/create.html.php b/module/programplan/view/create.html.php index 22981125a1..b40b383cad 100644 --- a/module/programplan/view/create.html.php +++ b/module/programplan/view/create.html.php @@ -23,7 +23,7 @@ echo "{$title}"; ?> - division):?> + stageBy == 'product'):?>
diff --git a/module/programplan/view/gantt.html.php b/module/programplan/view/gantt.html.php index f8cc583dcd..eccfe89e77 100755 --- a/module/programplan/view/gantt.html.php +++ b/module/programplan/view/gantt.html.php @@ -86,7 +86,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;} app->getModuleName() == 'programplan'):?>
- division)):?> + stageBy == 'product'):?> product->allProduct;?>