* Adjust the code.

This commit is contained in:
hufangzhou
2021-05-24 09:30:14 +08:00
parent d4d96d6478
commit e9eb91aebe
2 changed files with 16 additions and 12 deletions
+14 -10
View File
@@ -609,19 +609,23 @@ class story extends control
/* Get users. */
$users = $this->user->getPairs('pofirst|nodeleted', "$story->assignedTo,$story->openedBy,$story->closedBy");
$reviewerList = $this->dao->select('reviewer')->from(TABLE_STORYREVIEW)->where('story')->eq($story->id)->andWhere('version')->eq($story->version)->fetchPairs('reviewer');
$isShowReviewer = true;
$reviewerList = $this->dao->select('reviewer')->from(TABLE_STORYREVIEW)->where('story')->eq($story->id)->andWhere('version')->eq($story->version)->fetchPairs('reviewer');
$reviewedBy = explode(',', trim($story->reviewedBy, ','));
if(!array_diff($reviewerList, $reviewedBy)) $isShowReviewer = false;
$this->story->replaceURLang($story->type);
$this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title;
$this->view->position[] = $this->lang->story->edit;
$this->view->story = $story;
$this->view->stories = $stories;
$this->view->users = $users;
$this->view->product = $product;
$this->view->products = $myProducts + $othersProducts;
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($story->product);
$this->view->reviewers = implode(',', $reviewerList);
$this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title;
$this->view->position[] = $this->lang->story->edit;
$this->view->story = $story;
$this->view->stories = $stories;
$this->view->users = $users;
$this->view->product = $product;
$this->view->products = $myProducts + $othersProducts;
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($story->product);
$this->view->reviewers = implode(',', $reviewerList);
$this->view->isShowReviewer = $isShowReviewer;
$this->display();
}
+2 -2
View File
@@ -204,9 +204,9 @@
<th><?php echo $lang->story->assignedTo;?></th>
<td><?php echo html::select('assignedTo', $users, $story->assignedTo, 'class="form-control chosen"');?></td>
</tr>
<?php if($story->status == 'draft' or $story->status == 'changed'):?>
<?php if($isShowReviewer):?>
<tr>
<th><?php echo $lang->story->reviewedBy;?></th>
<th><?php echo $lang->story->reviewers;?></th>
<td><?php echo html::select('reviewer[]', $users, $reviewers, 'class="form-control chosen" multiple')?></td>
</tr>
<?php endif;?>