* Sync 18 version code.
This commit is contained in:
@@ -74,63 +74,3 @@ $config->gitlab->dtable->bindUser->fieldList['status']['title'] = $lang->gitlab-
|
||||
$config->gitlab->dtable->bindUser->fieldList['status']['type'] = 'html';
|
||||
$config->gitlab->dtable->bindUser->fieldList['status']['width'] = 100;
|
||||
$config->gitlab->dtable->bindUser->fieldList['status']['map'] = $lang->gitlab->bindStatus;
|
||||
|
||||
$config->gitlab->dtable->project = new stdclass();
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['id']['title'] = $lang->gitlab->id;
|
||||
$config->gitlab->dtable->project->fieldList['id']['sortType'] = true;
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['name']['title'] = $lang->gitlab->project->name;
|
||||
$config->gitlab->dtable->project->fieldList['name']['name'] = 'name_with_namespace';
|
||||
$config->gitlab->dtable->project->fieldList['name']['sortType'] = true;
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['star']['title'] = '';
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['lastUpdate']['title'] = $lang->gitlab->lastUpdate;
|
||||
$config->gitlab->dtable->project->fieldList['lastUpdate']['type'] = 'date';
|
||||
$config->gitlab->dtable->project->fieldList['lastUpdate']['sortType'] = false;
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['name'] = 'actions';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['title'] = $lang->actions;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['type'] = 'actions';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['menu'] = array('browseBranch', 'browseTag', 'manageBranchPriv', 'manageTagPriv', 'manageProjectMembers', 'createWebhook', 'importIssue', 'editProject', 'deleteProject');
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['browseBranch']['icon'] = 'treemap';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['browseBranch']['hint'] = $lang->gitlab->browseBranch;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['browseBranch']['url'] = helper::createLink('gitlab', 'browseBranch', 'gitlabID={id}&projectID={projectID}');
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['browseTag']['icon'] = 'tag';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['browseTag']['hint'] = $lang->gitlab->browseTag;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['browseTag']['url'] = array('module' => 'gitlab', 'method' => 'browseTag', 'params' => 'gitlabID={id}&projectID={projectID}');
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['browseTag']['url'] = helper::createLink('gitlab', 'browseTag', 'gitlabID={id}&projectID={projectID}');
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageBranchPriv']['icon'] = 'tag';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageBranchPriv']['hint'] = $lang->gitlab->browseBranchPriv;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageBranchPriv']['url'] = helper::createLink('gitlab', 'manageBranchPriv', 'gitlabID={id}&projectID={projectID}');
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageTagPriv']['icon'] = 'tag-lock';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageTagPriv']['hint'] = $lang->gitlab->browseTagPriv;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageTagPriv']['url'] = helper::createLink('gitlab', 'manageTagPriv', 'gitlabID={id}&projectID={projectID}');
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageProjectMembers']['icon'] = 'team';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageProjectMembers']['hint'] = $lang->gitlab->manageProjectMembers;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['manageProjectMembers']['url'] = helper::createLink('gitlab', 'manageProjectMembers', 'repoID={repoID}');
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['createWebhook']['icon'] = 'change';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['createWebhook']['hint'] = $lang->gitlab->createWebhook;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['createWebhook']['url'] = helper::createLink('gitlab', 'createWebhook', 'repoID={repoID}');
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['createWebhook']['className'] = 'ajax-submit';
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['importIssue']['icon'] = 'link';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['importIssue']['hint'] = $lang->gitlab->importIssue;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['importIssue']['url'] = array('module' => 'gitlab', 'method' => 'importIssue', 'params' => 'gitlabID={id}&projectID={projectID}');
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['importIssue']['url'] = helper::createLink('gitlab', 'importIssue', 'gitlabID={id}&projectID={projectID}');
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['editProject']['icon'] = 'edit';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['editProject']['hint'] = $lang->gitlab->editProject;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['editProject']['url'] = helper::createLink('gitlab', 'editProject', 'gitlabID={id}&projectID={projectID}');
|
||||
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['deleteProject']['icon'] = 'trash';
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['deleteProject']['hint'] = $lang->gitlab->deleteProject;
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['deleteProject']['url'] = helper::createLink('gitlab', 'deleteProject', 'gitlabID={id}&projectID={projectID}');
|
||||
$config->gitlab->dtable->project->fieldList['actions']['list']['deleteProject']['className'] = 'ajax-submit';
|
||||
|
||||
@@ -15,7 +15,7 @@ window.renderGitlabUser = function(result, {row})
|
||||
return result;
|
||||
}
|
||||
|
||||
window.bindUser = function()
|
||||
window.bindUser = function(e)
|
||||
{
|
||||
const myDTable = $('#table-gitlab-binduser').zui('dtable');
|
||||
const formData = myDTable.$.getFormData();
|
||||
@@ -25,10 +25,12 @@ window.bindUser = function()
|
||||
postData['gitlabUserNames[]'] = [];
|
||||
for(i in bindData)
|
||||
{
|
||||
postData['gitlabUserNames[]'].push(bindData[i].gitlabID);
|
||||
postData['gitlabUserNames[' + bindData[i].gitlabID + ']'] = bindData[i].gitlabUser;
|
||||
postData['zentaoUsers[' + bindData[i].gitlabID + ']'] = formData['zentaoUsers[' + bindData[i].gitlabID + ']'];
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
$.ajaxSubmit({
|
||||
url: $.createLink('gitlab', 'bindUser', 'gitlabID=' + gitlabID + '&type=' + type),
|
||||
data: postData
|
||||
|
||||
+5
-15
@@ -675,7 +675,8 @@ class gitlabModel extends model
|
||||
$allResults = array();
|
||||
for($page = 1; true; $page++)
|
||||
{
|
||||
$results = json_decode(commonModel::http($url . "&statistics=true&order_by={$order}&sort={$sort}&page={$page}&per_page=100&all_available=true"));
|
||||
$pageUrl = $url . "&statistics=true&order_by={$order}&sort={$sort}&page={$page}&per_page=100&all_available=true";
|
||||
$results = json_decode(commonModel::http($pageUrl));
|
||||
if(!is_array($results)) break;
|
||||
if(!empty($results)) $allResults = array_merge($allResults, $results);
|
||||
if(count($results) < 100) break;
|
||||
@@ -3000,25 +3001,14 @@ class gitlabModel extends model
|
||||
* 判断按钮是否可点击。
|
||||
* Adjust the action clickable.
|
||||
*
|
||||
* @param object $object
|
||||
* @param object $instance
|
||||
* @param string $action
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function isClickable(object $object, string $action): bool
|
||||
public function isClickable(object $gitlab, string $action): bool
|
||||
{
|
||||
if(!commonModel::hasPriv('space', 'browse')) return false;
|
||||
|
||||
if($action == 'browseBranch') return $object->isDeveloper;
|
||||
if($action == 'browseTag') return $object->isDeveloper;
|
||||
if($action == 'manageProjectMembers') return $object->hasRepo;
|
||||
if($action == 'createWebhook') return $object->hasRepo;
|
||||
if($action == 'manageBranchPriv') return $object->defaultBranch;
|
||||
if($action == 'manageTagPriv') return $object->defaultBranch;
|
||||
if($action == 'editProject') return $object->defaultBranch;
|
||||
if($action == 'deleteProject') return $object->defaultBranch;
|
||||
|
||||
return true;
|
||||
return commonModel::hasPriv('space', 'browse');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -50,7 +50,7 @@ form
|
||||
array(
|
||||
'text' => $lang->save,
|
||||
'btnType' => 'primary',
|
||||
'onClick' => jsRaw("() => {bindUser()}")
|
||||
'onClick' => jsRaw("bindUser")
|
||||
),
|
||||
array(
|
||||
'text' => $lang->goback,
|
||||
|
||||
Reference in New Issue
Block a user