* Code for feedback #1077
This commit is contained in:
@@ -866,6 +866,7 @@ class story extends control
|
||||
$this->view->branchTagOption = $branchTagOption;
|
||||
$this->view->reviewers = array_keys($reviewerList);
|
||||
$this->view->reviewedReviewer = $reviewedReviewer;
|
||||
$this->view->lastReviewer = $this->story->getLastReviewer($story->id);
|
||||
$this->view->productReviewers = $this->user->getPairs('noclosed|nodeleted', array_keys($reviewerList), 0, $productReviewers);
|
||||
|
||||
$this->display();
|
||||
@@ -1158,6 +1159,7 @@ class story extends control
|
||||
$this->view->needReview = (($this->app->user->account == $this->view->product->PO or $this->config->story->needReview == 0 or !$this->story->checkForceReview()) and empty($reviewer)) ? "checked='checked'" : "";
|
||||
$this->view->reviewer = implode(',', array_keys($reviewer));
|
||||
$this->view->productReviewers = $this->user->getPairs('noclosed|nodeleted', $reviewer, 0, $productReviewers);
|
||||
$this->view->lastReviewer = $this->story->getLastReviewer($story->id);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1573,11 +1575,12 @@ class story extends control
|
||||
$reviewerList = $this->story->getReviewerPairs($story->id, $story->version);
|
||||
$story->reviewer = array_keys($reviewerList);
|
||||
|
||||
$this->view->story = $story;
|
||||
$this->view->actions = $this->action->getList('story', $storyID);
|
||||
$this->view->reviewers = $this->user->getPairs('noclosed|nodeleted', '', 0, $reviewers);
|
||||
$this->view->users = $this->user->getPairs('noclosed|noletter');
|
||||
$this->view->needReview = (($this->app->user->account == $product->PO or $this->config->story->needReview == 0 or !$this->story->checkForceReview()) and empty($story->reviewer)) ? "checked='checked'" : "";
|
||||
$this->view->story = $story;
|
||||
$this->view->actions = $this->action->getList('story', $storyID);
|
||||
$this->view->reviewers = $this->user->getPairs('noclosed|nodeleted', '', 0, $reviewers);
|
||||
$this->view->users = $this->user->getPairs('noclosed|noletter');
|
||||
$this->view->needReview = (($this->app->user->account == $product->PO or $this->config->story->needReview == 0 or !$this->story->checkForceReview()) and empty($story->reviewer)) ? "checked='checked'" : "";
|
||||
$this->view->lastReviewer = $this->story->getLastReviewer($story->id);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ $(function()
|
||||
{
|
||||
$('#needNotReview').on('change', function()
|
||||
{
|
||||
$('#reviewer').text('').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
|
||||
$('#reviewer').val($(this).is(':checked') ? '' : lastReviewer).attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
|
||||
if($(this).is(':checked'))
|
||||
{
|
||||
$('.input-group-addon').removeClass('required');
|
||||
|
||||
@@ -33,7 +33,7 @@ $(function()
|
||||
|
||||
$('#needNotReview').on('change', function()
|
||||
{
|
||||
$('#reviewer').text('').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
|
||||
$('#reviewer').val($(this).is(':checked') ? '' : lastReviewer).attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
|
||||
if($(this).is(':checked'))
|
||||
{
|
||||
$('#reviewerBox').removeClass('required');
|
||||
|
||||
@@ -2,7 +2,7 @@ $(function()
|
||||
{
|
||||
$('#needNotReview').on('change', function()
|
||||
{
|
||||
$('#reviewer').text('').attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
|
||||
$('#reviewer').val($(this).is(':checked') ? '' : lastReviewer).attr('disabled', $(this).is(':checked') ? 'disabled' : null).trigger('chosen:updated');
|
||||
if($(this).is(':checked'))
|
||||
{
|
||||
$('#reviewerBox').removeClass('required');
|
||||
|
||||
@@ -6040,4 +6040,25 @@ class storyModel extends model
|
||||
$reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '', '');
|
||||
return $this->user->getPairs('noclosed|nodeleted', '', 0, $reviewers);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the last reviewer.
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getLastReviewer($storyID)
|
||||
{
|
||||
$lastReviewer = $this->dao->select('t2.new')->from(TABLE_ACTION)->alias('t1')
|
||||
->leftJoin(TABLE_HISTORY)->alias('t2')->on('t1.id = t2.action')
|
||||
->where('t1.objectType')->eq('story')
|
||||
->andWhere('t1.objectID')->eq($storyID)
|
||||
->andWhere('t2.field')->in('reviewer,reviewers')
|
||||
->andWhere('t2.new')->ne('')
|
||||
->orderBy('t1.id_desc')
|
||||
->fetch('new');
|
||||
|
||||
return $lastReviewer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
?>
|
||||
<?php include './header.html.php';?>
|
||||
<?php js::set('lastReviewer', explode(',', $lastReviewer))?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<?php js::set('reviewerNotEmpty', $lang->story->notice->reviewerNotEmpty);?>
|
||||
<?php js::set('feedbackSource', $config->story->feedbackSource); ?>
|
||||
<?php js::set('storyStatus', $story->status);?>
|
||||
<?php js::set('lastReviewer', explode(',', $lastReviewer))?>
|
||||
<div class='main-content' id='mainContent'>
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
|
||||
<div class='main-header'>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('lastReviewer', explode(',', $lastReviewer))?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
|
||||
Reference in New Issue
Block a user