* Fix bug#19440,19441,19442

This commit is contained in:
zenggang
2022-02-11 09:38:34 +00:00
parent 4bf3353189
commit afd2b95e74
4 changed files with 20 additions and 19 deletions
+15 -3
View File
@@ -336,6 +336,7 @@ class sonarqube extends control
*
* @param int $sonarqubeID
* @param string $projectKey
* @param bool $search
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
@@ -343,10 +344,20 @@ class sonarqube extends control
* @access public
* @return void
*/
public function browseIssue($sonarqubeID, $projectKey = '', $orderBy = 'severity_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
public function browseIssue($sonarqubeID, $projectKey = '', $search = false, $orderBy = 'severity_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
$this->app->loadClass('pager', $static = true);
$keyword = fixer::input('post')->setDefault('keyword', '')->get('keyword');
if(isset($_POST['keyword']))
{
$keyword = htmlspecialchars(trim($_POST['keyword']));
$search = true;
$pageID = 1;
$this->session->set('sonarqubeIssueKeyword', $keyword);
}
else
{
$keyword = '';
if($search == true) $keyword = $this->session->sonarqubeIssueKeyword;
}
$cacheFile = $this->sonarqube->getCacheFile($sonarqubeID, $projectKey);
if(!$cacheFile or !file_exists($cacheFile) or (time() - filemtime($cacheFile)) / 60 > $this->config->sonarqube->cacheTime)
@@ -407,6 +418,7 @@ class sonarqube extends control
$sonarqubeIssueList = array_chunk($sonarqubeIssueList, $pager->recPerPage);
$this->view->projectKey = $projectKey;
$this->view->search = $search;
$this->view->keyword = $keyword;
$this->view->pager = $pager;
$this->view->title = $this->lang->sonarqube->common . $this->lang->colon . $this->lang->sonarqube->browseIssue;
+3 -2
View File
@@ -1,7 +1,8 @@
.text-c-counts > span {margin-left: 5px;}
#mainMenu .pull-left {margin-right: 15px;}
.c-message {width: 350px;}
.c-file {width: 300px;}
.c-message {width: 300px;}
.c-file {width: 270px;}
.c-effort {width: 155px;}
.c-date {width: 130px;}
.c-severity {width: 80px;}
#keyword {width: 240px;}
-12
View File
@@ -10,18 +10,6 @@ $(document).ready(function()
if(event.which == 13) triggerSearch();
});
$('.pager a').each(function()
{
$(this).attr('data-url', $(this).attr('href'));
$(this).attr('href', '###');
});
$('.pager a').click(function()
{
$("#sonarqubeIssueForm").attr('action', $(this).data('url'))
triggerSearch();
});
$('.c-actions>a').click(function()
{
issueTitle = $(this).parent().parent().children(':first').attr('title');
+2 -2
View File
@@ -37,11 +37,11 @@
<div id='mainContent' class='main-row'>
<form class='main-table' id='ajaxForm' method='post'>
<table id='sonarqubeIssueList' class='table has-sort-head table-fixed'>
<?php $vars = "sonarqubeID={$sonarqubeID}&projectKey={$projectKey}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<?php $vars = "sonarqubeID={$sonarqubeID}&projectKey={$projectKey}&search={$search}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
<thead>
<tr>
<th class='c-message text-left'><?php common::printOrderLink('message', $orderBy, $vars, $lang->sonarqube->issue->message);?></th>
<th><?php common::printOrderLink('severity', $orderBy, $vars, $lang->sonarqube->issue->severity);?></th>
<th class='c-severity'><?php common::printOrderLink('severity', $orderBy, $vars, $lang->sonarqube->issue->severity);?></th>
<th><?php common::printOrderLink('type', $orderBy, $vars, $lang->sonarqube->issue->type);?></th>
<th><?php common::printOrderLink('status', $orderBy, $vars, $lang->sonarqube->issue->status);?></th>
<th class='c-file text-left'><?php common::printOrderLink('file', $orderBy, $vars, $lang->sonarqube->issue->file);?></th>