* Fix bug #32243.
This commit is contained in:
@@ -1727,15 +1727,8 @@ class execution extends control
|
||||
}
|
||||
|
||||
$importPlanStoryTips = $multiBranchProduct ? $this->lang->execution->importBranchPlanStory : $this->lang->execution->importPlanStory;
|
||||
if(!$execution->hasProduct)
|
||||
{
|
||||
return print(js::locate(inlink('create', "projectID=$projectID&executionID=$executionID")));
|
||||
}
|
||||
else
|
||||
{
|
||||
return print(js::confirm($importPlanStoryTips, inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID")));
|
||||
|
||||
}
|
||||
return print(js::confirm($importPlanStoryTips, inlink('create', "projectID=$projectID&executionID=$executionID©ExecutionID=&planID=$planID&confirm=yes"), inlink('create', "projectID=$projectID&executionID=$executionID")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1801,16 +1794,11 @@ class execution extends control
|
||||
{
|
||||
if(isset($_POST['attribute']) and in_array($_POST['attribute'], array('request', 'design', 'review'))) unset($_POST['plans']);
|
||||
|
||||
/* No product execution link plans. */
|
||||
if(isset($project->hasProduct) and empty($project->hasProduct) and !empty($_POST['plans']))
|
||||
/* Filter empty plans. */
|
||||
if(!empty($_POST['plans']))
|
||||
{
|
||||
$plansItem = array();
|
||||
foreach($_POST['plans'] as $planItem)
|
||||
{
|
||||
if(empty($planItem[0][0])) continue;
|
||||
$plansItem[] = $planItem[0][0];
|
||||
}
|
||||
$_POST['plans'] = array($_POST['products'][0] => array(0 => $plansItem));
|
||||
foreach($_POST['plans'] as $key => $planItem) $_POST['plans'][$key] = array_filter($_POST['plans'][$key]);
|
||||
$_POST['plans'] = array_filter($_POST['plans']);
|
||||
}
|
||||
|
||||
$executionID = $this->execution->create($copyExecutionID);
|
||||
@@ -2006,15 +1994,11 @@ class execution extends control
|
||||
$newPlans = array();
|
||||
if(isset($_POST['plans']))
|
||||
{
|
||||
|
||||
foreach($_POST['plans'] as $plans)
|
||||
foreach($_POST['plans'] as $products)
|
||||
{
|
||||
foreach($plans as $planList)
|
||||
foreach($products as $planID)
|
||||
{
|
||||
foreach($planList as $planID)
|
||||
{
|
||||
if(array_search($planID, $oldPlans) === false) $newPlans[$planID] = $planID;
|
||||
}
|
||||
if(array_search($planID, $oldPlans) === false) $newPlans[$planID] = $planID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
<?php $this->printExtendFields('', 'table', 'columns=3');?>
|
||||
<?php $hidden = 'hide'?>
|
||||
<?php if(!empty($project->hasProduct)) $hidden = ''?>
|
||||
<?php if($products):?>
|
||||
<?php if(isset($project->hasProduct) and !empty($project->hasProduct) and $products):?>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($products as $product):?>
|
||||
<tr class="<?php echo $hidden;?>">
|
||||
@@ -184,6 +184,16 @@
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php elseif(!empty($project) and empty($project->hasProduct)):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->execution->linkPlan;?></th>
|
||||
<td id="plansBox">
|
||||
<?php $planProductID = current(array_keys($allProducts));?>
|
||||
<?php echo html::select("plans[$planProductID][]", isset($productPlan) ? $productPlan : array(), '', "class='form-control chosen' multiple");?>
|
||||
<?php echo html::hidden("products[]", $planProductID);?>
|
||||
<?php echo html::hidden("branch[0][0]", '0');?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr class='<?php echo $hidden;?>'>
|
||||
<th id='productTitle'><?php echo $lang->project->manageProductPlan;?></th>
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
<?php if($project->model != 'waterfall' and $project->model != 'waterfallplus'): ?>
|
||||
<?php $hidden = 'hide'?>
|
||||
<?php if(!empty($project->hasProduct)) $hidden = ''?>
|
||||
<?php if($linkedProducts):?>
|
||||
<?php if(!empty($project) and !empty($project->hasProduct) and $linkedProducts):?>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($linkedProducts as $product):?>
|
||||
<tr class="<?php echo $hidden;?>">
|
||||
@@ -195,6 +195,16 @@
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php elseif(!empty($project) and empty($project->hasProduct)):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->execution->linkPlan;?></th>
|
||||
<td id="plansBox">
|
||||
<?php $planProductID = current(array_keys($linkedProducts));?>
|
||||
<?php echo html::select("plans[$planProductID][]", isset($productPlans[$planProductID]) ? $productPlans[$planProductID] : array(), isset($linkedProducts[$planProductID]) ? $linkedProducts[$planProductID]->plans : '', "class='form-control chosen' multiple");?>
|
||||
<?php echo html::hidden("products[]", $planProductID);?>
|
||||
<?php echo html::hidden("branch[0][0]", '0');?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr class='<?php echo $hidden;?>'>
|
||||
<th id='productTitle'><?php echo $lang->project->manageProductPlan;?></th>
|
||||
|
||||
@@ -1109,7 +1109,7 @@ class productplanModel extends model
|
||||
foreach($planStory as $id => $story)
|
||||
{
|
||||
$projectBranches = zget($projectProducts, $story->product, array());
|
||||
if($story->status == 'active' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch])))
|
||||
if($story->status != 'active' or (!empty($story->branch) and !empty($projectBranches) and !isset($projectBranches[$story->branch])))
|
||||
{
|
||||
unset($planStory[$id]);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user