* Fix bug #27896,27898.
This commit is contained in:
@@ -865,7 +865,7 @@ class execution extends control
|
||||
if($project->model != 'scrum') unset($this->config->product->search['fields']['plan']);
|
||||
}
|
||||
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'executionStory', $executionID);
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'executionStory', $execution);
|
||||
|
||||
/* Header and position. */
|
||||
$title = $execution->name . $this->lang->colon . $this->lang->execution->story;
|
||||
@@ -3271,7 +3271,7 @@ class execution extends control
|
||||
/* Build the search form. */
|
||||
$actionURL = $this->createLink($this->app->rawModule, 'linkStory', "objectID=$objectID&browseType=bySearch&queryID=myQueryID");
|
||||
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $objectID);
|
||||
$this->execution->buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, 'linkStory', $object);
|
||||
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
@@ -3317,6 +3317,7 @@ class execution extends control
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->branchGroups = $branchGroups;
|
||||
$this->view->browseLink = $browseLink;
|
||||
$this->view->project = $this->loadModel('project')->getByID($object->project);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -2161,19 +2161,18 @@ class executionModel extends model
|
||||
* @param int $queryID
|
||||
* @param string $actionURL
|
||||
* @param string $type
|
||||
* @param int $objectID
|
||||
* @param object $execution
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, $type = 'executionStory', $objectID = 0)
|
||||
public function buildStorySearchForm($products, $branchGroups, $modules, $queryID, $actionURL, $type = 'executionStory', $execution = null)
|
||||
{
|
||||
$this->app->loadLang('branch');
|
||||
$branchPairs = array(BRANCH_MAIN => $this->lang->branch->main);
|
||||
$productType = 'normal';
|
||||
$productNum = count($products);
|
||||
$productPairs = array(0 => '');
|
||||
$branches = $this->loadModel('project')->getBranchesByProject($objectID);
|
||||
$hasProduct = $this->dao->select('hasProduct')->from(TABLE_EXECUTION)->where('id')->eq($objectID)->fetch('hasProduct');
|
||||
$branches = $this->loadModel('project')->getBranchesByProject($execution->id);
|
||||
|
||||
foreach($products as $product)
|
||||
{
|
||||
@@ -2225,7 +2224,13 @@ class executionModel extends model
|
||||
}
|
||||
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList);
|
||||
|
||||
if(empty($hasProduct)) unset($this->config->product->search['fields']['product']);
|
||||
$project = $this->loadModel('project')->getByID($execution->project);
|
||||
if(empty($project->hasProduct))
|
||||
{
|
||||
unset($this->config->product->search['fields']['product']);
|
||||
|
||||
if($project->model == 'kanban') unset($this->config->product->search['fields']['plan']);
|
||||
}
|
||||
|
||||
$this->loadModel('search')->setSearchParams($this->config->product->search);
|
||||
}
|
||||
|
||||
@@ -43,13 +43,15 @@
|
||||
</th>
|
||||
<th class='c-pri' title=<?php echo $lang->execution->pri;?>><?php echo $lang->priAB;?></th>
|
||||
<th><?php echo $lang->story->title;?></th>
|
||||
<?php if(!empty($object->hasProduct)):?>
|
||||
<?php if($project->hasProduct):?>
|
||||
<th class='c-object'><?php echo $lang->story->product;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-module'><?php echo $lang->story->module;?></th>
|
||||
<?php if($project->hasProduct || (!$project->hasProduct && $project->model != 'kanban')):?>
|
||||
<th class='c-plan'><?php echo $lang->story->plan;?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-stage'><?php echo $lang->story->stage;?></th>
|
||||
<?php if(!empty($object->hasProduct) && $productType != 'normal'):?>
|
||||
<?php if($project->hasProduct && $productType != 'normal'):?>
|
||||
<th class='c-branch'><?php echo $lang->product->branchName[$productType];?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-user'><?php echo $lang->openedByAB;?></th>
|
||||
@@ -79,13 +81,15 @@
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php if(!empty($object->hasProduct)):?>
|
||||
<?php if($project->hasProduct):?>
|
||||
<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);?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-module text-left' title='<?php echo zget($modules, $story->module, '')?>'><?php echo zget($modules, $story->module, '')?></td>
|
||||
<?php if($project->hasProduct || (!$project->hasProduct && $project->model != 'kanban')):?>
|
||||
<td class='text-ellipsis' title='<?php echo $story->planTitle;?>'><?php echo $story->planTitle;?></td>
|
||||
<?php endif;?>
|
||||
<td><?php echo zget($lang->story->stageList, $story->stage);?></td>
|
||||
<?php if(!empty($object->hasProduct) && $productType != 'normal'):?>
|
||||
<?php if($project->hasProduct && $productType != 'normal'):?>
|
||||
<td><?php if(isset($branchGroups[$story->product][$story->branch])) echo $branchGroups[$story->product][$story->branch];?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-user'><?php echo zget($users, $story->openedBy);?></td>
|
||||
|
||||
Reference in New Issue
Block a user