* Append story module when change product type.

This commit is contained in:
xieqiyu
2022-02-28 17:50:06 +08:00
parent 5cd1872e93
commit af76bc5b46
5 changed files with 21 additions and 41 deletions

View File

@@ -2789,6 +2789,13 @@ class execution extends control
{
if(isset($linkedStories[$story->id])) unset($allStories[$id]);
if($story->parent < 0) unset($allStories[$id]);
if(!isset($modules[$story->module]))
{
$storyModule = $this->tree->getModulesName($story->module);
$productName = count($products) > 1 ? $products[$story->product]->name : '';
$modules[$story->module] = $productName . $storyModule[$story->module];
}
}
/* Pager. */

View File

@@ -69,19 +69,6 @@
?>
</td>
<td class='text-left' title='<?php echo $products[$story->product]->name?>'><?php echo html::a($this->createLink('product', 'browse', "productID=$story->product&branch=$story->branch"), $products[$story->product]->name, '_blank');?></td>
<?php
if(!isset($modules[$story->module]))
{
$storyModule = count($products) > 1 ? $products[$story->product]->name . '/' : '/';
$modulePath = $this->tree->getParents($story->module);
foreach($modulePath as $key => $module)
{
$storyModule .= $module->name;
if(isset($modulePath[$key + 1])) $storyModule .= '/';
}
$modules[$story->module] = $storyModule;
}
?>
<td class='c-module text-left' title='<?php echo zget($modules, $story->module, '')?>'><?php echo zget($modules, $story->module, '')?></td>
<td class='text-ellipsis' title='<?php echo $story->planTitle;?>'><?php echo $story->planTitle;?></td>
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>

View File

@@ -362,8 +362,14 @@ class productplan extends control
if($plan->branch > 0) $this->view->branchStatus = $this->loadModel('branch')->getById($plan->branch, $plan->product, 'status');
$modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
foreach($planStories as $story)
{
if(!isset($modulePairs[$story->module])) $modulePairs += $this->tree->getModulesName($story->module);
}
$this->loadModel('datatable');
$this->view->modulePairs = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
$this->view->modulePairs = $modulePairs;
$this->view->title = "PLAN #$plan->id $plan->title/" . zget($products, $plan->product, '');
$this->view->position[] = $this->lang->productplan->view;
$this->view->planStories = $planStories;
@@ -606,6 +612,12 @@ class productplan extends control
$allStories = $this->story->getProductStories($this->view->product->id, $plan->branch ? "0,{$plan->branch}" : 0, $moduleID = '0', $status = 'draft,active,changed', 'story', 'id_desc', $hasParent = false, array_keys($planStories), $pager);
}
$modules = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
foreach($allStories as $story)
{
if(!isset($modules[$story->module])) $modules += $this->tree->getModulesName($story->module);
}
$this->view->allStories = $allStories;
$this->view->planStories = $planStories;
$this->view->products = $products;
@@ -613,7 +625,7 @@ class productplan extends control
$this->view->plans = $this->dao->select('id, end')->from(TABLE_PRODUCTPLAN)->fetchPairs();
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->browseType = $browseType;
$this->view->modules = $this->loadModel('tree')->getOptionMenu($plan->product, 'story', 0, 'all');
$this->view->modules = $modules;
$this->view->param = $param;
$this->view->orderBy = $orderBy;
$this->view->pager = $pager;

View File

@@ -47,19 +47,6 @@
</td>
<td><span class='label-pri <?php echo 'label-pri-' . $story->pri;?>' title='<?php echo zget($lang->story->priList, $story->pri, $story->pri)?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri)?></span></td>
<td class='c-name' title="<?php echo $story->planTitle;?>"><?php echo $story->planTitle;?></td>
<?php
if(!isset($modules[$story->module]))
{
$storyModule = '/';
$modulePath = $this->tree->getParents($story->module);
foreach($modulePath as $key => $module)
{
$storyModule .= $module->name;
if(isset($modulePath[$key + 1])) $storyModule .= '/';
}
$modules[$story->module] = $storyModule;
}
?>
<td title='<?php echo $modules[$story->module]?>' class='text-left c-name'><?php echo $modules[$story->module];?></td>
<td class='text-left nobr' title='<?php echo $story->title?>'>
<?php

View File

@@ -220,19 +220,6 @@
</td>
<?php if($canOrder):?><td class='sort-handler'><i class='icon-move'></i></td><?php endif;?>
<td><span class='label-pri <?php echo 'label-pri-' . $story->pri;?>' title='<?php echo zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
<?php
if(!isset($modulePairs[$story->module]))
{
$storyModule = '/';
$modulePath = $this->tree->getParents($story->module);
foreach($modulePath as $key => $module)
{
$storyModule .= $module->name;
if(isset($modulePath[$key + 1])) $storyModule .= '/';
}
$modulePairs[$story->module] = $storyModule;
}
?>
<td class='text-left nobr' title='<?php echo zget($modulePairs, $story->module, '');?>'><?php echo zget($modulePairs, $story->module, '');?></td>
<td class='text-left nobr' title='<?php echo $story->title?>'>
<?php