From afd2b95e74a2a9311df76ac2cc2ef18c6f2a9b98 Mon Sep 17 00:00:00 2001 From: zenggang Date: Fri, 11 Feb 2022 09:38:34 +0000 Subject: [PATCH] * Fix bug#19440,19441,19442 --- module/sonarqube/control.php | 18 +++++++++++++++--- module/sonarqube/css/browseissue.css | 5 +++-- module/sonarqube/js/browseissue.js | 12 ------------ module/sonarqube/view/browseissue.html.php | 4 ++-- 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/module/sonarqube/control.php b/module/sonarqube/control.php index 28563d45e5..5f77e03a9c 100644 --- a/module/sonarqube/control.php +++ b/module/sonarqube/control.php @@ -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; diff --git a/module/sonarqube/css/browseissue.css b/module/sonarqube/css/browseissue.css index 8465817171..7fe0c53251 100644 --- a/module/sonarqube/css/browseissue.css +++ b/module/sonarqube/css/browseissue.css @@ -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;} diff --git a/module/sonarqube/js/browseissue.js b/module/sonarqube/js/browseissue.js index 174bbf3c03..5ead6cd3dd 100644 --- a/module/sonarqube/js/browseissue.js +++ b/module/sonarqube/js/browseissue.js @@ -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'); diff --git a/module/sonarqube/view/browseissue.html.php b/module/sonarqube/view/browseissue.html.php index 104ced4f77..e62c7f5361 100644 --- a/module/sonarqube/view/browseissue.html.php +++ b/module/sonarqube/view/browseissue.html.php @@ -37,11 +37,11 @@
- recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> + recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?> - +
sonarqube->issue->message);?>sonarqube->issue->severity);?>sonarqube->issue->severity);?> sonarqube->issue->type);?> sonarqube->issue->status);?> sonarqube->issue->file);?>