* Finish task #4598

This commit is contained in:
liugang
2018-07-04 17:05:53 +08:00
parent 9510ebf17b
commit b3aaab4f0c
3 changed files with 19 additions and 1 deletions
+7
View File
@@ -1090,6 +1090,12 @@ class project extends control
if(!isset($allProducts[$product->id])) $allProducts[$product->id] = $product->name;
if($product->branch) $linkedBranches[$product->branch] = $product->branch;
}
$this->loadModel('productplan');
$productPlans = array(0 => '');
foreach($linkedProducts as $product)
{
$productPlans[$product->id] = $this->productplan->getPairs($product->id);
}
$this->view->title = $title;
$this->view->position = $position;
@@ -1102,6 +1108,7 @@ class project extends control
$this->view->groups = $this->loadModel('group')->getPairs();
$this->view->allProducts = $allProducts;
$this->view->linkedProducts = $linkedProducts;
$this->view->productPlans = $productPlans;
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($linkedProducts), '', $linkedBranches);
$this->display();
+1 -1
View File
@@ -177,7 +177,7 @@ function loadPlans(product, branchID)
{
if(typeof(planID) == 'undefined') planID = 0;
planID = $("select#plans" + productID).val() != '' ? $("select#plans" + productID).val() : planID;
$.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=' + branchID + '&planID=' + planID + '&fieldID&needCreate=&expired=' + (config.currentMethod == 'create' ? 'unexpired' : '')), function(data)
$.get(createLink('product', 'ajaxGetPlans', "productID=" + productID + '&branch=' + branchID + '&planID=' + planID + '&fieldID&needCreate=&expired=' + ((config.currentMethod == 'create' || config.currentMethod == 'edit') ? 'unexpired' : '')), function(data)
{
if(data)
{
+11
View File
@@ -133,6 +133,17 @@
</div>
</td>
</tr>
<tr <?php if($config->global->flow == 'onlyTask') echo "class='hidden'";?>>
<th><?php echo $lang->project->linkPlan;?></th>
<td id="plansBox" colspan="2">
<div class='row'>
<?php foreach($linkedProducts as $product):?>
<?php $plans = zget($productPlans, $product->id, array(0 => ''));?>
<div class="col-sm-4" id="plan<?php echo $product->id;?>"><?php echo html::select("plans[" . $product->id . "]", $plans, $product->plan, "class='form-control chosen'");?></div>
<?php endforeach;?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->project->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', htmlspecialchars($project->desc), "rows='6' class='form-control kindeditor' hidefocus='true'");?></td>