* Finish task #44370.
This commit is contained in:
+5
-3
@@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS `zt_stage` (
|
||||
`createdDate` datetime NOT NULL,
|
||||
`editedBy` varchar(30) NOT NULL,
|
||||
`editedDate` datetime NOT NULL,
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
@@ -19,7 +19,7 @@ CREATE TABLE IF NOT EXISTS `zt_design` (
|
||||
`product` varchar(255) NOT NULL,
|
||||
`commit` text NOT NULL,
|
||||
`commitedBy` varchar(30) NOT NULL,
|
||||
`execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`name` varchar(255) NOT NULL,
|
||||
`status` varchar(30) NOT NULL,
|
||||
`createdBy` varchar(30) NOT NULL,
|
||||
@@ -29,7 +29,7 @@ CREATE TABLE IF NOT EXISTS `zt_design` (
|
||||
`assignedTo` varchar(30) NOT NULL,
|
||||
`assignedBy` varchar(30) NOT NULL,
|
||||
`assignedDate` datetime NOT NULL,
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`story` char(30) NOT NULL,
|
||||
`desc` text NOT NULL,
|
||||
`version` smallint(6) NOT NULL,
|
||||
@@ -94,3 +94,5 @@ INSERT INTO `zt_lang` (`lang`, `module`, `section`, `key`, `value`, `system`) VA
|
||||
('all','stage','typeList','release','发布', '1'),
|
||||
('all','stage','typeList','review','总结评审','1'),
|
||||
('all','stage','typeList','other','其他','1');
|
||||
|
||||
ALTER TABLE `zt_product` ADD `reviewer` varchar(255) NOT NULL AFTER `whitelist`;
|
||||
|
||||
+4
-3
@@ -395,7 +395,7 @@ CREATE TABLE IF NOT EXISTS `zt_design` (
|
||||
`product` varchar(255) NOT NULL,
|
||||
`commit` text NOT NULL,
|
||||
`commitedBy` varchar(30) NOT NULL,
|
||||
`execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`execution` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`name` varchar(255) NOT NULL,
|
||||
`status` varchar(30) NOT NULL,
|
||||
`createdBy` varchar(30) NOT NULL,
|
||||
@@ -405,7 +405,7 @@ CREATE TABLE IF NOT EXISTS `zt_design` (
|
||||
`assignedTo` varchar(30) NOT NULL,
|
||||
`assignedBy` varchar(30) NOT NULL,
|
||||
`assignedDate` datetime NOT NULL,
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`story` char(30) NOT NULL,
|
||||
`desc` text NOT NULL,
|
||||
`version` smallint(6) NOT NULL,
|
||||
@@ -801,6 +801,7 @@ CREATE TABLE IF NOT EXISTS `zt_product` (
|
||||
`RD` varchar(30) NOT NULL,
|
||||
`acl` enum('open','private','custom') NOT NULL default 'open',
|
||||
`whitelist` text NOT NULL,
|
||||
`reviewer` varchar(255) NOT NULL,
|
||||
`createdBy` varchar(30) NOT NULL,
|
||||
`createdDate` datetime NOT NULL,
|
||||
`createdVersion` varchar(20) NOT NULL,
|
||||
@@ -1067,7 +1068,7 @@ CREATE TABLE IF NOT EXISTS `zt_stage` (
|
||||
`createdDate` datetime NOT NULL,
|
||||
`editedBy` varchar(30) NOT NULL,
|
||||
`editedDate` datetime NOT NULL,
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`deleted` enum('0','1') NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
-- DROP TABLE IF EXISTS `zt_stakeholder`;
|
||||
|
||||
@@ -4,6 +4,7 @@ $lang->index = new stdclass();
|
||||
$lang->my = new stdclass();
|
||||
$lang->todo = new stdclass();
|
||||
$lang->program = new stdclass();
|
||||
$lang->programplan = new stdclass();
|
||||
$lang->product = new stdclass();
|
||||
$lang->project = new stdclass();
|
||||
$lang->design = new stdclass();
|
||||
|
||||
@@ -718,6 +718,7 @@ class product extends control
|
||||
$this->view->users = $this->user->getPairs('noletter');
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->branches = $this->loadModel('branch')->getPairs($productID);
|
||||
$this->view->reviewers = explode(',', $product->reviewer);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -997,6 +998,34 @@ class product extends control
|
||||
if(!$productID) die(html::select('line', array('' => '') + $lines, '', "class='form-control chosen'"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajax get reviewers.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function ajaxGetReviewers($productID, $storyID = 0)
|
||||
{
|
||||
/* Get product reviewers. */
|
||||
$product = $this->product->getByID($productID);
|
||||
$productReviewers = $product->reviewer;
|
||||
if(!$productReviewers) $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
|
||||
|
||||
$storyReviewers = '';
|
||||
if($storyID)
|
||||
{
|
||||
$story = $this->loadModel('story')->getByID($storyID);
|
||||
$storyReviewers = $this->story->getReviewerPairs($story->id, $story->version);
|
||||
$storyReviewers = implode(',', array_keys($storyReviewers));
|
||||
}
|
||||
|
||||
$reviewers = $this->loadModel('user')->getPairs('noclosed|nodeleted', $storyReviewers, 0, $productReviewers);
|
||||
|
||||
die(html::select("reviewer[]", $reviewers, $storyReviewers, "class='form-control chosen' multiple"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop menu page.
|
||||
*
|
||||
|
||||
@@ -105,6 +105,7 @@ $lang->product->QD = 'QA Manager';
|
||||
$lang->product->RD = 'Release Manager';
|
||||
$lang->product->feedback = 'Feedback Manger';
|
||||
$lang->product->acl = 'Access Control';
|
||||
$lang->product->reviewer = 'Reviewer';
|
||||
$lang->product->whitelist = 'Whitelist';
|
||||
$lang->product->branch = '%s';
|
||||
$lang->product->qa = 'Test';
|
||||
|
||||
@@ -105,6 +105,7 @@ $lang->product->QD = '测试负责人';
|
||||
$lang->product->RD = '发布负责人';
|
||||
$lang->product->feedback = '反馈负责人';
|
||||
$lang->product->acl = '访问控制';
|
||||
$lang->product->reviewer = '评审人';
|
||||
$lang->product->whitelist = '白名单';
|
||||
$lang->product->branch = '所属%s';
|
||||
$lang->product->qa = '测试';
|
||||
|
||||
@@ -513,6 +513,7 @@ class productModel extends model
|
||||
->setIF($this->post->acl == 'open', 'whitelist', '')
|
||||
->stripTags($this->config->product->editor->create['id'], $this->config->allowedTags)
|
||||
->join('whitelist', ',')
|
||||
->join('reviewer', ',')
|
||||
->remove('uid,newLine,lineName')
|
||||
->get();
|
||||
|
||||
@@ -586,6 +587,7 @@ class productModel extends model
|
||||
$product = fixer::input('post')
|
||||
->setDefault('line', 0)
|
||||
->join('whitelist', ',')
|
||||
->join('reviewer', ',')
|
||||
->stripTags($this->config->product->editor->edit['id'], $this->config->allowedTags)
|
||||
->remove('uid,changeProjects')
|
||||
->get();
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
<th><?php echo $lang->product->RD;?></th>
|
||||
<td><?php echo html::select('RD', $rdUsers, '', "class='form-control chosen'");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->reviewer;?></th>
|
||||
<td><?php echo html::select('reviewer[]', $users, '', "class='form-control chosen' multiple");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->type;?></th>
|
||||
<td>
|
||||
|
||||
@@ -64,6 +64,10 @@
|
||||
<th><?php echo $lang->product->RD;?></th>
|
||||
<td><?php echo html::select('RD', $rdUsers, $product->RD, "class='form-control chosen'");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->reviewer;?></th>
|
||||
<td><?php echo html::select('reviewer[]', $users, $product->reviewer, "class='form-control chosen' multiple");?></td><td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->type;?></th>
|
||||
<td><?php echo html::select('type', $lang->product->typeList, $product->type, "class='form-control'");?></td><td></td>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="detail-title"><strong><?php echo $lang->product->manager;?></strong></div>
|
||||
<div class="detail-content">
|
||||
<table class="table table-data">
|
||||
<tbody>
|
||||
<tbody class="detail-users">
|
||||
<tr>
|
||||
<th class='w-65px'><i class="icon icon-person icon-sm"></i> <?php echo $lang->productCommon;?></th>
|
||||
<td><strong><?php echo zget($users, $product->PO);?></strong></td>
|
||||
@@ -52,7 +52,17 @@
|
||||
<tr>
|
||||
<th><i class="icon icon-person icon-sm"></i> <?php echo $lang->product->qa;?></th>
|
||||
<td><strong><?php echo zget($users, $product->QD);?></strong></td>
|
||||
<?php if(!isset($config->bizVersion)):?>
|
||||
<th><i class="icon icon-person icon-sm"></i> <?php echo $lang->product->reviewer;?></th>
|
||||
<td><strong><?php foreach($reviewers as $reviewer) echo zget($users, $reviewer) . " ";?></strong></td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php if(isset($config->bizVersion)):?>
|
||||
<tr>
|
||||
<th><i class="icon icon-person icon-sm"></i> <?php echo $lang->product->reviewer;?></th>
|
||||
<td><strong><?php foreach($reviewers as $reviewer) echo zget($users, $reviewer) . " ";?></strong></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -299,6 +299,10 @@ class story extends control
|
||||
->fetch('id');
|
||||
}
|
||||
|
||||
/* Get reviewers. */
|
||||
$reviewers = $product->reviewer;
|
||||
if(!$reviewers) $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
|
||||
|
||||
/* Set Custom. */
|
||||
foreach(explode(',', $this->config->story->list->customCreateFields) as $field) $customFields[$field] = $this->lang->story->$field;
|
||||
$this->view->customFields = $customFields;
|
||||
@@ -323,6 +327,7 @@ class story extends control
|
||||
$this->view->branches = $product->type != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array();
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $product;
|
||||
$this->view->reviewers = $this->user->getPairs('noclosed|nodeleted', '', 0, $reviewers);
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->estimate = $estimate;
|
||||
$this->view->storyTitle = $title;
|
||||
@@ -626,6 +631,10 @@ class story extends control
|
||||
$reviewedReviewer = array();
|
||||
foreach($reviewedBy as $reviewer) $reviewedReviewer[] = zget($users, $reviewer);
|
||||
|
||||
/* Get product reviewers. */
|
||||
$productReviewers = $product->reviewer;
|
||||
if(!$productReviewers) $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
|
||||
|
||||
$this->story->replaceURLang($story->type);
|
||||
|
||||
$this->view->title = $this->lang->story->edit . "STORY" . $this->lang->colon . $this->view->story->title;
|
||||
@@ -638,6 +647,7 @@ class story extends control
|
||||
$this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($story->product);
|
||||
$this->view->reviewers = implode(',', $reviewerList);
|
||||
$this->view->reviewedReviewer = $reviewedReviewer;
|
||||
$this->view->productReviewers = $this->user->getPairs('noclosed|nodeleted', $reviewerList, 0, $productReviewers);
|
||||
$this->view->isShowReviewer = $isShowReviewer;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
<td <?php echo $colspan;?> id='reviewerBox'>
|
||||
<div class="table-row">
|
||||
<div class="table-col">
|
||||
<?php echo html::select('reviewer[]', $users, empty($needReview) ? $product->PO : '', "class='form-control chosen' multiple");?>
|
||||
<?php echo html::select('reviewer[]', $reviewers, empty($needReview) ? $product->PO : '', "class='form-control chosen' multiple");?>
|
||||
</div>
|
||||
<?php if(!$this->story->checkForceReview()):?>
|
||||
<div class="table-col w-130px">
|
||||
|
||||
@@ -211,7 +211,7 @@
|
||||
<?php if($isShowReviewer):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->story->reviewers;?></th>
|
||||
<td><?php echo html::select('reviewer[]', $users, $reviewers, 'class="form-control chosen" multiple')?></td>
|
||||
<td><?php echo html::select('reviewer[]', $productReviewers, $reviewers, 'class="form-control chosen" multiple')?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php if($story->status == 'closed'):?>
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<script>
|
||||
/**
|
||||
* Load product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProduct(productID)
|
||||
{
|
||||
if(typeof parentStory != 'undefined' && parentStory)
|
||||
@@ -30,8 +37,15 @@ function loadProduct(productID)
|
||||
loadProductBranches(productID)
|
||||
loadProductModules(productID);
|
||||
loadProductPlans(productID);
|
||||
loadProductReviewers(productID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load branch.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadBranch()
|
||||
{
|
||||
var branch = $('#branch').val();
|
||||
@@ -40,6 +54,13 @@ function loadBranch()
|
||||
loadProductPlans($('#product').val(), branch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load branches when change product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProductBranches(productID)
|
||||
{
|
||||
$('#branch').remove();
|
||||
@@ -58,6 +79,14 @@ function loadProductBranches(productID)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Load modules when change product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProductModules(productID, branch)
|
||||
{
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
@@ -72,6 +101,14 @@ function loadProductModules(productID, branch)
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Load plans when change product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProductPlans(productID, branch)
|
||||
{
|
||||
if(typeof(branch) == 'undefined') branch = 0;
|
||||
@@ -84,4 +121,28 @@ function loadProductPlans(productID, branch)
|
||||
$planIdBox.fixInputGroup();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Load reviewers when change product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function loadProductReviewers(productID)
|
||||
{
|
||||
var storyID = <?php echo isset($story->id) ? $story->id : 0;?>;
|
||||
var reviewerLink = createLink('product', 'ajaxGetReviewers', 'productID=' + productID + '&storyID=' + storyID);
|
||||
var needNotReview = $('#needNotReview').attr('checked');
|
||||
$.get(reviewerLink, function(data)
|
||||
{
|
||||
if(data)
|
||||
{
|
||||
$('#reviewer').replaceWith(data);
|
||||
$('#reviewer_chosen').remove();
|
||||
$('#reviewer').chosen();
|
||||
if(needNotReview == 'checked') $('#reviewer').attr('disabled', 'disabled').trigger('chosen:updated');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
+23
-9
@@ -68,13 +68,14 @@ class userModel extends model
|
||||
/**
|
||||
* Get the account=>realname pairs.
|
||||
*
|
||||
* @param string $params noletter|noempty|nodeleted|noclosed|withguest|pofirst|devfirst|qafirst|pmfirst|realname|outside|inside|all, can be sets of theme
|
||||
* @param string $usersToAppended account1,account2
|
||||
* @param int $maxCount
|
||||
* @param string $params noletter|noempty|nodeleted|noclosed|withguest|pofirst|devfirst|qafirst|pmfirst|realname|outside|inside|all, can be sets of theme
|
||||
* @param string $usersToAppended account1,account2
|
||||
* @param int $maxCount
|
||||
* @param string|array $accounts
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPairs($params = '', $usersToAppended = '', $maxCount = 0)
|
||||
public function getPairs($params = '', $usersToAppended = '', $maxCount = 0, $accounts = '')
|
||||
{
|
||||
if(defined('TUTORIAL')) return $this->loadModel('tutorial')->getUserPairs();
|
||||
/* Set the query fields and orderBy condition.
|
||||
@@ -102,6 +103,7 @@ class userModel extends model
|
||||
->where('1')
|
||||
->beginIF(strpos($params, 'all') === false)->andWhere('type')->eq($type)->fi()
|
||||
->beginIF(strpos($params, 'nodeleted') !== false or empty($this->config->user->showDeleted))->andWhere('deleted')->eq('0')->fi()
|
||||
->beginIF($accounts)->andWhere('account')->in($accounts)->fi()
|
||||
->orderBy($orderBy)
|
||||
->beginIF($maxCount)->limit($maxCount)->fi()
|
||||
->fetchAll($keyField);
|
||||
@@ -2055,12 +2057,10 @@ class userModel extends model
|
||||
/* Get all groups for whiteList. */
|
||||
$allGroups = $this->dao->select('account, `group`')->from(TABLE_USERGROUP)->fetchAll();
|
||||
$userGroups = array();
|
||||
$groupUsers = array();
|
||||
foreach($allGroups as $group)
|
||||
{
|
||||
if(!isset($userGroups[$group->account])) $userGroups[$group->account] = '';
|
||||
$userGroups[$group->account] .= "{$group->group},";
|
||||
$groupUsers[$group->group][$group->account] = $group->account;
|
||||
}
|
||||
|
||||
list($productTeams, $productStakeholders) = $this->getProductMembers($products);
|
||||
@@ -2083,7 +2083,7 @@ class userModel extends model
|
||||
$teams = zget($productTeams, $productID, array());
|
||||
$stakeholders = zget($productStakeholders, $productID, array());
|
||||
$whiteList = zget($whiteListGroup, $productID, array());
|
||||
$viewList += $this->getProductViewListUsers($product, $groupUsers, $teams, $stakeholders, $whiteList);
|
||||
$viewList += $this->getProductViewListUsers($product, $teams, $stakeholders, $whiteList);
|
||||
}
|
||||
|
||||
$users = $viewList;
|
||||
@@ -2409,14 +2409,13 @@ class userModel extends model
|
||||
* Get product view list users.
|
||||
*
|
||||
* @param object $product
|
||||
* @param array $groupUsers
|
||||
* @param array $linkedProjects
|
||||
* @param array $teams
|
||||
* @param array $whiteList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProductViewListUsers($product, $groupUsers, $teams, $stakeholders, $whiteList)
|
||||
public function getProductViewListUsers($product, $teams, $stakeholders, $whiteList)
|
||||
{
|
||||
$users = array();
|
||||
|
||||
@@ -2428,6 +2427,21 @@ class userModel extends model
|
||||
$users[$product->createdBy] = $product->createdBy;
|
||||
if(isset($product->feedback)) $users[$product->feedback] = $product->feedback;
|
||||
|
||||
if($teams === '' and $stakeholders === '')
|
||||
{
|
||||
list($productTeams, $productStakeholders) = $this->getProductMembers(array($product->id => $product));
|
||||
$teams = isset($productTeams[$product->id]) ? $productTeams[$product->id] : array();
|
||||
$teams = isset($productStakeholders[$product->id]) ? $productStakeholders[$product->id] : array();
|
||||
}
|
||||
|
||||
if($whiteList === '')
|
||||
{
|
||||
$whiteList = $this->dao->select('account')->from(TABLE_ACL)
|
||||
->where('objectType')->eq('product')
|
||||
->andWhere('objectID')->eq($product->id)
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
$users += $teams ? $teams : array();
|
||||
$users += $stakeholders ? $stakeholders : array();
|
||||
$users += $whiteList ? $whiteList : array();
|
||||
|
||||
Reference in New Issue
Block a user