diff --git a/module/gitlab/model.php b/module/gitlab/model.php index f6157070c4..41681cdb20 100644 --- a/module/gitlab/model.php +++ b/module/gitlab/model.php @@ -252,6 +252,20 @@ class gitlabModel extends model ->fetch('openID'); } + /** + * Get gitlab project name of one gitlab project. + * + * @param int $jobID + * @access public + * @return string|false + */ + public function getObjectNameForJob($gitlabID, $projectID) + { + $project = $this->apiGetSingleProject($gitlabID, $projectID); + if(isset($project->name)) return $project->name; + return false; + } + /** * Create a gitlab. * diff --git a/module/job/model.php b/module/job/model.php index f6fd2b098c..3b4a0c34fc 100644 --- a/module/job/model.php +++ b/module/job/model.php @@ -404,22 +404,4 @@ class jobModel extends model return $compile->status; } - - /** - * Get gitlab project name by jobID. - * - * @param int $jobID - * @access public - * @return string|false - */ - public function getGitlabProjectName($jobID) - { - $job = $this->getByID($jobID); - if(strtolower($job->engine) != 'gitlab') return false; - $gitlabID = $job->server; - $projectID = $job->pipeline; - $project = $this->loadModel('gitlab')->apiGetSingleProject($gitlabID, $projectID); - if(isset($project->name)) return $project->name; - return false; - } } diff --git a/module/job/view/browse.html.php b/module/job/view/browse.html.php index bce333a1a2..f44dc8a7ba 100644 --- a/module/job/view/browse.html.php +++ b/module/job/view/browse.html.php @@ -46,7 +46,7 @@