* Resolved feedback #3653 #3616: product confusion when editing without product storys.

This commit is contained in:
liuhong
2023-08-07 09:36:43 +00:00
parent 713b6f25e6
commit 789d71fa15
2 changed files with 6 additions and 5 deletions
+4 -4
View File
@@ -954,12 +954,12 @@ class storyModel extends model
if($this->config->vision != 'or')
{
/* Unchanged product when editing requirements on site. */
$storyProjectID = $this->dao->select('t2.hasProduct')->from(TABLE_PROJECTPRODUCT)->alias('t1')
$hasProduct = $this->dao->select('t2.hasProduct')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($oldStory->product)
->andWhere('t2.deleted')->eq(0)
->fetch();
$_POST['product'] = ($storyProjectID and !$storyProjectID->hasProduct) ? $oldStory->product : $this->post->product;
->fetch('hasProduct');
$_POST['product'] = (!empty($hasProduct) && !$hasProduct) ? $oldStory->product : $this->post->product;
}
$story = fixer::input('post')
@@ -5069,7 +5069,7 @@ class storyModel extends model
$tab = $this->app->tab;
$executionID = empty($execution) ? $this->session->execution : $execution->id;
$account = $this->app->user->account;
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0&param=&storyType=$story->type");
$storyLink = helper::createLink('story', 'view', "storyID=$story->id&version=0&param=&storyType=$story->type") . "#app=$tab";
$canView = common::hasPriv($story->type, 'view', null, "storyType=$story->type");
if($this->config->vision == 'or') $this->app->loadLang('demand');
+2 -1
View File
@@ -150,7 +150,8 @@
<th class='thWidth'><?php echo $lang->story->product;?></th>
<td id='productBox'>
<div class='input-group'>
<?php echo html::select('product', $products, $story->product, "onchange='loadProduct(this.value);' class='form-control chosen control-product'");?>
<?php $class = $hiddenProduct ? 'disabled' : ''?>
<?php echo html::select('product', $products, $story->product, "onchange='loadProduct(this.value);' class='form-control chosen control-product $class'");?>
<span class='input-group-addon fix-border fix-padding'></span>
<?php if($product->type != 'normal') echo html::select('branch', $branchTagOption, $story->branch, "onchange='loadBranch();' class='form-control chosen control-branch'");?>
</div>