* Finish task #4839.
This commit is contained in:
@@ -976,14 +976,15 @@ class project extends control
|
||||
exit;
|
||||
}
|
||||
|
||||
$name = '';
|
||||
$code = '';
|
||||
$team = '';
|
||||
$products = array();
|
||||
$whitelist = '';
|
||||
$acl = 'open';
|
||||
$plan = new stdClass();
|
||||
$productPlan = array();
|
||||
$name = '';
|
||||
$code = '';
|
||||
$team = '';
|
||||
$products = array();
|
||||
$whitelist = '';
|
||||
$acl = 'open';
|
||||
$plan = new stdClass();
|
||||
$productPlan = array();
|
||||
$productPlans = array();
|
||||
if($copyProjectID)
|
||||
{
|
||||
$copyProject = $this->dao->select('*')->from(TABLE_PROJECT)->where('id')->eq($copyProjectID)->fetch();
|
||||
@@ -993,6 +994,10 @@ class project extends control
|
||||
$acl = $copyProject->acl;
|
||||
$whitelist = $copyProject->whitelist;
|
||||
$products = $this->project->getProducts($copyProjectID);
|
||||
foreach($products as $product)
|
||||
{
|
||||
$productPlans[$product->id] = $this->loadModel('productplan')->getPairs($product->id);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($planID))
|
||||
@@ -1038,9 +1043,10 @@ class project extends control
|
||||
$this->view->name = $name;
|
||||
$this->view->code = $code;
|
||||
$this->view->team = $team;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->products = $products;
|
||||
$this->view->productPlan = array(0 => '') + $productPlan;
|
||||
$this->view->productPlans = array(0 => '') + $productPlans;
|
||||
$this->view->whitelist = $whitelist;
|
||||
$this->view->copyProjectID = $copyProjectID;
|
||||
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
|
||||
|
||||
@@ -118,6 +118,13 @@
|
||||
<?php if(isset($plan) && !empty($plan->begin)):?>
|
||||
<div class="col-sm-4" id="plan0"><?php echo html::select("plans[" . $plan->product . "]", $productPlan, $plan->id, "class='form-control chosen'");?></div>
|
||||
<?php js::set('currentPlanID', $plan->id)?>
|
||||
<?php elseif($copyProjectID):?>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($products as $product):?>
|
||||
<?php $plans = zget($productPlans, $product->id, array(0 => ''));?>
|
||||
<div class="col-sm-4" id="plan<?php echo $i;?>"><?php echo html::select("plans[" . $product->id . "]", $plans, $product->plan, "class='form-control chosen'");?></div>
|
||||
<?php $i++;?>
|
||||
<?php endforeach;?>
|
||||
<?php else:?>
|
||||
<div class="col-sm-4" id="plan0"><?php echo html::select("plans[]", $productPlan, '', "class='form-control chosen'");?></div>
|
||||
<?php js::set('currentPlanID', '')?>
|
||||
|
||||
Reference in New Issue
Block a user