*Finish task #48844.

This commit is contained in:
zhouxudong
2022-02-11 13:04:08 +08:00
parent 818bb2ef63
commit 8af167a379
5 changed files with 15 additions and 7 deletions
+10 -3
View File
@@ -1707,8 +1707,12 @@ class bug extends control
* @access public
* @return void
*/
public function linkBugs($bugID, $browseType = '', $param = 0)
public function linkBugs($bugID, $browseType = '', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Load pager. */
$this->app->loadClass('pager', $static = true);
$pager = new pager($recTotal, $recPerPage, $pageID);
/* Get bug and queryID. */
$bug = $this->bug->getById($bugID);
$queryID = ($browseType == 'bySearch') ? (int)$param : 0;
@@ -1722,7 +1726,7 @@ class bug extends control
$this->bug->buildSearchForm($bug->product, $this->products, $queryID, $actionURL);
/* Get bugs to link. */
$bugs2Link = $this->bug->getBugs2Link($bugID, $browseType, $queryID);
$bugs2Link = $this->bug->getBugs2Link($bugID, $browseType, $queryID, $pager);
/* Assign. */
$this->view->title = $this->lang->bug->linkBugs . "BUG #$bug->id $bug->title - " . $this->products[$bug->product];
@@ -1731,8 +1735,11 @@ class bug extends control
$this->view->position[] = $this->lang->bug->linkBugs;
$this->view->bug = $bug;
$this->view->bugs2Link = $bugs2Link;
$this->view->pager = $pager;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->recTotal = $recTotal;
$this->view->recPerPage = $recPerPage;
$this->view->pageID = $pageID;
$this->display();
}
+2 -2
View File
@@ -1360,12 +1360,12 @@ class bugModel extends model
* @access public
* @return array
*/
public function getBugs2Link($bugID, $browseType = 'bySearch', $queryID = 0)
public function getBugs2Link($bugID, $browseType = 'bySearch', $queryID = 0, $pager)
{
if($browseType == 'bySearch')
{
$bug = $this->getById($bugID);
$bugs2Link = $this->getBySearch($bug->product, 'all', $queryID, 'id');
$bugs2Link = $this->getBySearch($bug->product, 'all', $queryID, 'id', '', $pager);
foreach($bugs2Link as $key => $bug2Link)
{
if($bug2Link->id == $bugID) unset($bugs2Link[$key]);
-1
View File
@@ -470,7 +470,6 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow
<?php endif;?>
</div>
<div class="table-statistic"><?php echo $summary;?></div>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
<?php endif;?>
+1
View File
@@ -67,6 +67,7 @@
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
<div class="table-actions btn-toolbar"><?php if($bugCount) echo html::submitButton('', '', 'btn btn-default');?></div>
<?php echo html::hidden('bug', $bug->id);?>
<?php $pager->show('right', 'pagerjs');?>
</div>
</form>
<?php endif;?>
+2 -1
View File
@@ -243,7 +243,8 @@ class testtask extends control
$productID = $productID ? $productID : key($this->products);
$executions = empty($productID) ? array() : $this->loadModel('product')->getExecutionPairsByProduct($productID, '', 'id_desc', $projectID);
$builds = empty($productID) ? array() : $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk');
a($projectID);
a($productID);
$testreports = $this->testtask->getTestReportPairsByBuild($build);
/* Set menu. */