* Code for task#77802. Modify batch edit plan.

This commit is contained in:
xieqiyu
2022-12-01 10:06:33 +08:00
parent 73e8aa89e9
commit c109140c81
2 changed files with 25 additions and 9 deletions
+13 -7
View File
@@ -194,15 +194,21 @@ class productplan extends control
$this->commonAction($productID, $branch);
$plans = $this->productplan->getByIDList($this->post->planIDList);
$oldBranch = array();
$plans = $this->productplan->getByIDList($this->post->planIDList);
$oldBranch = array();
$parentIdList = array();
foreach($plans as $plan) $oldBranch[$plan->id] = $plan->branch;
foreach($plans as $plan)
{
$oldBranch[$plan->id] = $plan->branch;
$parentIdList[$plan->parent] = $plan->parent;
}
$this->view->title = $this->lang->productplan->batchEdit;
$this->view->plans = $plans;
$this->view->oldBranch = $oldBranch;
$this->view->product = $this->loadModel('product')->getById($productID);;
$this->view->title = $this->lang->productplan->batchEdit;
$this->view->plans = $plans;
$this->view->oldBranch = $oldBranch;
$this->view->product = $this->loadModel('product')->getById($productID);;
$this->view->parentList = $this->productplan->getByIDList($parentIdList);
$this->display();
}
+12 -2
View File
@@ -43,8 +43,18 @@
<td class='text-center'><?php echo $plan->id . html::hidden("id[$plan->id]", $plan->id);?></td>
<?php if($product->type != 'normal'):?>
<td class='text-left'>
<?php $disabled = $plan->parent == -1 ? "disabled='disabled'" : '';?>
<?php echo html::select("branch[$plan->id][]", $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id); 'class='form-control chosen' multiple $disabled");?>
<?php
$disabled = $plan->parent == -1 ? "disabled='disabled'" : '';
$parentBranches = array();
if($plan->parent > 0 and isset($parentList[$plan->parent]))
{
foreach($branchTagOption as $branchID => $branchName)
{
if(strpos(",{$parentList[$plan->parent]->branch},", ",$branchID,") !== false) $parentBranches[$branchID] = $branchName;
}
}
echo html::select("branch[$plan->id][]", ($plan->parent > 0 and !empty($parentBranches)) ? $parentBranches : $branchTagOption, $plan->branch, "onchange='getConflictStories($plan->id); 'class='form-control chosen' multiple $disabled");
?>
</td>
<?php endif;?>
<td title='<?php echo $plan->title?>'><?php echo html::input("title[$plan->id]", $plan->title, "class='form-control'")?></td>