Merge branch '15.6_tianshujie_15484' into '15.6'
* Fix bug #15484. See merge request easycorp/zentaopms!63
This commit is contained in:
@@ -341,7 +341,7 @@ class upgrade extends control
|
||||
/* When upgrading historical data as a project, handle products that are not linked with the project. */
|
||||
if(!empty($singleProducts)) $this->upgrade->computeProductAcl($singleProducts, $programID);
|
||||
}
|
||||
elseif($type == 'sprint')
|
||||
elseif($type == 'sprint' or $type == 'noProject')
|
||||
{
|
||||
$linkedSprints = $this->post->sprints;
|
||||
|
||||
@@ -453,6 +453,7 @@ class upgrade extends control
|
||||
$this->view->lineGroups = $lineGroups;
|
||||
$this->view->productGroups = $productGroups;
|
||||
}
|
||||
|
||||
/* Get projects group by product. */
|
||||
if($type == 'product')
|
||||
{
|
||||
@@ -486,7 +487,6 @@ class upgrade extends control
|
||||
|
||||
if(empty($noMergedProducts)) $this->locate($this->createLink('upgrade', 'mergeProgram', "type=sprint&programID=0&projectType=$projectType"));
|
||||
|
||||
|
||||
/* Group project by product. */
|
||||
$productGroups = array();
|
||||
foreach($noMergedSprints as $sprint)
|
||||
@@ -501,6 +501,7 @@ class upgrade extends control
|
||||
$this->view->noMergedProducts = $noMergedProducts;
|
||||
$this->view->productGroups = $productGroups;
|
||||
}
|
||||
|
||||
/* Get no merged projects than is not linked product. */
|
||||
if($type == 'sprint')
|
||||
{
|
||||
@@ -508,10 +509,26 @@ class upgrade extends control
|
||||
$projectProducts = $this->dao->select('*')->from(TABLE_PROJECTPRODUCT)->where('project')->in(array_keys($noMergedSprints))->fetchGroup('project', 'product');
|
||||
foreach($projectProducts as $sprintID => $products) unset($noMergedSprints[$sprintID]);
|
||||
|
||||
if(empty($noMergedSprints)) $this->locate($this->createLink('upgrade', 'mergeProgram', "type=moreLink"));
|
||||
if(empty($noMergedSprints)) $this->locate($this->createLink('upgrade', 'mergeProgram', "type=noProject"));
|
||||
|
||||
$this->view->noMergedSprints = $noMergedSprints;
|
||||
}
|
||||
|
||||
/* Get one no merged sprint that link more then two products and no project in the system. */
|
||||
if($type == 'noProject')
|
||||
{
|
||||
$project = $this->dao->select('*')->from(TABLE_PROJECT)->where('type')->eq('project')->fetch();
|
||||
if($project) $this->locate($this->createLink('upgrade', 'mergeProgram', 'type=moreLink'));
|
||||
$noMergedSprints = $this->dao->select('*')->from(TABLE_PROJECT)->where('parent')->eq(0)->andWhere('path')->eq('')->orderBy('id_desc')->limit(1)->fetchAll('id');
|
||||
|
||||
$productPrograms = $this->dao->select('t3.id as id, t3.name as name')->from(TABLE_PROJECTPRODUCT)->alias('t1')
|
||||
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id')
|
||||
->leftJoin(TABLE_PROGRAM)->alias('t3')->on('t2.program=t3.id')
|
||||
->where('t1.project')->eq(key($noMergedSprints))
|
||||
->fetchPairs();
|
||||
$this->view->noMergedSprints = $noMergedSprints;
|
||||
}
|
||||
|
||||
/* Get no merged projects that link more then two products. */
|
||||
if($type == 'moreLink')
|
||||
{
|
||||
@@ -549,7 +566,7 @@ class upgrade extends control
|
||||
$currentProgramID = $programID ? $programID : key($programs);
|
||||
|
||||
$this->view->title = $this->lang->upgrade->mergeProgram;
|
||||
$this->view->programs = $programs;
|
||||
$this->view->programs = $type == 'noProject' ? $productPrograms : $programs;
|
||||
$this->view->programID = $programID;
|
||||
$this->view->projects = array('' => '') + $this->upgrade->getProjectPairsByProgram($currentProgramID);
|
||||
$this->view->lines = $currentProgramID ? array('' => '') + $this->loadModel('product')->getLinePairs($currentProgramID) : array('' => '');
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
</th>
|
||||
<td class='required'>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select("programs", $programs, $programID, "class='form-control hidden pgm-exist' onchange='getProjectByProgram(this)'");?>
|
||||
<?php $hidden = $type == 'noProject' ? '' : 'hidden';?>
|
||||
<?php echo html::select("programs", $programs, $programID, "class='form-control $hidden pgm-exist' onchange='getProjectByProgram(this)'");?>
|
||||
<?php if($type != 'noProject'):?>
|
||||
<?php echo html::input("programName", '', "class='form-control pgm-no-exist'");?>
|
||||
<span class='input-group-addon'>
|
||||
<div class="checkbox-primary">
|
||||
@@ -21,6 +23,7 @@
|
||||
<label for="newProgram0"><?php echo $lang->upgrade->newProgram;?></label>
|
||||
</div>
|
||||
</span>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php echo html::hidden('programID', '');?>
|
||||
</td>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class='alert alert-info'>
|
||||
<?php
|
||||
printf($lang->upgrade->mergeSummary, $noMergedProductCount, $noMergedSprintCount);
|
||||
echo '<br />' . $lang->upgrade->mergeByProject;
|
||||
if($type == 'moreLink') echo '<br />' . $lang->upgrade->mergeByProject;
|
||||
?>
|
||||
</div>
|
||||
<div class='main-row'>
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<?php include './mergebyline.html.php';?>
|
||||
<?php elseif($type == 'product'):?>
|
||||
<?php include './mergebyproduct.html.php';?>
|
||||
<?php elseif($type == 'sprint'):?>
|
||||
<?php elseif($type == 'sprint' or $type == 'noProject'):?>
|
||||
<?php include './mergebysprint.html.php';?>
|
||||
<?php elseif($type == 'moreLink'):?>
|
||||
<div class='alert alert-info'>
|
||||
|
||||
Reference in New Issue
Block a user