* Finish task#44398
This commit is contained in:
+22
-4
@@ -42,6 +42,14 @@ class mr extends control
|
||||
/* Sync GitLab MR to ZenTao Database. */
|
||||
$MRList = $this->mr->batchSyncMR($MRList);
|
||||
|
||||
/* Check whether Mr is linked with the product. */
|
||||
$this->loadModel('gitlab');
|
||||
foreach($MRList as $MR)
|
||||
{
|
||||
$products = $this->gitlab->getProductsByProjects(array($MR->targetProject, $MR->sourceProject));
|
||||
$MR->linkButton = empty($products) ? false : true;
|
||||
}
|
||||
|
||||
/* Load lang from compile module */
|
||||
$this->app->loadLang('compile');
|
||||
|
||||
@@ -196,6 +204,15 @@ class mr extends control
|
||||
$this->view->httpRepoURL = $sourceProject->http_url_to_repo;
|
||||
$this->view->branchPath = $sourceProject->path_with_namespace . '-' . $rawMR->source_branch;
|
||||
|
||||
/* Get mr linked list. */
|
||||
$this->app->loadLang('productplan');
|
||||
$products = $this->loadModel('gitlab')->getProductsByProjects(array($MR->targetProject, $MR->sourceProject));
|
||||
$product = $this->loadModel('product')->getById(array_shift($products));
|
||||
$this->view->product = $product;
|
||||
$this->view->stories = $this->mr->getLinkList($MR->id, $product->id, 'story');
|
||||
$this->view->bugs = $this->mr->getLinkList($MR->id, $product->id, 'bug');
|
||||
$this->view->tasks = $this->mr->getLinkList($MR->id, $product->id, 'task');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -413,7 +430,7 @@ class mr extends control
|
||||
$product = $this->loadModel('product')->getById(array_shift($products));
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$storyPager = new pager(0, $recPerPage, $type == 'story' ? $pageID : 1);
|
||||
$bugPager = new pager(0, $recPerPage, $type == 'bug' ? $pageID : 1);
|
||||
$taskPager = new pager(0, $recPerPage, $type == 'task' ? $pageID : 1);
|
||||
@@ -422,6 +439,7 @@ class mr extends control
|
||||
$bugs = $this->mr->getLinkList($MRID, $product->id, 'bug', $orderBy, $bugPager);
|
||||
$tasks = $this->mr->getLinkList($MRID, $product->id, 'task', $orderBy, $taskPager);
|
||||
|
||||
$this->view->title = $this->lang->mr->common . $this->lang->colon . $this->lang->mr->link;
|
||||
$this->view->MR = $MR;
|
||||
$this->view->canBeChanged = true;
|
||||
$this->view->modulePairs = $this->loadModel('tree')->getOptionMenu($product->id, 'story');
|
||||
@@ -500,7 +518,7 @@ class mr extends control
|
||||
$MR = $this->mr->getByID($MRID);
|
||||
$relatedStories = $this->mr->getCommitedLink($MR->gitlabID, $MR->targetProject, $MR->mriid, 'story');
|
||||
|
||||
$linkedStories = $this->mr->getLinkList($MRID, $product->id, '', 'story');
|
||||
$linkedStories = $this->mr->getLinkList($MRID, $product->id, 'story');
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
$allStories = $this->story->getBySearch($productID, 0, $queryID, 'id', '', 'story', array_keys($linkedStories), null);
|
||||
@@ -578,7 +596,7 @@ class mr extends control
|
||||
$MR = $this->mr->getByID($MRID);
|
||||
$relatedBugs = $this->mr->getCommitedLink($MR->gitlabID, $MR->targetProject, $MR->mriid, 'bug');
|
||||
|
||||
$linkedBugs = $this->mr->getLinkList($MRID, $product->id, '','bug');
|
||||
$linkedBugs = $this->mr->getLinkList($MRID, $product->id, 'bug');
|
||||
if($browseType == 'bySearch')
|
||||
{
|
||||
$allBugs = $this->bug->getBySearch($productID, 0, $queryID, 'id_desc', array_keys($linkedBugs), null);
|
||||
@@ -641,7 +659,7 @@ class mr extends control
|
||||
|
||||
$MR = $this->mr->getByID($MRID);
|
||||
$relatedTasks = $this->mr->getCommitedLink($MR->gitlabID, $MR->targetProject, $MR->mriid, 'task');
|
||||
$linkedTasks = $this->mr->getLinkList($MRID, $product->id, '','task');
|
||||
$linkedTasks = $this->mr->getLinkList($MRID, $product->id, 'task');
|
||||
|
||||
/* Get executions by product. */
|
||||
$productExecutions = $this->product->getExecutionPairsByProduct($productID);
|
||||
|
||||
@@ -23,3 +23,4 @@ ol, ul {padding-left: 20px;}
|
||||
#tabsNav .tab-pane>.main-table {border-radius: 0;}
|
||||
.body-modal #mainMenu>.btn-toolbar {width: auto;}
|
||||
.body-modal #mainContent {min-height: 240px;}
|
||||
.body-modal #mainMenu>.btn-toolbar .page-title>.text {overflow: visible}
|
||||
@@ -0,0 +1 @@
|
||||
#legendStories ul li, #legendBugs ul li, #legendTasks ul li {padding: 10px 0 0 12px; line-height: 20px;}
|
||||
+1
-1
@@ -998,7 +998,7 @@ class mrModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getLinkList($MRID, $productID, $type, $orderBy, $pager = null)
|
||||
public function getLinkList($MRID, $productID, $type, $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$linkIDs = $this->dao->select('BID')->from(TABLE_RELATION)
|
||||
->where('product')->eq($productID)
|
||||
|
||||
@@ -120,6 +120,50 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="cell">
|
||||
<div class='tabs'>
|
||||
<ul class='nav nav-tabs'>
|
||||
<li class='active'><a href='#legendStories' data-toggle='tab'><?php echo $lang->productplan->linkedStories; ?></a></li>
|
||||
<li><a href='#legendBugs' data-toggle='tab'><?php echo $lang->productplan->linkedBugs; ?></a></li>
|
||||
<li><a href='#legendTasks' data-toggle='tab'><?php echo $lang->mr->linkedTasks ?></a></li>
|
||||
</ul>
|
||||
<div class='tab-content'>
|
||||
<div class='tab-pane active' id='legendStories'>
|
||||
<ul class="list-unstyled">
|
||||
<?php
|
||||
foreach($stories as $id => $story)
|
||||
{
|
||||
echo "<li title='$story->title'>" . html::a($this->createLink('story', 'view', "id=$id", '', true), "#$id $story->title", '', "class='iframe' data-width='80%'") . '</li>';
|
||||
}
|
||||
?>
|
||||
<li><?php echo html::a($this->createLink('mr', 'link', "MRID=$MR->id&type=story&orderBy=id_desc&link=true", '', true), $lang->productplan->linkStory, '', "class='btn btn-info iframe' data-width='95%' id='linkButton'"); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id='legendBugs'>
|
||||
<ul class="list-unstyled">
|
||||
<?php
|
||||
foreach($bugs as $id => $bug)
|
||||
{
|
||||
echo "<li title='$bug->title'>" . html::a($this->createLink('bug', 'view', "id=$id", '', true), "#$id $bug->title", '', "class='iframe' data-width='80%'") . '</li>';
|
||||
}
|
||||
?>
|
||||
<li><?php echo html::a($this->createLink('mr', 'link', "MRID=$MR->id&type=bug&orderBy=id_desc&link=true", '', true), $lang->productplan->linkBug, '', "class='btn btn-info iframe' data-width='95%' id='linkButton'"); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id='legendTasks'>
|
||||
<ul class="list-unstyled">
|
||||
<?php
|
||||
foreach($tasks as $id => $task)
|
||||
{
|
||||
echo "<li title='$task->name'>" . html::a($this->createLink('task', 'view', "id=$id", '', true), "#$id $task->name", '', "class='iframe' data-width='80%'") . '</li>';
|
||||
}
|
||||
?>
|
||||
<li><?php echo html::a($this->createLink('mr', 'link', "MRID=$MR->id&type=task&orderBy=id_desc&link=true", '', true), $lang->mr->linkTask, '', "class='btn btn-info iframe' data-width='95%' id='linkButton'"); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
Reference in New Issue
Block a user