This commit is contained in:
zhaoke
2023-09-11 14:07:21 +08:00
parent fdc9ffa298
commit 21993fbd14
2 changed files with 22 additions and 2 deletions
+2 -2
View File
@@ -58,12 +58,12 @@ $config->repo->dtable->fieldList['actions']['list']['edit']['hint'] = $lang->rep
$config->repo->dtable->fieldList['actions']['list']['execJob']['icon'] = 'sonarqube';
$config->repo->dtable->fieldList['actions']['list']['execJob']['hint'] = $lang->sonarqube->execJob;
$config->repo->dtable->fieldList['actions']['list']['execJob']['url'] = helper::createLink('sonarqube', 'execJob', "jobID={job}");
$config->repo->dtable->fieldList['actions']['list']['execJob']['url'] = array('module' => 'sonarqube', 'method' => 'execJob', 'params' => "jobID={job}");
$config->repo->dtable->fieldList['actions']['list']['execJob']['className'] = 'ajax-submit';
$config->repo->dtable->fieldList['actions']['list']['reportView']['icon'] = 'audit';
$config->repo->dtable->fieldList['actions']['list']['reportView']['hint'] = $lang->sonarqube->reportView;
$config->repo->dtable->fieldList['actions']['list']['reportView']['url'] = helper::createLink('sonarqube', 'reportView', "jobID={job}");
$config->repo->dtable->fieldList['actions']['list']['reportView']['url'] = array('module' => 'sonarqube', 'method' => 'reportView', 'params' => "jobID={job}");
$config->repo->dtable->fieldList['actions']['list']['delete']['icon'] = 'trash';
$config->repo->dtable->fieldList['actions']['list']['delete']['hint'] = $lang->repo->delete;
+20
View File
@@ -327,4 +327,24 @@ class sonarqubeModel extends model
return $projectPairs;
}
/**
* 判断按钮是否可点击。
* Judge an action is clickable or not.
*
* @param object $sonarqube
* @param string $action
* @access public
* @return bool
*/
public static function isClickable(object $sonarqube, string $action): bool
{
$action = strtolower($action);
if($action == 'execjob') return $sonarqube->exec == '';
if($action == 'reportview') return $sonarqube->report == '';
return true;
}
}