Merge branch 'sprint/liyuchun_devops18' into 'devops18'

Sprint/liyuchun devops18

See merge request easycorp/zentaopms!1167
This commit is contained in:
王怡栋
2021-12-28 07:49:59 +00:00
11 changed files with 43 additions and 9 deletions
+1
View File
@@ -1 +1,2 @@
ALTER TABLE zt_productplan ADD `status` enum('wait','doing','done','closed') NOT NULL default 'wait' AFTER `title`;
ALTER TABLE zt_product modify column `reviewer` text NOT NULL;
+1 -1
View File
@@ -933,7 +933,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,
`reviewer` text NOT NULL,
`createdBy` varchar(30) NOT NULL,
`createdDate` datetime NOT NULL,
`createdVersion` varchar(20) NOT NULL,
+1
View File
@@ -617,6 +617,7 @@ class gitlab
$param = new stdclass();
$param->path = urldecode($path);
$param->ref_name = $this->branch;
$fromDate = $this->getCommittedDate($fromRevision);
$toDate = $this->getCommittedDate($toRevision);
+1
View File
@@ -164,6 +164,7 @@ $lang->bug->labelConfirmed = 'Confirmed';
$lang->bug->labelPostponed = 'Postponed';
$lang->bug->changed = 'Changed';
$lang->bug->storyChanged = 'Story Changed';
$lang->bug->linkMR = 'Related MRs';
/* Page tags. */
$lang->bug->lblAssignedTo = 'AssignTo';
+1
View File
@@ -164,6 +164,7 @@ $lang->bug->labelConfirmed = '已确认';
$lang->bug->labelPostponed = '被延期';
$lang->bug->changed = '已变动';
$lang->bug->storyChanged = '需求变动';
$lang->bug->linkMR = '相关合并请求';
/* 页面标签。*/
$lang->bug->lblAssignedTo = '当前指派';
+1
View File
@@ -164,6 +164,7 @@ $lang->bug->labelConfirmed = '已確認';
$lang->bug->labelPostponed = '被延期';
$lang->bug->changed = '已變動';
$lang->bug->storyChanged = '需求變動';
$lang->bug->linkMR = '相關合并請求';
/* 頁面標籤。*/
$lang->bug->lblAssignedTo = '當前指派';
+1
View File
@@ -495,6 +495,7 @@ class bugModel extends model
if($bug->linkBug) $bug->linkBugTitles = $this->dao->select('id,title')->from(TABLE_BUG)->where('id')->in($bug->linkBug)->fetchPairs();
if($bug->toStory > 0) $bug->toStoryTitle = $this->dao->findById($bug->toStory)->from(TABLE_STORY)->fields('title')->fetch('title');
if($bug->toTask > 0) $bug->toTaskTitle = $this->dao->findById($bug->toTask)->from(TABLE_TASK)->fields('name')->fetch('name');
$bug->linkMRTitles = $this->loadModel('mr')->getLinkedMRPairs($bugID, 'bug');
$bug->toCases = array();
$toCases = $this->dao->select('id, title')->from(TABLE_CASE)->where('`fromBug`')->eq($bugID)->fetchAll();
+13 -2
View File
@@ -374,7 +374,7 @@
<table class="table table-data">
<tbody>
<tr class='text-top'>
<th class='w-80px'><?php echo $lang->bug->linkBug;?></th>
<th class='w-90px'><?php echo $lang->bug->linkBug;?></th>
<td>
<?php
if(isset($bug->linkBugTitles))
@@ -389,7 +389,7 @@
</tr>
<?php if($bug->case):?>
<tr>
<th class='w-60px'><?php echo $lang->bug->fromCase;?></th>
<th><?php echo $lang->bug->fromCase;?></th>
<td><?php echo html::a($this->createLink('testcase', 'view', "caseID=$bug->case&caseVersion=" . ($bug->testtask ? "&from=testtask&taskID={$bug->testtask}" : ''), '', true), "#$bug->case $bug->caseTitle", '', "class='iframe' data-width='80%'");?></td>
</tr>
<?php endif;?>
@@ -418,6 +418,17 @@
<td><?php echo html::a($this->createLink('task', 'view', "taskID=$bug->toTask", '', true), "#$bug->toTask $bug->toTaskTitle", '', "class='iframe' data-width='80%'");?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->bug->linkMR;?></th>
<td>
<?php
foreach($bug->linkMRTitles as $MRID => $linkMRTitle)
{
echo html::a($this->createLink('mr', 'view', "MRID=$MRID"), "#$MRID $linkMRTitle") . '<br />';
}
?>
</td>
</tr>
</tbody>
</table>
</div>
+18 -1
View File
@@ -1252,6 +1252,23 @@ class mrModel extends model
return $links;
}
/**
* Get linked MR pairs.
*
* @param int $objectID
* @param string $objectType
* @access public
* @return array
*/
public function getLinkedMRPairs($objectID, $objectType = 'story')
{
return $this->dao->select("t2.id,t2.title")->from(TABLE_RELATION)->alias('t1')
->leftJoin(TABLE_MR)->alias('t2')->on('t1.AID = t2.id')
->where('t1.AType')->eq('mr')
->andWhere('t1.BID')->eq($objectID)
->fetchPairs();
}
/**
* Create an mr link.
*
@@ -1325,7 +1342,7 @@ class mrModel extends model
$commits = array();
foreach($DiffCommits as $DiffCommit)
{
$commits[] = substr($DiffCommit->id, 0, 10);
if(isset($DiffCommit->id)) $commits[] = substr($DiffCommit->id, 0, 10);
}
return $this->dao->select('objectID')->from(TABLE_ACTION)->where('objectType')->eq($type)->andWhere('extra')->in($commits)->fetchPairs('objectID');
+1 -1
View File
@@ -1048,7 +1048,7 @@ class product extends control
/* Get product reviewers. */
$product = $this->product->getByID($productID);
$productReviewers = $product->reviewer;
if(!$productReviewers) $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
if(!$productReviewers and $product->acl != 'open') $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
$storyReviewers = '';
if($storyID)
+4 -4
View File
@@ -305,7 +305,7 @@ class story extends control
/* Get reviewers. */
$reviewers = $product->reviewer;
if(!$reviewers) $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
if(!$reviewers and $product->acl != 'open') $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
/* Set Custom. */
foreach(explode(',', $this->config->story->list->customCreateFields) as $field) $customFields[$field] = $this->lang->story->$field;
@@ -469,7 +469,7 @@ class story extends control
/* Get reviewers. */
$reviewers = $product->reviewer;
if(!$reviewers) $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
if(!$reviewers and $product->acl != 'open') $reviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
/* Init vars. */
$planID = $plan;
@@ -685,7 +685,7 @@ class story extends control
/* Get product reviewers. */
$productReviewers = $product->reviewer;
if(!$productReviewers) $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
if(!$productReviewers and $product->acl != 'open') $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
$this->story->replaceURLang($story->type);
@@ -937,7 +937,7 @@ class story extends control
/* Get product reviewers. */
$productReviewers = $product->reviewer;
if(!$productReviewers) $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
if(!$productReviewers and $product->acl != 'open') $productReviewers = $this->loadModel('user')->getProductViewListUsers($product, '', '', '');
/* Assign. */
$this->view->title = $this->lang->story->change . "STORY" . $this->lang->colon . $this->view->story->title;