This commit is contained in:
liyuchun
2021-12-01 13:46:48 +08:00
parent 8a8d0da75e
commit b91bd45f85
3 changed files with 16 additions and 2 deletions
+4
View File
@@ -76,6 +76,10 @@ $lang->gitlab->accessLevels[30] = 'Developer';
$lang->gitlab->accessLevels[40] = 'Maintainer';
$lang->gitlab->accessLevels[50] = 'Owner';
$lang->gitlab->apiError[0] = 'internal is not allowed in a private group.';
$lang->gitlab->errorLang[0] = 'You cannot set Internal as its Visibility Level, if it is private in Gitlab.';
$lang->gitlab->project = new stdclass;
$lang->gitlab->project->id = "Project ID";
$lang->gitlab->project->name = "Project name";
+4
View File
@@ -76,6 +76,10 @@ $lang->gitlab->accessLevels[30] = 'Developer';
$lang->gitlab->accessLevels[40] = 'Maintainer';
$lang->gitlab->accessLevels[50] = 'Owner';
$lang->gitlab->apiError[0] = 'internal is not allowed in a private group.';
$lang->gitlab->errorLang[0] = '私有分组的项目,可见性级别不能设为内部。';
$lang->gitlab->project = new stdclass;
$lang->gitlab->project->id = "项目ID";
$lang->gitlab->project->name = "项目名称";
+8 -2
View File
@@ -2064,6 +2064,7 @@ class gitlabModel extends model
$this->loadModel('action')->create('gitlabproject', $project->id, 'edited', '', $project->name);
return true;
}
return $this->apiErrorHandling($reponse);
}
@@ -2250,14 +2251,19 @@ class gitlabModel extends model
}
if(!empty($reponse->message))
{
if(is_string($reponse->message)) dao::$errors[] = $reponse->message;
if(is_string($reponse->message))
{
$errorKey = array_search($reponse->message, $this->lang->gitlab->apiError);
dao::$errors[] = $errorKey === false ? $reponse->message : zget($this->lang->gitlab->errorLang, $errorKey);
}
else
{
foreach($reponse->message as $field => $fieldErrors)
{
foreach($fieldErrors as $error)
{
if($error) dao::$errors[$field][] = $error;
$errorKey = array_search($error, $this->lang->gitlab->apiError);
if($error) dao::$errors[$field][] = $errorKey === false ? $error : zget($this->lang->gitlab->errorLang, $errorKey);
}
}
}