+ Add relationship of projectproduct.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
title: project
|
||||
title: table zt_execution
|
||||
author: Zhu Jinyong
|
||||
version: "1.0"
|
||||
fields:
|
||||
|
||||
@@ -7,7 +7,7 @@ fields:
|
||||
range: 1-1000
|
||||
- field: program
|
||||
note: "所属项目集"
|
||||
range: 1-10
|
||||
range: 0-10
|
||||
- field: name
|
||||
note: "产品名称"
|
||||
fields:
|
||||
|
||||
@@ -13,7 +13,7 @@ fields:
|
||||
format: ""
|
||||
- field: root
|
||||
note: "项目/执行ID"
|
||||
range: 121-130{100},241-250{100}
|
||||
range: 11-300
|
||||
#range: 4{100},5{100}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
@@ -21,7 +21,7 @@ fields:
|
||||
format: ""
|
||||
- field: type
|
||||
note: "项目类型"
|
||||
range: project{100},execution{100}
|
||||
range: project{90},execution{200}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
@@ -30,16 +30,16 @@ fields:
|
||||
note: "用户账号"
|
||||
fields:
|
||||
- field: account1
|
||||
range: test,dev
|
||||
range: admin,user{98},test{100},pm{100},po{100}
|
||||
- field: account2
|
||||
range: 1-100
|
||||
range: [],3-100,1-100,1-100,1-100
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
format: ""
|
||||
- field: role
|
||||
note: "角色"
|
||||
range: 研发{60},测试{30},项目经理{5},产品经理{5}
|
||||
range: 研发{99},测试{100},项目经理{100},产品经理{5}
|
||||
prefix: ""
|
||||
postfix: ""
|
||||
loop: 0
|
||||
|
||||
@@ -14,6 +14,8 @@ $builder->productplan = array('rows' => 360, 'extends' => array('productplan'
|
||||
$builder->branch = array('rows' => 240, 'extends' => array('branch'));
|
||||
$builder->projectproduct = array('rows' => 200, 'extends' => array('projectproduct'));
|
||||
|
||||
$builder->team = array('rows' => 400, 'extends' => array('team'));
|
||||
|
||||
$builder->build = array('rows' => 8, 'extends' => array('build'));
|
||||
$builder->release = array('rows' => 8, 'extends' => array('release'));
|
||||
|
||||
|
||||
@@ -156,6 +156,27 @@ class Processor
|
||||
*/
|
||||
private function initExecution()
|
||||
{
|
||||
/* Add relationship of projectproduct. */
|
||||
$projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->fetchAll();
|
||||
$productsInProject = array();
|
||||
foreach($projectProducts as $relation)
|
||||
{
|
||||
if(!isset($productsInProject[$relation->project])) $productsInProject[$relation->project] = array();
|
||||
$productsInProject[$relation->project][] = $relation->product;
|
||||
}
|
||||
|
||||
$executions = $this->dao->select('*')->from(TABLE_PROJECT)->where('type')->in('sprint,kanban,stage')->fetchAll();
|
||||
foreach($executions as $execution)
|
||||
{
|
||||
$products = $productsInProject[$execution->project];
|
||||
foreach($products as $product)
|
||||
{
|
||||
$data = new stdclass();
|
||||
$data->project = $execution->id;
|
||||
$data->product = $product;
|
||||
$this->dao->insert(TABLE_PROJECTPRODUCT)->data($data)->exec();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user