Merge branch 'sprint/devops16' into 'devops16_caoyanyi_45677'
# Conflicts: # module/gitlab/view/browseproject.html.php
This commit is contained in:
+29
-28
@@ -948,7 +948,6 @@ class gitlab extends control
|
||||
if($gitlab) $user = $this->gitlab->apiGetCurrentUser($gitlab->url, $gitlab->token);
|
||||
if(empty($user->is_admin)) die(js::alert($this->lang->gitlab->tokenLimit) . js::locate($this->createLink('gitlab', 'edit', array('gitlabID' => $gitlabID))));
|
||||
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$executionList = $this->post->executionList;
|
||||
@@ -958,38 +957,40 @@ class gitlab extends control
|
||||
$failedIssues = array();
|
||||
foreach($executionList as $issueID => $executionID)
|
||||
{
|
||||
if($executionID)
|
||||
if(empty($executionID) and $productList[$issueID] != 0) return $this->send(array('result' => 'fail', 'message' => $this->lang->gitlab->importIssueError, 'locate' => $this->server->http_referer));
|
||||
}
|
||||
|
||||
foreach($executionList as $issueID => $executionID)
|
||||
{
|
||||
if(empty($executionID)) continue;
|
||||
|
||||
$objectType = $objectTypeList[$issueID];
|
||||
|
||||
$issue = $this->gitlab->apiGetSingleIssue($gitlabID, $projectID, $issueID);
|
||||
$issue->objectType = $objectType;
|
||||
$issue->objectID = 0; // Meet the required parameters for issueToZentaoObject.
|
||||
if(isset($issue->assignee)) $issue->assignee_id = $issue->assignee->id;
|
||||
$issue->updated_by_id = $issue->author->id; // Here can be replaced by current zentao user.
|
||||
|
||||
$object = $this->gitlab->issueToZentaoObject($issue, $gitlabID);
|
||||
$object->product = $productList[$issueID];
|
||||
$object->execution = $executionID;
|
||||
$clonedObject = clone $object;
|
||||
|
||||
if($objectType == 'task') $objectID = $this->loadModel('task')->createTaskFromGitlabIssue($clonedObject, $executionID);
|
||||
if($objectType == 'bug') $objectID = $this->loadModel('bug')->createBugFromGitlabIssue($clonedObject, $executionID);
|
||||
if($objectType == 'story') $objectID = $this->loadModel('story')->createStoryFromGitlabIssue($clonedObject, $executionID);
|
||||
|
||||
if($objectID)
|
||||
{
|
||||
$objectType = $objectTypeList[$issueID];
|
||||
$this->loadModel('action')->create($objectType, $objectID, 'ImportFromGitlab', '', $issueID);
|
||||
|
||||
$issue = $this->gitlab->apiGetSingleIssue($gitlabID, $projectID, $issueID);
|
||||
$issue->objectType = $objectType;
|
||||
$issue->objectID = 0; // Meet the required parameters for issueToZentaoObject.
|
||||
if(isset($issue->assignee)) $issue->assignee_id = $issue->assignee->id;
|
||||
$issue->updated_by_id = $issue->author->id; // Here can be replaced by current zentao user.
|
||||
|
||||
$object = $this->gitlab->issueToZentaoObject($issue, $gitlabID);
|
||||
$object->product = $productList[$issueID];
|
||||
$object->execution = $executionID;
|
||||
$clonedObject = clone $object;
|
||||
|
||||
if($objectType == 'task') $objectID = $this->loadModel('task')->createTaskFromGitlabIssue($clonedObject, $executionID);
|
||||
if($objectType == 'bug') $objectID = $this->loadModel('bug')->createBugFromGitlabIssue($clonedObject, $executionID);
|
||||
if($objectType == 'story') $objectID = $this->loadModel('story')->createStoryFromGitlabIssue($clonedObject, $executionID);
|
||||
|
||||
if($objectID)
|
||||
{
|
||||
$object->id = $objectID;
|
||||
$this->gitlab->saveImportedIssue($gitlabID, $projectID, $objectType, $objectID, $issue, $object);
|
||||
}
|
||||
else
|
||||
{
|
||||
$failedIssues[] = $issue->iid;
|
||||
}
|
||||
$object->id = $objectID;
|
||||
$this->gitlab->saveImportedIssue($gitlabID, $projectID, $objectType, $objectID, $issue, $object);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($productList[$issueID] != 0) return $this->send(array('result' => 'fail', 'message' => $this->lang->gitlab->importIssueError, 'locate' => $this->server->http_referer));
|
||||
$failedIssues[] = $issue->iid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,25 @@ function addItem(obj)
|
||||
*/
|
||||
function deleteItem(obj)
|
||||
{
|
||||
if($('#teamForm .table tbody').children().length < 2) return false;
|
||||
if($('#teamForm .table-form tbody').children().length < 2) return false;
|
||||
$(obj).closest('tr').remove();
|
||||
}
|
||||
}
|
||||
|
||||
$(document).on('change', '[id^="levels"]', function()
|
||||
{
|
||||
$tr = $(this).closest('tr');
|
||||
$next = $(this).closest('td').next()
|
||||
var ownerLevel = 50;
|
||||
if($(this).val() == ownerLevel)
|
||||
{
|
||||
$next.prepend('<input type="text" value="" class="form-control disabled" disabled autocomplete="off" />');
|
||||
$next.find('[id^="expires"]').addClass('hidden');
|
||||
$tr.find('a[onclick^="deleteItem"]').addClass('disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$next.find('[id^="expires"]').removeClass('hidden');
|
||||
$next.find('input.disabled').remove();
|
||||
$tr.find('a[onclick^="deleteItem"]').removeClass('disabled');
|
||||
}
|
||||
})
|
||||
|
||||
@@ -41,6 +41,6 @@ function addItem(obj)
|
||||
*/
|
||||
function deleteItem(obj)
|
||||
{
|
||||
if($('#teamForm .table tbody').children().length < 2) return false;
|
||||
if($('#teamForm .table-form tbody').children().length < 2) return false;
|
||||
$(obj).closest('tr').remove();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ $lang->gitlab->lblCreate = 'Create GitLab Server';
|
||||
$lang->gitlab->desc = 'Description';
|
||||
$lang->gitlab->tokenFirst = 'When the Token is not empty, the Token will be used first';
|
||||
$lang->gitlab->tips = 'When using a password, please disable the "Prevent cross-site request forgery" option in the GitLab global security settings.';
|
||||
$lang->gitlab->emptyError = "cannot be empty";
|
||||
$lang->gitlab->emptyError = " cannot be empty";
|
||||
$lang->gitlab->createSuccess = "Create success";
|
||||
|
||||
$lang->gitlab->placeholder = new stdclass;
|
||||
@@ -91,12 +91,14 @@ $lang->gitlab->apiError[1] = 'public is not allowed in a private group.';
|
||||
$lang->gitlab->apiError[2] = 'is too short (minimum is 8 characters)';
|
||||
$lang->gitlab->apiError[3] = "can contain only letters, digits, '_', '-' and '.'. Cannot start with '-', end in '.git' or end in '.atom'";
|
||||
$lang->gitlab->apiError[4] = 'Branch already exists';
|
||||
$lang->gitlab->apiError[5] = 'Failed to save group {:path=>["has already been taken"]}';
|
||||
|
||||
$lang->gitlab->errorLang[0] = 'You cannot set Internal as its Visibility Level, if it is private in GitLab.';
|
||||
$lang->gitlab->errorLang[1] = 'You cannot set Public as its Visibility Level, if it is private in GitLab.';
|
||||
$lang->gitlab->errorLang[2] = 'Password is too short (minimum is 8 characters)';
|
||||
$lang->gitlab->errorLang[3] = 'It should contain only letters, digits, underscore, hyphen and period. It should not start with hypen, or end with .git or .atom.';
|
||||
$lang->gitlab->errorLang[4] = 'Branch already exists.';
|
||||
$lang->gitlab->errorLang[5] = 'Failed to save group, path has already been taken.';
|
||||
|
||||
$lang->gitlab->project = new stdclass;
|
||||
$lang->gitlab->project->id = "Project ID";
|
||||
@@ -184,7 +186,7 @@ $lang->gitlab->group->memberExpiresAt = 'Expiration time
|
||||
$lang->gitlab->group->repeatError = "Group members cannot be added repeatedly";
|
||||
|
||||
$lang->gitlab->branch = new stdclass();
|
||||
$lang->gitlab->branch->name = 'Branch Name';
|
||||
$lang->gitlab->branch->name = 'Branch name';
|
||||
$lang->gitlab->branch->from = 'Create from';
|
||||
$lang->gitlab->branch->create = 'Create';
|
||||
$lang->gitlab->branch->lastCommitter = 'Last Committer';
|
||||
|
||||
@@ -91,12 +91,14 @@ $lang->gitlab->apiError[1] = 'public is not allowed in a private group.';
|
||||
$lang->gitlab->apiError[2] = 'is too short (minimum is 8 characters)';
|
||||
$lang->gitlab->apiError[3] = "can contain only letters, digits, '_', '-' and '.'. Cannot start with '-', end in '.git' or end in '.atom'";
|
||||
$lang->gitlab->apiError[4] = 'Branch already exists';
|
||||
$lang->gitlab->apiError[5] = 'Failed to save group {:path=>["has already been taken"]}';
|
||||
|
||||
$lang->gitlab->errorLang[0] = '私有分组的项目,可见性级别不能设为内部。';
|
||||
$lang->gitlab->errorLang[1] = '私有分组的项目,可见性级别不能设为公开。';
|
||||
$lang->gitlab->errorLang[2] = '密码太短(最少8个字符)';
|
||||
$lang->gitlab->errorLang[3] = "只能包含字母、数字、'.'-'和'.'。不能以'-'开头、以'.git'结尾或以'.atom'结尾。";
|
||||
$lang->gitlab->errorLang[4] = '分支名已存在。';
|
||||
$lang->gitlab->errorLang[5] = '保存失败,群组URL路径已经被使用。';
|
||||
|
||||
$lang->gitlab->project = new stdclass;
|
||||
$lang->gitlab->project->id = "项目ID";
|
||||
|
||||
+42
-42
@@ -2050,15 +2050,15 @@ class gitlabModel extends model
|
||||
if(empty($project->path)) dao::$errors['path'][] = $this->lang->gitlab->project->emptyPathError;
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$reponse = $this->apiCreateProject($gitlabID, $project);
|
||||
$response = $this->apiCreateProject($gitlabID, $project);
|
||||
|
||||
if(!empty($reponse->id))
|
||||
if(!empty($response->id))
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabproject', $reponse->id, 'created', '', $reponse->name);
|
||||
$this->loadModel('action')->create('gitlabproject', $response->id, 'created', '', $response->name);
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($reponse);
|
||||
return $this->apiErrorHandling($response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2074,15 +2074,15 @@ class gitlabModel extends model
|
||||
if(empty($project->name)) dao::$errors['name'][] = $this->lang->gitlab->project->emptyNameError;
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$reponse = $this->apiUpdateProject($gitlabID, $project);
|
||||
$response = $this->apiUpdateProject($gitlabID, $project);
|
||||
|
||||
if(!empty($reponse->id))
|
||||
if(!empty($response->id))
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabproject', $project->id, 'edited', '', $project->name);
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($reponse);
|
||||
return $this->apiErrorHandling($response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2119,11 +2119,11 @@ class gitlabModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
$reponse = $this->apiCreateUser($gitlabID, $user);
|
||||
$response = $this->apiCreateUser($gitlabID, $user);
|
||||
|
||||
if(!empty($reponse->id))
|
||||
if(!empty($response->id))
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabuser', $reponse->id, 'created', '', $reponse->name);
|
||||
$this->loadModel('action')->create('gitlabuser', $response->id, 'created', '', $response->name);
|
||||
|
||||
/* Bind user. */
|
||||
if($user->account)
|
||||
@@ -2132,13 +2132,13 @@ class gitlabModel extends model
|
||||
$userBind->providerID = $gitlabID;
|
||||
$userBind->providerType = 'gitlab';
|
||||
$userBind->account = $user->account;
|
||||
$userBind->openID = $reponse->id;
|
||||
$userBind->openID = $response->id;
|
||||
$this->dao->insert(TABLE_OAUTH)->data($userBind)->exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($reponse);
|
||||
return $this->apiErrorHandling($response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2179,14 +2179,14 @@ class gitlabModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
$reponse = $this->apiUpdateUser($gitlabID, $user);
|
||||
$response = $this->apiUpdateUser($gitlabID, $user);
|
||||
|
||||
if(!empty($reponse->id))
|
||||
if(!empty($response->id))
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabuser', $reponse->id, 'edited', '', $reponse->name);
|
||||
$this->loadModel('action')->create('gitlabuser', $response->id, 'edited', '', $response->name);
|
||||
|
||||
/* Delete old bind. */
|
||||
$this->dao->delete()->from(TABLE_OAUTH)->where('providerType')->eq('gitlab')->andWhere('providerID')->eq($gitlabID)->andWhere('openID')->eq($reponse->id)->andWhere('account')->ne($user->account)->exec();
|
||||
$this->dao->delete()->from(TABLE_OAUTH)->where('providerType')->eq('gitlab')->andWhere('providerID')->eq($gitlabID)->andWhere('openID')->eq($response->id)->andWhere('account')->ne($user->account)->exec();
|
||||
/* Bind user. */
|
||||
if($user->account && $changeBind)
|
||||
{
|
||||
@@ -2194,13 +2194,13 @@ class gitlabModel extends model
|
||||
$userBind->providerID = $gitlabID;
|
||||
$userBind->providerType = 'gitlab';
|
||||
$userBind->account = $user->account;
|
||||
$userBind->openID = $reponse->id;
|
||||
$userBind->openID = $response->id;
|
||||
$this->dao->replace(TABLE_OAUTH)->data($userBind)->exec();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($reponse);
|
||||
return $this->apiErrorHandling($response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2218,15 +2218,15 @@ class gitlabModel extends model
|
||||
if(empty($group->path)) dao::$errors['path'][] = $this->lang->gitlab->group->path . $this->lang->gitlab->group->emptyError;
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$reponse = $this->apiCreateGroup($gitlabID, $group);
|
||||
$response = $this->apiCreateGroup($gitlabID, $group);
|
||||
|
||||
if(!empty($reponse->id))
|
||||
if(!empty($response->id))
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabgroup', $reponse->id, 'created', '', $reponse->name);
|
||||
$this->loadModel('action')->create('gitlabgroup', $response->id, 'created', '', $response->name);
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($reponse);
|
||||
return $this->apiErrorHandling($response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2243,15 +2243,15 @@ class gitlabModel extends model
|
||||
if(empty($group->name)) dao::$errors['name'][] = $this->lang->gitlab->group->name . $this->lang->gitlab->group->emptyError;
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$reponse = $this->apiUpdateGroup($gitlabID, $group);
|
||||
$response = $this->apiUpdateGroup($gitlabID, $group);
|
||||
|
||||
if(!empty($reponse->id))
|
||||
if(!empty($response->id))
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabgroup', $reponse->id, 'edited', '', $reponse->name);
|
||||
$this->loadModel('action')->create('gitlabgroup', $response->id, 'edited', '', $response->name);
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($reponse);
|
||||
return $this->apiErrorHandling($response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2270,41 +2270,41 @@ class gitlabModel extends model
|
||||
if(empty($branch->ref)) dao::$errors['ref'][] = $this->lang->gitlab->branch->from . $this->lang->gitlab->emptyError;
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$reponse = $this->apiCreateBranch($gitlabID, $projectID, $branch);
|
||||
$response = $this->apiCreateBranch($gitlabID, $projectID, $branch);
|
||||
|
||||
if(!empty($reponse->name))
|
||||
if(!empty($response->name))
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabbranch', 0, 'created', '', $reponse->name);
|
||||
$this->loadModel('action')->create('gitlabbranch', 0, 'created', '', $response->name);
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($reponse);
|
||||
return $this->apiErrorHandling($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Api error handling.
|
||||
*
|
||||
* @param object $reponse
|
||||
* @param object $response
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function apiErrorHandling($reponse)
|
||||
public function apiErrorHandling($response)
|
||||
{
|
||||
if(!empty($reponse->error))
|
||||
if(!empty($response->error))
|
||||
{
|
||||
dao::$errors[] = $reponse->error;
|
||||
dao::$errors[] = $response->error;
|
||||
return false;
|
||||
}
|
||||
if(!empty($reponse->message))
|
||||
if(!empty($response->message))
|
||||
{
|
||||
if(is_string($reponse->message))
|
||||
if(is_string($response->message))
|
||||
{
|
||||
$errorKey = array_search($reponse->message, $this->lang->gitlab->apiError);
|
||||
dao::$errors[] = $errorKey === false ? $reponse->message : zget($this->lang->gitlab->errorLang, $errorKey);
|
||||
$errorKey = array_search($response->message, $this->lang->gitlab->apiError);
|
||||
dao::$errors[] = $errorKey === false ? $response->message : zget($this->lang->gitlab->errorLang, $errorKey);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($reponse->message as $field => $fieldErrors)
|
||||
foreach($response->message as $field => $fieldErrors)
|
||||
{
|
||||
foreach($fieldErrors as $error)
|
||||
{
|
||||
@@ -2315,7 +2315,7 @@ class gitlabModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
if(!$reponse) dao::$errors[] = false;
|
||||
if(!$response) dao::$errors[] = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2397,9 +2397,9 @@ class gitlabModel extends model
|
||||
$singleBranch = $this->apiGetSingleBranchPriv($gitlabID, $projectID, $priv->name);
|
||||
if(empty($branch) && !empty($singleBranch->id)) dao::$errors['name'][] = $this->lang->gitlab->branch->issetPrivNameError;
|
||||
if(dao::isError()) return false;
|
||||
if(!empty($branch) && !empty($singleBranch->id)) $this->apiDeleteBranchPriv($gitlabID, $projectID, $branch);
|
||||
if(!empty($branch) && !empty($singleBranch->id)) $this->apiDeleteBranchPriv($gitlabID, $projectID, $branch);
|
||||
|
||||
$response = $this->apiCreateBranchPriv($gitlabID, $projectID, $priv);
|
||||
$response = $this->apiCreateBranchPriv($gitlabID, $projectID, $priv);
|
||||
|
||||
if(!empty($response->id))
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan='2'><?php echo $lang->gitlab->gitlabAccount;?></th>
|
||||
<th><?php echo $lang->gitlab->zentaoAccount;?></th>
|
||||
<th class='w-150px'><?php echo $lang->gitlab->zentaoAccount;?></th>
|
||||
<th class='w-150px'><?php echo $lang->gitlab->bindingStatus;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -51,7 +51,8 @@
|
||||
<td><?php echo html::select("zentaoUsers[$gitlabUser->id]", $userPairs, $gitlabUser->zentaoAccount, "class='form-control select chosen'" );?></td>
|
||||
<td>
|
||||
<?php if(isset($bindedUsers[$gitlabUser->zentaoAccount])):?>
|
||||
<?php if(!empty(zget($userPairs, $gitlabUser->zentaoAccount, ''))):?>
|
||||
<?php $zentaoAccount = zget($userPairs, $gitlabUser->zentaoAccount, '');?>
|
||||
<?php if(!empty($zentaoAccount)):?>
|
||||
<?php echo $lang->gitlab->binded;?>
|
||||
<?php else:?>
|
||||
<?php echo '<span class="text-red">' . $lang->gitlab->bindedError . '</span>';?>
|
||||
|
||||
@@ -47,11 +47,11 @@
|
||||
<td class='c-actions text-left'>
|
||||
<?php
|
||||
$disabled = !empty($gitlab->isAdminToken) ? '' : 'disabled';
|
||||
common::printLink('gitlab', 'browseProject', "gitlabID=$id", "<i class='icon icon-list-box'></i> ", '',"title={$lang->gitlab->browseProject} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'browseGroup', "gitlabID=$id", "<i class='icon icon-groups'></i> ", '', "title={$lang->gitlab->browseGroup} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'edit', "gitlabID=$id", "<i class='icon icon-edit'></i> ", '',"title={$lang->gitlab->edit} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'browseUser', "gitlabID=$id", "<i class='icon icon-person'></i> ", '', "title={$lang->gitlab->browseUser} class='btn {$disabled}' ,'disabled'");
|
||||
common::printLink('gitlab', 'bindUser', "id=$id", "<i class='icon icon-link'></i> ", '', "title={$lang->gitlab->bindUser} class='btn {$disabled}' ,'disabled'");
|
||||
common::printLink('gitlab', 'browseProject', "gitlabID=$id", "<i class='icon icon-list-box'></i> ", '',"title='{$lang->gitlab->browseProject}' class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'browseGroup', "gitlabID=$id", "<i class='icon icon-groups'></i> ", '', "title='{$lang->gitlab->browseGroup}' class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'edit', "gitlabID=$id", "<i class='icon icon-edit'></i> ", '',"title='{$lang->gitlab->edit}' class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'browseUser', "gitlabID=$id", "<i class='icon icon-person'></i> ", '', "title='{$lang->gitlab->browseUser}' class='btn {$disabled}' ,'disabled'");
|
||||
common::printLink('gitlab', 'bindUser', "id=$id", "<i class='icon icon-link'></i> ", '', "title='{$lang->gitlab->bindUser}' class='btn {$disabled}' ,'disabled'");
|
||||
if(common::hasPriv('gitlab', 'delete')) echo html::a($this->createLink('gitlab', 'delete', "gitlabID=$id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->gitlab->delete}' class='btn'");
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -54,8 +54,8 @@
|
||||
<td class='text' title='<?php echo substr($gitlabGroup->created_at, 0, 10);?>'><?php echo substr($gitlabGroup->created_at, 0, 10);?></td>
|
||||
<td class='c-actions text-left'>
|
||||
<?php
|
||||
common::printLink('gitlab', 'manageGroupMembers', "gitlabID=$gitlabID&groupID=$gitlabGroup->id", "<i class='icon icon-team'></i> ", '',"title={$lang->gitlab->group->manageMembers} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'editGroup', "gitlabID=$gitlabID&groupID=$gitlabGroup->id", "<i class='icon icon-edit'></i> ", '', "title={$lang->gitlab->group->edit} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'manageGroupMembers', "gitlabID=$gitlabID&groupID=$gitlabGroup->id", "<i class='icon icon-team'></i> ", '',"title='{$lang->gitlab->group->manageMembers}' class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'editGroup', "gitlabID=$gitlabID&groupID=$gitlabGroup->id", "<i class='icon icon-edit'></i> ", '', "title='{$lang->gitlab->group->edit}' class='btn btn-primary'");
|
||||
if(common::hasPriv('gitlab', 'delete')) echo html::a($this->createLink('gitlab', 'deleteGroup', "gitlabID=$gitlabID&groupID=$gitlabGroup->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->gitlab->deleteGroup}' class='btn'");
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -67,9 +67,10 @@
|
||||
<td class='text' title='<?php echo substr($gitlabProject->last_activity_at, 0, 10);?>'><?php echo substr($gitlabProject->last_activity_at, 0, 10);?></td>
|
||||
<td class='c-actions text-left'>
|
||||
<?php
|
||||
common::printLink('gitlab', 'browseBranch', "gitlabID=$gitlabID&projectID=$gitlabProject->id", "<i class='icon icon-treemap'></i> ", '', "title={$lang->gitlab->browseBranch} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'browseBranchPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", "<i class='icon icon-branch-lock'></i> ", '', "title={$lang->gitlab->branch->accessLevel} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'editProject', "gitlabID=$gitlabID&projectID=$gitlabProject->id", "<i class='icon icon-edit'></i> ", '', "title={$lang->gitlab->project->edit} class='btn btn-primary'");
|
||||
|
||||
common::printLink('gitlab', 'browseBranch', "gitlabID=$gitlabID&projectID=$gitlabProject->id", "<i class='icon icon-treemap'></i> ", '', "title='{$lang->gitlab->browseBranch}' class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'browseBranchPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", "<i class='icon icon-branch-lock'></i> ", '', "title='{$lang->gitlab->branch->accessLevel}' class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'editProject', "gitlabID=$gitlabID&projectID=$gitlabProject->id", "<i class='icon icon-edit'></i> ", '', "title='{$lang->gitlab->project->edit}' class='btn btn-primary'");
|
||||
if(common::hasPriv('gitlab', 'delete')) echo html::a($this->createLink('gitlab', 'deleteProject', "gitlabID=$gitlabID&projectID=$gitlabProject->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->gitlab->deleteProject}' class='btn'");
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
<td class='text' title='<?php echo substr($gitlabUser->lastActivityOn, 0, 10);?>'><?php echo substr($gitlabUser->lastActivityOn, 0, 10);?></td>
|
||||
<td class='c-actions text-left'>
|
||||
<?php
|
||||
common::printLink('gitlab', 'editUser', "gitlabID=$gitlabID&userID=$gitlabUser->id", "<i class='icon icon-edit'></i> ", '', "title={$lang->gitlab->user->edit} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'editUser', "gitlabID=$gitlabID&userID=$gitlabUser->id", "<i class='icon icon-edit'></i> ", '', "title='{$lang->gitlab->user->edit}' class='btn btn-primary'");
|
||||
if(common::hasPriv('gitlab', 'delete')) echo html::a($this->createLink('gitlab', 'deleteUser', "gitlabID=$gitlabID&userID=$gitlabUser->id"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->gitlab->deleteUser}' class='btn'");
|
||||
?>
|
||||
</td>
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
<form id='gitlabForm' method='post' class='form-ajax'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->project->name;?></th>
|
||||
<th class='w-150px'><?php echo $lang->gitlab->project->name;?></th>
|
||||
<td class='required'><?php echo html::input('name', '', "class='form-control' placeholder='{$lang->gitlab->project->name}'");?></td>
|
||||
<td class="tips-git"></td>
|
||||
<td class="tips-git w-p20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->project->url;?></th>
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
<form id='gitlabForm' method='post' class='form-ajax'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->project->id;?></th>
|
||||
<th class='w-150px'><?php echo $lang->gitlab->project->id;?></th>
|
||||
<td><?php echo html::input('id', $project->id, "class='form-control' readonly placeholder='{$lang->gitlab->project->id}'");?></td>
|
||||
<td class="tips-git w-p20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->project->name;?></th>
|
||||
|
||||
@@ -19,18 +19,24 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $ownerLevel = 50;?>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($currentMembers as $member):?>
|
||||
<tr>
|
||||
<td><?php echo html::input("names[$i]", $member->name, "class='form-control' readonly");?></td>
|
||||
<td><?php echo html::select("levels[$i]", array(''=>'') + $this->lang->gitlab->accessLevels, $member->access_level, "class='form-control chosen'");?></td>
|
||||
<td>
|
||||
<?php if($member->access_level == $ownerLevel):?>
|
||||
<input type="text" value="" class="form-control disabled" disabled autocomplete="off" />
|
||||
<?php echo html::input("expires[$i]", $member->expires_at, "class='form-control form-date hidden'");?>
|
||||
<?php else:?>
|
||||
<?php echo html::input("expires[$i]", $member->expires_at, "class='form-control form-date'");?>
|
||||
<?php endif;?>
|
||||
<?php echo html::hidden("ids[$i]", $member->id);?>
|
||||
</td>
|
||||
<td class='c-actions text-center'>
|
||||
<?php echo html::a('javascript:;', "<i class='icon-plus'></i>", '', "onclick='addItem(this)' class='btn btn-link'");?>
|
||||
<?php echo html::a('javascript:;', "<i class='icon icon-close'></i>", '', "onclick='deleteItem(this)' class='btn btn-link'");?>
|
||||
<?php echo html::a('javascript:;', "<i class='icon icon-close'></i>", '', "onclick='deleteItem(this)' class='btn btn-link" . ($member->access_level == $ownerLevel ? ' disabled' : '') . "'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
|
||||
Reference in New Issue
Block a user