* Fix bug #38516.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user