Merge branch 'cyy_60565' into 'zenops_38'
Finish task #60565,60566. See merge request easycorp/zentaopms!4465
This commit is contained in:
+91
-370
@@ -911,176 +911,6 @@ class gitlab extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse gitlab protect branch.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browseBranchPriv($gitlabID, $projectID, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
|
||||
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
$keyword = fixer::input('post')->setDefault('keyword', '')->get('keyword');
|
||||
$branches = $this->gitlab->apiGetBranchPrivs($gitlabID, $projectID, $keyword, $orderBy);
|
||||
|
||||
/* Pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$recTotal = count($branches);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$branchList = array_chunk($branches, $pager->recPerPage);
|
||||
|
||||
$this->view->keyword = $keyword;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseBranchPriv;
|
||||
$this->view->levelLang = $this->lang->gitlab->branch->branchCreationLevelList;
|
||||
$this->view->gitlabID = $gitlabID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->project = $project;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->branchList = empty($branchList) ? $branchList: $branchList[$pageID - 1];
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a gitlab protect branch.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createBranchPriv($gitlabID, $projectID, $branch = '')
|
||||
{
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
|
||||
$project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
/* Fix error when request type is PATH_INFO and the branch name contains '-'.*/
|
||||
if($branch) $branch = urldecode(helper::safe64Decode($branch));
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$this->gitlab->createBranchPriv($gitlabID, $projectID, $branch);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browseBranchPriv', "gitlabID=$gitlabID&projectID=$projectID")));
|
||||
}
|
||||
|
||||
$branchPriv = new stdClass();
|
||||
$branchPriv->name = '';
|
||||
$branchPriv->mergeAccessLevel = 40; // Initialize data, and the operation authority is the maintainers by default.
|
||||
$branchPriv->pushAccessLevel = 40; // Initialize data, and the operation authority is the maintainers by default.
|
||||
|
||||
$title = $this->lang->gitlab->createBranchPriv;
|
||||
|
||||
if($branch)
|
||||
{
|
||||
$title = $this->lang->gitlab->editBranchPriv;
|
||||
$branchPriv = $this->gitlab->apiGetSingleBranchPriv($gitlabID, $projectID, $branch);
|
||||
$branchPriv->name = helper::safe64Encode(urlencode($branchPriv->name));
|
||||
$branchPriv->mergeAccessLevel = $this->gitlab->checkAccessLevel($branchPriv->merge_access_levels);
|
||||
$branchPriv->pushAccessLevel = $this->gitlab->checkAccessLevel($branchPriv->push_access_levels);
|
||||
}
|
||||
|
||||
$gitlabBranches = $this->gitlab->apiGetBranches($gitlabID, $projectID);
|
||||
$protectBranches = $this->gitlab->apiGetBranchPrivs($gitlabID, $projectID, '', 'name_asc');
|
||||
$protectNames = array_keys($protectBranches);
|
||||
|
||||
$branches = array();
|
||||
foreach($gitlabBranches as $oneBranch)
|
||||
{
|
||||
if(!in_array($oneBranch->name, $protectNames) || $oneBranch->name == $branch)
|
||||
{
|
||||
$branchName = helper::safe64Encode(urlencode($oneBranch->name));
|
||||
$branches[$branchName] = $oneBranch->name;
|
||||
}
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $title;
|
||||
$this->view->pageTitle = $title;
|
||||
$this->view->gitlabID = $gitlabID;
|
||||
$this->view->branch = $branch;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->branches = $branches;
|
||||
$this->view->branchPriv = $branchPriv;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a gitlab branch protect.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $branch
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editBranchPriv($gitlabID, $projectID, $branch)
|
||||
{
|
||||
echo $this->fetch('gitlab', 'createBranchPriv', "gitlabID=$gitlabID&projectID=$projectID&branch=$branch");
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a gitlab protect branch.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $branch
|
||||
* @param string $confirm
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteBranchPriv($gitlabID, $projectID, $branch, $confirm = 'no')
|
||||
{
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
|
||||
$project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
if($confirm != 'yes')
|
||||
{
|
||||
$branch = urlencode($branch);
|
||||
return print(js::confirm($this->lang->gitlab->branch->confirmDelete , inlink('deleteBranchPriv', "gitlabID=$gitlabID&projectID=$projectID&branch=$branch&confirm=yes")));
|
||||
}
|
||||
|
||||
/* Fix error when request type is PATH_INFO and the branch name contains '-'.*/
|
||||
$branch = urldecode(helper::safe64Decode($branch));
|
||||
$reponse = $this->gitlab->apiDeleteBranchPriv($gitlabID, $projectID, $branch);
|
||||
|
||||
/* If the status code beginning with 20 is returned or empty is returned, it is successful. */
|
||||
if(!$reponse or substr($reponse->message, 0, 2) == '20')
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabbranchPriv', $branch, 'deleted', '', $branch);
|
||||
return print(js::reload('parent'));
|
||||
}
|
||||
|
||||
echo js::alert($reponse->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse gitlab tag.
|
||||
*
|
||||
@@ -1135,206 +965,6 @@ class gitlab extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse gitlab protect tag.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function browseTagPriv($gitlabID, $projectID, $orderBy = 'name_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
|
||||
{
|
||||
$project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
|
||||
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
$this->session->set('gitlabTagPrivList', $this->app->getURI(true));
|
||||
$keyword = fixer::input('post')->setDefault('keyword', '')->get('keyword');
|
||||
|
||||
$gitlabTags = array();
|
||||
$allTags = $this->gitlab->apiGetTags($gitlabID, $projectID);
|
||||
foreach($allTags as $tag)
|
||||
{
|
||||
$gitlabTags[$tag->name] = $tag;
|
||||
}
|
||||
|
||||
$tagList = array();
|
||||
$gitlabProtectTags = $this->gitlab->apiGetTagPrivs($gitlabID, $projectID);
|
||||
foreach($gitlabProtectTags as $gitlabProtectTag)
|
||||
{
|
||||
$tag = new stdClass();
|
||||
$tag->name = $gitlabProtectTag->name;
|
||||
$tag->lastCommitter = isset($gitlabTags[$tag->name]) ? $gitlabTags[$tag->name]->commit->committer_name : '';
|
||||
$tag->accessLevels = $gitlabProtectTag->create_access_levels;
|
||||
|
||||
$tagList[] = $tag;
|
||||
}
|
||||
|
||||
/* Data search. */
|
||||
if($keyword)
|
||||
{
|
||||
foreach($tagList as $key => $tag)
|
||||
{
|
||||
if(strpos($tag->name, $keyword) === false) unset($tagList[$key]);
|
||||
}
|
||||
$tagList = array_values($tagList);
|
||||
}
|
||||
|
||||
/* Data sort. */
|
||||
list($order, $sort) = explode('_', $orderBy);
|
||||
$orderList = array();
|
||||
foreach($tagList as $tag) $orderList[] = $tag->$order;
|
||||
array_multisort($orderList, $sort == 'desc' ? SORT_DESC : SORT_ASC, $tagList);
|
||||
|
||||
/* Pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$recTotal = count($tagList);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$tagList = array_chunk($tagList, $pager->recPerPage);
|
||||
|
||||
$this->view->gitlab = $this->gitlab->getByID($gitlabID);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseTagPriv;
|
||||
$this->view->gitlabID = $gitlabID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->keyword = $keyword;
|
||||
$this->view->project = $project;
|
||||
$this->view->gitlabTagList = empty($tagList) ? $tagList: $tagList[$pageID - 1];
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a gitlab protect tag.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createTagPriv($gitlabID, $projectID)
|
||||
{
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
|
||||
$project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$this->gitlab->createTagPriv($gitlabID, $projectID);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browseTagPriv', "gitlabID=$gitlabID&projectID=$projectID")));
|
||||
}
|
||||
|
||||
$gitlabTags = $this->gitlab->apiGetTags($gitlabID, $projectID);
|
||||
$protectTags = $this->gitlab->apiGetTagPrivs($gitlabID, $projectID, '', 'name_asc');
|
||||
$protectNames = array_keys($protectTags);
|
||||
|
||||
$tags = array();
|
||||
foreach($gitlabTags as $tag)
|
||||
{
|
||||
if(!in_array($tag->name, $protectNames)) $tags[$tag->name] = $tag->name;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->createTagPriv;
|
||||
$this->view->gitlabID = $gitlabID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->tags = $tags;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a gitlab protect tag.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $tag
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function editTagPriv($gitlabID, $projectID, $tag = '')
|
||||
{
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
|
||||
$project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
/* Fix error when request type is PATH_INFO and the tag name contains '-'.*/
|
||||
$tag = urldecode(helper::safe64Decode($tag));
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$this->gitlab->createTagPriv($gitlabID, $projectID, $tag);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browseTagPriv', "gitlabID=$gitlabID&projectID=$projectID")));
|
||||
}
|
||||
|
||||
$tagPriv = $this->gitlab->apiGetSingleTagPriv($gitlabID, $projectID, $tag);
|
||||
$tagPriv->createAccessLevel = $this->gitlab->checkAccessLevel($tagPriv->create_access_levels);
|
||||
|
||||
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->editTagPriv;
|
||||
$this->view->gitlabID = $gitlabID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->tagPriv = $tagPriv;
|
||||
$this->view->tag = $tag;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a gitlab protect tag.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $tag
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteTagPriv($gitlabID, $projectID, $tag)
|
||||
{
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
|
||||
$project = $this->gitlab->apiGetSingleProject($gitlabID, $projectID);
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
/* Fix error when request type is PATH_INFO and the tag name contains '-'.*/
|
||||
$tag = urldecode(helper::safe64Decode($tag));
|
||||
$reponse = $this->gitlab->apiDeleteTagPriv($gitlabID, $projectID, $tag);
|
||||
|
||||
/* If the status code beginning with 20 is returned or empty is returned, it is successful. */
|
||||
if(!$reponse or substr($reponse->message, 0, 2) == '20')
|
||||
{
|
||||
$this->loadModel('action')->create('gitlabtagpriv', 0, 'deleted', '', $tag);
|
||||
return print(js::reload('parent'));
|
||||
}
|
||||
|
||||
echo js::alert($reponse->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Import gitlab issue to zentaopms.
|
||||
*
|
||||
@@ -1746,4 +1376,95 @@ class gitlab extends control
|
||||
|
||||
echo js::alert($reponse->message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage a gitlab branch protected.
|
||||
*
|
||||
* @param int $repoID
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function manageBranchPriv($gitlabID, $projectID)
|
||||
{
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
$hasAccessBranches = $this->gitlab->apiGetBranchPrivs($gitlabID, $projectID, '', 'name_asc');
|
||||
foreach($hasAccessBranches as $branch)
|
||||
{
|
||||
$branch->pushAccess = $this->gitlab->checkAccessLevel($branch->push_access_levels);
|
||||
$branch->mergeAccess = $this->gitlab->checkAccessLevel($branch->merge_access_levels);
|
||||
}
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$result = $this->gitlab->manageBranchPrivs($gitlabID, $projectID, $hasAccessBranches);
|
||||
if(!empty($result)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->gitlab->svaeFailed, implode(', ', $result))));
|
||||
|
||||
return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => inlink('browseProject', "gitlabID=$gitlabID")));
|
||||
}
|
||||
$allBranches = $this->gitlab->apiGetBranches($gitlabID, $projectID);
|
||||
$noAccessBranches = array();
|
||||
foreach($allBranches as $branch)
|
||||
{
|
||||
if(!isset($hasAccessBranches[$branch->name])) $noAccessBranches[$branch->name] = $branch->name;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseBranchPriv;
|
||||
$this->view->gitlabID = $gitlabID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->hasAccessBranches = $hasAccessBranches;
|
||||
$this->view->noAccessBranches = $noAccessBranches;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage a gitlab tag protected.
|
||||
*
|
||||
* @param int $repoID
|
||||
* @param int $projectID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function manageTagPriv($gitlabID, $projectID)
|
||||
{
|
||||
if(!$this->app->user->admin)
|
||||
{
|
||||
$openID = $this->gitlab->getUserIDByZentaoAccount($gitlabID, $this->app->user->account);
|
||||
if(!$openID) return print(js::alert($this->lang->gitlab->mustBindUser) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
if(!$this->gitlab->checkUserAccess($gitlabID, $projectID, $project)) return print(js::alert($this->lang->gitlab->noAccess) . js::locate($this->createLink('gitlab', 'browse')));
|
||||
}
|
||||
|
||||
$hasAccessTags = $this->gitlab->apiGetTagPrivs($gitlabID, $projectID, '', 'name_asc');
|
||||
foreach($hasAccessTags as $tag)
|
||||
{
|
||||
$tag->createAccess = $this->gitlab->checkAccessLevel($tag->create_access_levels);
|
||||
}
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$result = $this->gitlab->manageTagPrivs($gitlabID, $projectID, $hasAccessTags);
|
||||
if(!empty($result)) return $this->send(array('result' => 'fail', 'message' => sprintf($this->lang->gitlab->svaeFailed, implode(', ', $result))));
|
||||
|
||||
return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => inlink('browseProject', "gitlabID=$gitlabID")));
|
||||
}
|
||||
$allTags = $this->gitlab->apiGetTags($gitlabID, $projectID);
|
||||
$noAccessTags = array();
|
||||
foreach($allTags as $tag)
|
||||
{
|
||||
if(!isset($hasAccessTags[$tag->name])) $noAccessTags[$tag->name] = $tag->name;
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->gitlab->common . $this->lang->colon . $this->lang->gitlab->browseTagPriv;
|
||||
$this->view->gitlabID = $gitlabID;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->hasAccessTags = $hasAccessTags;
|
||||
$this->view->noAccessTags = $noAccessTags;
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/* Update other picker on change */
|
||||
$.zui.Picker.DEFAULTS.onChange = function(event)
|
||||
{
|
||||
var picker = event.picker;
|
||||
if(!picker.$formItem.is('[name^=branches]')) return;
|
||||
|
||||
var select = picker.$formItem[0];
|
||||
var newItem = event.value.length ? $.extend({}, picker.getListItem(event.value), {disabled: true}) : $.extend({}, picker.getListItem(event.oldValue), {disabled: false});
|
||||
|
||||
$('.user-picker[name^=branches]').each(function()
|
||||
{
|
||||
if(this === select) return;
|
||||
|
||||
var $select = $(this);
|
||||
var selectPicker = $select.data('zui.picker');
|
||||
|
||||
if(selectPicker) selectPicker.updateOptionList([$.extend({}, newItem)]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Save branch priv.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function savePriv()
|
||||
{
|
||||
$('#saveBtn').addClass('hidden');
|
||||
$('#submit').removeClass('hidden');
|
||||
$('#submit').click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add item.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function addItem(obj)
|
||||
{
|
||||
var item = $('#addItem').html().replace(/%i%/g, itemIndex);
|
||||
var $tr = $('<tr class="addedItem">' + item + '</tr>').insertAfter($(obj).closest('tr'));
|
||||
var $accounts = $tr.find('select:first').addClass('user-picker').trigger('list:updated').picker({type: 'user'});
|
||||
itemIndex++;
|
||||
|
||||
var disabledItems = [];
|
||||
$('.user-picker[name^=branches]').each(function()
|
||||
{
|
||||
if(this === $accounts[0]) return;
|
||||
var $select = $(this);
|
||||
var picker = $select.data('zui.picker');
|
||||
if(!picker) return;
|
||||
var selectItem = picker.getListItem(picker.getValue());
|
||||
if(selectItem) disabledItems.push($.extend({}, selectItem, {disabled: true}));
|
||||
});
|
||||
if(disabledItems.length) $accounts.data('zui.picker').updateOptionList(disabledItems);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete item.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function deleteItem(obj)
|
||||
{
|
||||
if($('#privForm .table-form tbody').children().length < 2) return false;
|
||||
$(obj).closest('tr').remove();
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
/* Update other picker on change */
|
||||
$.zui.Picker.DEFAULTS.onChange = function(event)
|
||||
{
|
||||
var picker = event.picker;
|
||||
if(!picker.$formItem.is('[name^=tags]')) return;
|
||||
|
||||
var select = picker.$formItem[0];
|
||||
var newItem = event.value.length ? $.extend({}, picker.getListItem(event.value), {disabled: true}) : $.extend({}, picker.getListItem(event.oldValue), {disabled: false});
|
||||
|
||||
$('.user-picker[name^=tags]').each(function()
|
||||
{
|
||||
if(this === select) return;
|
||||
|
||||
var $select = $(this);
|
||||
var selectPicker = $select.data('zui.picker');
|
||||
|
||||
if(selectPicker) selectPicker.updateOptionList([$.extend({}, newItem)]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Save tag priv.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function savePriv()
|
||||
{
|
||||
$('#saveBtn').addClass('hidden');
|
||||
$('#submit').removeClass('hidden');
|
||||
$('#submit').click();
|
||||
}
|
||||
|
||||
/**
|
||||
* Add item.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function addItem(obj)
|
||||
{
|
||||
var item = $('#addItem').html().replace(/%i%/g, itemIndex);
|
||||
var $tr = $('<tr class="addedItem">' + item + '</tr>').insertAfter($(obj).closest('tr'));
|
||||
var $accounts = $tr.find('select:first').addClass('user-picker').trigger('list:updated').picker({type: 'user'});
|
||||
itemIndex++;
|
||||
|
||||
var disabledItems = [];
|
||||
$('.user-picker[name^=tags]').each(function()
|
||||
{
|
||||
if(this === $accounts[0]) return;
|
||||
var $select = $(this);
|
||||
var picker = $select.data('zui.picker');
|
||||
if(!picker) return;
|
||||
var selectItem = picker.getListItem(picker.getValue());
|
||||
if(selectItem) disabledItems.push($.extend({}, selectItem, {disabled: true}));
|
||||
});
|
||||
if(disabledItems.length) $accounts.data('zui.picker').updateOptionList(disabledItems);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete item.
|
||||
*
|
||||
* @param object $obj
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function deleteItem(obj)
|
||||
{
|
||||
if($('#privForm .table-form tbody').children().length < 2) return false;
|
||||
$(obj).closest('tr').remove();
|
||||
}
|
||||
@@ -34,7 +34,7 @@ $lang->gitlab->browseUser = "User";
|
||||
$lang->gitlab->browseGroup = "Group";
|
||||
$lang->gitlab->browseBranch = "GitLab Branch List";
|
||||
$lang->gitlab->browseTag = "GitLab Tag List";
|
||||
$lang->gitlab->browseTagPriv = "GitLab Tag protected List";
|
||||
$lang->gitlab->browseTagPriv = "Protected tag";
|
||||
$lang->gitlab->gitlabIssue = "GitLab Issue";
|
||||
$lang->gitlab->zentaoProduct = 'Zentao Product';
|
||||
$lang->gitlab->objectType = 'Type'; // task, bug, story
|
||||
@@ -52,14 +52,9 @@ $lang->gitlab->createBranch = 'Add branch';
|
||||
$lang->gitlab->manageGroupMembers = 'Manage group member';
|
||||
$lang->gitlab->createWebhook = 'Create Webhook';
|
||||
$lang->gitlab->browseBranchPriv = 'Protect branch';
|
||||
$lang->gitlab->createBranchPriv = 'Cerate branch protected';
|
||||
$lang->gitlab->editBranchPriv = 'Edit branch protected';
|
||||
$lang->gitlab->deleteBranchPriv = 'Delete branch protected';
|
||||
$lang->gitlab->createTag = 'Create Tag';
|
||||
$lang->gitlab->deleteTag = 'Delete tag';
|
||||
$lang->gitlab->createTagPriv = 'Create tag protected';
|
||||
$lang->gitlab->editTagPriv = 'Edit tag protected';
|
||||
$lang->gitlab->deleteTagPriv = 'Delete tag protected';
|
||||
$lang->gitlab->svaeFailed = '『%s』save failed';
|
||||
|
||||
$lang->gitlab->id = 'ID';
|
||||
$lang->gitlab->name = "Server Name";
|
||||
|
||||
@@ -34,7 +34,7 @@ $lang->gitlab->browseUser = "User";
|
||||
$lang->gitlab->browseGroup = "Group";
|
||||
$lang->gitlab->browseBranch = "GitLab Branch List";
|
||||
$lang->gitlab->browseTag = "GitLab Tag List";
|
||||
$lang->gitlab->browseTagPriv = "GitLab Tag protected List";
|
||||
$lang->gitlab->browseTagPriv = "Protected tag";
|
||||
$lang->gitlab->gitlabIssue = "GitLab Issue";
|
||||
$lang->gitlab->zentaoProduct = 'Zentao Product';
|
||||
$lang->gitlab->objectType = 'Type'; // task, bug, story
|
||||
@@ -52,14 +52,9 @@ $lang->gitlab->createBranch = 'Add branch';
|
||||
$lang->gitlab->manageGroupMembers = 'Manage group member';
|
||||
$lang->gitlab->createWebhook = 'Create Webhook';
|
||||
$lang->gitlab->browseBranchPriv = 'Protect branch';
|
||||
$lang->gitlab->createBranchPriv = 'Cerate branch protected';
|
||||
$lang->gitlab->editBranchPriv = 'Edit branch protected';
|
||||
$lang->gitlab->deleteBranchPriv = 'Delete branch protected';
|
||||
$lang->gitlab->createTag = 'Create Tag';
|
||||
$lang->gitlab->deleteTag = 'Delete tag';
|
||||
$lang->gitlab->createTagPriv = 'Create tag protected';
|
||||
$lang->gitlab->editTagPriv = 'Edit tag protected';
|
||||
$lang->gitlab->deleteTagPriv = 'Delete tag protected';
|
||||
$lang->gitlab->svaeFailed = '『%s』save failed';
|
||||
|
||||
$lang->gitlab->id = 'ID';
|
||||
$lang->gitlab->name = "Server Name";
|
||||
|
||||
@@ -34,7 +34,7 @@ $lang->gitlab->browseUser = "User";
|
||||
$lang->gitlab->browseGroup = "Group";
|
||||
$lang->gitlab->browseBranch = "GitLab Branch List";
|
||||
$lang->gitlab->browseTag = "GitLab Tag List";
|
||||
$lang->gitlab->browseTagPriv = "GitLab Tag protected List";
|
||||
$lang->gitlab->browseTagPriv = "Protected tag";
|
||||
$lang->gitlab->gitlabIssue = "GitLab Issue";
|
||||
$lang->gitlab->zentaoProduct = 'Zentao Product';
|
||||
$lang->gitlab->objectType = 'Type'; // task, bug, story
|
||||
@@ -52,14 +52,9 @@ $lang->gitlab->createBranch = 'Add branch';
|
||||
$lang->gitlab->manageGroupMembers = 'Manage group member';
|
||||
$lang->gitlab->createWebhook = 'Create Webhook';
|
||||
$lang->gitlab->browseBranchPriv = 'Protect branch';
|
||||
$lang->gitlab->createBranchPriv = 'Cerate branch protected';
|
||||
$lang->gitlab->editBranchPriv = 'Edit branch protected';
|
||||
$lang->gitlab->deleteBranchPriv = 'Delete branch protected';
|
||||
$lang->gitlab->createTag = 'Create Tag';
|
||||
$lang->gitlab->deleteTag = 'Delete tag';
|
||||
$lang->gitlab->createTagPriv = 'Create tag protected';
|
||||
$lang->gitlab->editTagPriv = 'Edit tag protected';
|
||||
$lang->gitlab->deleteTagPriv = 'Delete tag protected';
|
||||
$lang->gitlab->svaeFailed = '『%s』save failed';
|
||||
|
||||
$lang->gitlab->id = 'ID';
|
||||
$lang->gitlab->name = "Server Name";
|
||||
|
||||
@@ -34,7 +34,7 @@ $lang->gitlab->browseUser = "User";
|
||||
$lang->gitlab->browseGroup = "Group";
|
||||
$lang->gitlab->browseBranch = "GitLab Branch List";
|
||||
$lang->gitlab->browseTag = "GitLab Tag List";
|
||||
$lang->gitlab->browseTagPriv = "GitLab Tag protected List";
|
||||
$lang->gitlab->browseTagPriv = "Protected tag";
|
||||
$lang->gitlab->gitlabIssue = "GitLab Issue";
|
||||
$lang->gitlab->zentaoProduct = 'Zentao Product';
|
||||
$lang->gitlab->objectType = 'Type'; // task, bug, story
|
||||
@@ -52,14 +52,9 @@ $lang->gitlab->createBranch = 'Add branch';
|
||||
$lang->gitlab->manageGroupMembers = 'Manage group member';
|
||||
$lang->gitlab->createWebhook = 'Create Webhook';
|
||||
$lang->gitlab->browseBranchPriv = 'Protect branch';
|
||||
$lang->gitlab->createBranchPriv = 'Cerate branch protected';
|
||||
$lang->gitlab->editBranchPriv = 'Edit branch protected';
|
||||
$lang->gitlab->deleteBranchPriv = 'Delete branch protected';
|
||||
$lang->gitlab->createTag = 'Create Tag';
|
||||
$lang->gitlab->deleteTag = 'Delete tag';
|
||||
$lang->gitlab->createTagPriv = 'Create tag protected';
|
||||
$lang->gitlab->editTagPriv = 'Edit tag protected';
|
||||
$lang->gitlab->deleteTagPriv = 'Delete tag protected';
|
||||
$lang->gitlab->svaeFailed = '『%s』save failed';
|
||||
|
||||
$lang->gitlab->id = 'ID';
|
||||
$lang->gitlab->name = "Server Name";
|
||||
|
||||
@@ -34,7 +34,7 @@ $lang->gitlab->browseUser = "用户";
|
||||
$lang->gitlab->browseGroup = "群组";
|
||||
$lang->gitlab->browseBranch = "GitLab分支列表";
|
||||
$lang->gitlab->browseTag = "GitLab标签列表";
|
||||
$lang->gitlab->browseTagPriv = "GitLab标签保护列表";
|
||||
$lang->gitlab->browseTagPriv = "标签保护管理";
|
||||
$lang->gitlab->gitlabIssue = "{$lang->gitlab->common} issue";
|
||||
$lang->gitlab->zentaoProduct = '禅道产品';
|
||||
$lang->gitlab->objectType = '类型'; // task, bug, story
|
||||
@@ -52,14 +52,9 @@ $lang->gitlab->createBranch = '添加分支';
|
||||
$lang->gitlab->manageGroupMembers = '群组成员管理';
|
||||
$lang->gitlab->createWebhook = '创建Webhook';
|
||||
$lang->gitlab->browseBranchPriv = '分支保护管理';
|
||||
$lang->gitlab->createBranchPriv = '创建分支保护';
|
||||
$lang->gitlab->editBranchPriv = '编辑分支保护';
|
||||
$lang->gitlab->deleteBranchPriv = '删除分支保护';
|
||||
$lang->gitlab->createTag = '创建标签';
|
||||
$lang->gitlab->deleteTag = '删除标签';
|
||||
$lang->gitlab->createTagPriv = '创建标签保护';
|
||||
$lang->gitlab->editTagPriv = '编辑标签保护';
|
||||
$lang->gitlab->deleteTagPriv = '删除标签保护';
|
||||
$lang->gitlab->svaeFailed = '『%s』保存失败';
|
||||
|
||||
$lang->gitlab->id = 'ID';
|
||||
$lang->gitlab->name = "服务器名称";
|
||||
|
||||
+63
-83
@@ -2549,59 +2549,49 @@ class gitlabModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get single protct branch by API.
|
||||
* Manage branch privs.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $branch
|
||||
* @param array $protected
|
||||
* @access public
|
||||
* @return object
|
||||
* @return array
|
||||
*/
|
||||
public function apiGetSingleBranchPriv($gitlabID, $projectID, $branch)
|
||||
public function manageBranchPrivs($gitlabID, $projectID, $protected = array())
|
||||
{
|
||||
if(empty($gitlabID)) return false;
|
||||
$branch = urlencode($branch);
|
||||
$url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/protected_branches/$branch");
|
||||
return json_decode(commonModel::http($url));
|
||||
}
|
||||
$data = (array)fixer::input('post')->get();
|
||||
extract($data);
|
||||
$failure = array();
|
||||
|
||||
/**
|
||||
* Create gitlab potect branch.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $branch
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function createBranchPriv($gitlabID, $projectID, $branch = '')
|
||||
{
|
||||
$priv = fixer::input('post')->get();
|
||||
if(empty($priv->name))
|
||||
/* Remove privs. */
|
||||
foreach($protected as $name => $branch)
|
||||
{
|
||||
dao::$errors['name'][] = $this->lang->gitlab->branch->emptyPrivNameError;
|
||||
return false;
|
||||
if(!in_array($name, $branches))
|
||||
{
|
||||
$result = $this->apiDeleteBranchPriv($gitlabID, $projectID, $name);
|
||||
if($result and substr($result->message, 0, 2) != '20') $failure[] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
$priv->name = urldecode(helper::safe64Decode($priv->name));
|
||||
$singleBranch = $this->apiGetSingleBranchPriv($gitlabID, $projectID, $priv->name);
|
||||
if(empty($branch) && !empty($singleBranch->id))
|
||||
$priv = new stdClass();
|
||||
foreach($branches as $key => $name)
|
||||
{
|
||||
dao::$errors['name'][] = $this->lang->gitlab->branch->issetPrivNameError;
|
||||
return false;
|
||||
/* Process exists data. */
|
||||
if(isset($protected[$name]))
|
||||
{
|
||||
if($protected[$name]->pushAccess == $pushLevels[$key] and $protected[$name]->mergeAccess == $mergeLevels[$key]) continue;
|
||||
|
||||
$result = $this->apiDeleteBranchPriv($gitlabID, $projectID, $name);
|
||||
if(isset($result->message) and substr($result->message, 0, 2) != '20') $failure[] = $name;
|
||||
}
|
||||
|
||||
$priv->name = $name;
|
||||
$priv->push_access_level = $pushLevels[$key];
|
||||
$priv->merge_access_level = $mergeLevels[$key];
|
||||
$response = $this->apiCreateBranchPriv($gitlabID, $projectID, $priv);
|
||||
if(isset($response->message) and substr($response->message, 0, 2) != '20') $failure[] = $name;
|
||||
}
|
||||
|
||||
if(!empty($branch) && !empty($singleBranch->id)) $this->apiDeleteBranchPriv($gitlabID, $projectID, $branch);
|
||||
$response = $this->apiCreateBranchPriv($gitlabID, $projectID, $priv);
|
||||
|
||||
if(!empty($response->id))
|
||||
{
|
||||
$action = empty($branch) ? 'created' : 'edited';
|
||||
$this->loadModel('action')->create('gitlabbranchpriv', $response->id, $action, '', $response->name);
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($response);
|
||||
return array_unique($failure);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2630,7 +2620,7 @@ class gitlabModel extends model
|
||||
* @param int $projectID
|
||||
* @param string $branch
|
||||
* @access public
|
||||
* @return object
|
||||
* @return array
|
||||
*/
|
||||
public function apiDeleteBranchPriv($gitlabID, $projectID, $branch)
|
||||
{
|
||||
@@ -2642,58 +2632,48 @@ class gitlabModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Create gitlab protect tag.
|
||||
* Manage tag privs.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $tag
|
||||
* @param array $protected
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return array
|
||||
*/
|
||||
public function createTagPriv($gitlabID, $projectID, $tag = '')
|
||||
public function manageTagPrivs($gitlabID, $projectID, $protected = array())
|
||||
{
|
||||
$priv = fixer::input('post')->get();
|
||||
if(empty($priv->name))
|
||||
$data = (array)fixer::input('post')->get();
|
||||
extract($data);
|
||||
$failure = array();
|
||||
|
||||
/* Remove privs. */
|
||||
foreach($protected as $name => $tag)
|
||||
{
|
||||
dao::$errors['name'][] = $this->lang->gitlab->tag->emptyPrivNameError;
|
||||
return false;
|
||||
if(!in_array($name, $tags))
|
||||
{
|
||||
$result = $this->apiDeleteTagPriv($gitlabID, $projectID, $name);
|
||||
if($result and substr($result->message, 0, 2) != '20') $failure[] = $name;
|
||||
}
|
||||
}
|
||||
|
||||
$singleTag = $this->apiGetSingleTagPriv($gitlabID, $projectID, $priv->name);
|
||||
if(empty($tag) && !empty($singleTag->id))
|
||||
$priv = new stdClass();
|
||||
foreach($tags as $key => $name)
|
||||
{
|
||||
dao::$errors['name'][] = $this->lang->gitlab->tag->issetPrivNameError;
|
||||
return false;
|
||||
/* Process exists data. */
|
||||
if(isset($protected[$name]))
|
||||
{
|
||||
if($protected[$name]->createAccess == $createLevels[$key]) continue;
|
||||
|
||||
$result = $this->apiDeleteTagPriv($gitlabID, $projectID, $name);
|
||||
if(isset($result->message) and substr($result->message, 0, 2) != '20') $failure[] = $name;
|
||||
}
|
||||
|
||||
$priv->name = $name;
|
||||
$priv->create_access_level = $createLevels[$key];
|
||||
$response = $this->apiCreateTagPriv($gitlabID, $projectID, $priv);
|
||||
if(isset($response->message) and substr($response->message, 0, 2) != '20') $failure[] = $name;
|
||||
}
|
||||
|
||||
if(!empty($tag) && !empty($singleTag->name)) $this->apiDeleteTagPriv($gitlabID, $projectID, $tag);
|
||||
$response = $this->apiCreateTagPriv($gitlabID, $projectID, $priv);
|
||||
|
||||
if(!empty($response->id))
|
||||
{
|
||||
$action = empty($tag) ? 'created' : 'edited';
|
||||
$this->loadModel('action')->create('gitlabtagpriv', $response->id, $action, '', $response->name);
|
||||
return true;
|
||||
}
|
||||
|
||||
return $this->apiErrorHandling($response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get single protct tag by API.
|
||||
*
|
||||
* @param int $gitlabID
|
||||
* @param int $projectID
|
||||
* @param string $tag
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function apiGetSingleTagPriv($gitlabID, $projectID, $tag)
|
||||
{
|
||||
if(empty($gitlabID)) return false;
|
||||
$tag = urlencode($tag);
|
||||
$url = sprintf($this->getApiRoot($gitlabID), "/projects/$projectID/protected_tags/$tag");
|
||||
return json_decode(commonModel::http($url));
|
||||
return array_unique($failure);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of gitlab protext branch of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Yanyi Cao <caoyanyi@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class='pull-left'>
|
||||
<?php echo html::a($this->createLink('gitlab', 'browseProject', "gitlabID=$gitlabID"), "<i class='icon icon-back icon-sm'></i> " . $lang->goback, '', "class='btn btn-secondary'");?>
|
||||
</div>
|
||||
<div id="sidebarHeader">
|
||||
<div class="title" title="<?php echo $project->name_with_namespace; ?>"><?php echo $project->name_with_namespace; ?></div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-left">
|
||||
<div>
|
||||
<form id='branchPrivForm' method='post'>
|
||||
<?php echo html::input('keyword', $keyword, "class='form-control' placeholder='{$lang->gitlab->branch->placeholderSearch}' style='display: inline-block;width:auto;margin:0 10px'");?>
|
||||
<a id="branchSearch" class="btn btn-primary"><?php echo $lang->gitlab->search?></a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if(common::hasPriv('gitlab', 'createBranchPriv')) common::printLink('gitlab', 'createBranchPriv', "gitlabID=$gitlabID&projectID=$projectID", "<i class='icon icon-plus'></i> " . $lang->gitlab->createBranchPriv, '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(empty($branchList)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->noData;?></span>
|
||||
<?php if(empty($keyword) and common::hasPriv('gitlab', 'createBranchPriv')):?>
|
||||
<?php echo html::a($this->createLink('gitlab', 'createBranchPriv', "gitlabID=$gitlabID&projectID=$projectID"), "<i class='icon icon-plus'></i> " . $lang->gitlab->createBranchPriv, '', "class='btn btn-info'");?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<form class='main-table' id='ajaxForm' method='post'>
|
||||
<table id='branchList' class='table has-sort-head table-fixed'>
|
||||
<?php $vars = "gitlabID={$gitlabID}&projectID={$projectID}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='c-name text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->gitlab->branch->name);?></th>
|
||||
<th class='text-left'><?php echo $lang->gitlab->branch->mergeAllowed;?></th>
|
||||
<th class='text-left'><?php echo $lang->gitlab->branch->pushAllowed;?></th>
|
||||
<th class='c-actions-4'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($branchList as $id => $branch): ?>
|
||||
<?php $branch->merge_access_level = $this->gitlab->checkAccessLevel($branch->merge_access_levels); ?>
|
||||
<?php $branch->push_access_level = $this->gitlab->checkAccessLevel($branch->push_access_levels); ?>
|
||||
<tr class='text'>
|
||||
<td class='text-c-name' title='<?php echo $branch->name;?>'><?php echo $branch->name;?></td>
|
||||
<td class-'text' title="<?php echo $levelLang[$branch->merge_access_level];?>"><?php echo $levelLang[$branch->merge_access_level];?></td>
|
||||
<td class='text' title="<?php echo $levelLang[$branch->push_access_level];?>"><?php echo $levelLang[$branch->push_access_level];?></td>
|
||||
<td class='c-actions text-left'>
|
||||
<?php
|
||||
/* Fix error when request type is PATH_INFO and the branch name contains '-'.*/
|
||||
$branchName = helper::safe64Encode(urlencode($branch->name));
|
||||
if(common::hasPriv('gitlab', 'editBranchPriv')) common::printLink('gitlab', 'editBranchPriv', "gitlabID=$gitlabID&projectID=$projectID&branch=$branchName", "<i class='icon icon-edit'></i> ", '', "title={$lang->gitlab->editBranchPriv} class='btn btn-primary'");
|
||||
if(common::hasPriv('gitlab', 'deleteBranchPriv')) echo html::a($this->createLink('gitlab', 'deleteBranchPriv', "gitlabID=$gitlabID&projectID=$projectID&branch=$branchName"), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->gitlab->deleteBranchPriv}' class='btn'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($branchList):?>
|
||||
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -60,8 +60,8 @@
|
||||
<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
|
||||
echo common::buildIconButton('gitlab', 'browseBranchPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'branch-lock', '', '', false, '', '', 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch));
|
||||
echo common::buildIconButton('gitlab', 'browseTagPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'tag-lock', '', '', false, '', '', 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch));
|
||||
echo common::buildIconButton('gitlab', 'manageBranchPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'branch-lock', '', '', false, '', '', 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch));
|
||||
echo common::buildIconButton('gitlab', 'manageTagPriv', "gitlabID=$gitlabID&projectID=$gitlabProject->id", '', 'list', 'tag-lock', '', '', false, '', '', 0, ($gitlabProject->isMaintainer and $gitlabProject->default_branch));
|
||||
echo common::buildIconButton('gitlab', 'manageProjectMembers', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'team', '', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id]));
|
||||
echo common::buildIconButton('gitlab', 'createWebhook', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'change', 'hiddenwin', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id]));
|
||||
echo common::buildIconButton('gitlab', 'importIssue', 'repoID=' . zget($repoPairs, $gitlabProject->id), '', 'list', 'link', '', '', false, '', '', 0, isset($repoPairs[$gitlabProject->id]));
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The browse view file of gitlab module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Gang Zeng <zenggang@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php js::set('vars', "keyword=%s&orderBy=id_desc&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID=1")?>
|
||||
<?php js::set('gitlabID', $gitlabID)?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class='pull-left'>
|
||||
<?php echo html::linkButton('<i class="icon icon-back icon-sm"></i> ' . $lang->goback, $this->createLink('gitlab', 'browseProject', "gitlabID=$gitlabID"), 'self', '','btn btn-secondary');?>
|
||||
</div>
|
||||
<div id="sidebarHeader">
|
||||
<div class="title" title="<?php echo $project->name_with_namespace; ?>"><?php echo $project->name_with_namespace; ?></div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-left">
|
||||
<div>
|
||||
<form id='tagForm' method='post'>
|
||||
<?php echo html::input('keyword', $keyword, "class='form-control' placeholder='{$lang->gitlab->tag->placeholderSearch}' style='display: inline-block;width:auto;margin:0 10px'");?>
|
||||
<a id="tagSearch" class="btn btn-primary"><?php echo $lang->gitlab->search?></a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php common::printLink('gitlab', 'createTagPriv', "gitlabID=$gitlabID&projectID=$projectID", "<i class='icon icon-plus'></i> " . $lang->gitlab->createTagPriv, '', "class='btn btn-primary'");?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(empty($gitlabTagList)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p>
|
||||
<span class="text-muted"><?php echo $lang->noData;?></span>
|
||||
<?php if(empty($keyword) and common::hasPriv('gitlab', 'createTag')):?>
|
||||
<?php echo html::a($this->createLink('gitlab', 'createTagPriv', "gitlabID=$gitlabID&projectID=$projectID"), "<i class='icon icon-plus'></i> " . $lang->gitlab->createTagPriv, '', "class='btn btn-info'");?>
|
||||
<?php endif;?>
|
||||
</p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<form class='main-table' id='ajaxForm' method='post'>
|
||||
<table id='gitlabTagList' class='table has-sort-head table-fixed'>
|
||||
<?php $vars = "gitlabID={$gitlabID}&projectID={$projectID}&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='c-name text-left'><?php common::printOrderLink('name', $orderBy, $vars, $lang->gitlab->tag->name);?></th>
|
||||
<th class='text-left'><?php echo $lang->gitlab->tag->lastCommitter;?></th>
|
||||
<th class='text-left'><?php common::printOrderLink('accessLevels', $orderBy, $vars, $lang->gitlab->tag->accessLevel);?></th>
|
||||
<th class='c-actions-2'><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($gitlabTagList as $id => $gitlabTag): ?>
|
||||
<?php $gitlabTag->accessLevel = $this->gitlab->checkAccessLevel($gitlabTag->accessLevels); ?>
|
||||
<tr class='text'>
|
||||
<td class='text-c-name' title='<?php echo $gitlabTag->name;?>'><?php echo $gitlabTag->name;?></td>
|
||||
<td class='text'><?php echo $gitlabTag->lastCommitter;?></td>
|
||||
<td class='text'><?php echo zget($lang->gitlab->branch->branchCreationLevelList, $gitlabTag->accessLevel);?></td>
|
||||
<td class='c-actions text-left'>
|
||||
<?php
|
||||
/* Fix error when request type is PATH_INFO and the tag name contains '-'.*/
|
||||
$tagName = helper::safe64Encode(urlencode($gitlabTag->name));
|
||||
common::printLink('gitlab', 'editTagPriv', "gitlabID=$gitlabID&projectID=$projectID&tag_name=$tagName", "<i class='icon icon-edit'></i> ", '', "title={$lang->gitlab->editTagPriv} class='btn btn-primary'");
|
||||
common::printLink('gitlab', 'deleteTagPriv', "gitlabID=$gitlabID&projectID={$projectID}&tag_name=$tagName", "<i class='icon icon-trash'></i> ", '', "title='{$lang->gitlab->deleteTagPriv}' class='btn btn-primary' target='hiddenwin' onclick='if(confirm(\"{$lang->gitlab->tag->protectConfirmDel}\")==false) return false;'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($gitlabTagList):?>
|
||||
<div class='table-footer'><?php $pager->show('right', 'pagerjs');?></div>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1,47 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view file of protext branch of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Yanyi Cao <caoyanyi@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $pageTitle;?></h2>
|
||||
</div>
|
||||
<form id='branchForm' method='post' class='form-ajax' enctype="multipart/form-data">
|
||||
<?php if($branchPriv->name) echo html::hidden('name', $branchPriv->name);?>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->branch->name;?></th>
|
||||
<td><?php echo html::select('name', $branches, $branchPriv->name, "class='form-control chosen' " . ($branch ? 'disabled' : ''));?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->branch->mergeAllowed;?></th>
|
||||
<td><?php echo html::select('merge_access_level', $lang->gitlab->branch->branchCreationLevelList, $branchPriv->mergeAccessLevel, "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->branch->pushAllowed;?></th>
|
||||
<td><?php echo html::select('push_access_level', $lang->gitlab->branch->branchCreationLevelList, $branchPriv->pushAccessLevel, "class='form-control'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
<?php if(!isonlybody()) echo html::a(inlink('browseBranchPriv', "gitlabID=$gitlabID&projectID=$projectID"), $lang->goback, '', 'class="btn btn-wide"');?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1,43 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The create view file of protect tag of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Yuchun Li <liyuchun@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @version $Id$
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->gitlab->createTagPriv;?></h2>
|
||||
</div>
|
||||
<form id='branchForm' method='post' class='form-ajax' enctype="multipart/form-data">
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-110px'><?php echo $lang->gitlab->tag->name;?></th>
|
||||
<td><?php echo html::select('name', $tags, '', "class='form-control chosen'");?></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->tag->accessLevel;?></th>
|
||||
<td><?php echo html::select('create_access_level', $lang->gitlab->branch->branchCreationLevelList, '40', "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
<?php if(!isonlybody()) echo html::a(inlink('browseTagPriv', "gitlabID=$gitlabID&projectID=$projectID"), $lang->goback, '', 'class="btn btn-wide"');?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1,44 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* The edit view file of protect tag of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Yuchun Li <liyuchun@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @version $Id$
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainContent' class='main-row'>
|
||||
<div class='main-col main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->gitlab->editTagPriv;?></h2>
|
||||
</div>
|
||||
<form id='branchForm' method='post' class='form-ajax' enctype="multipart/form-data">
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th class='w-110px'><?php echo $lang->gitlab->tag->name;?></th>
|
||||
<td><?php echo html::input('tagName', $tag, "class='form-control' disabled");?></td>
|
||||
<td></td>
|
||||
<?php echo html::hidden('name', $tag);?>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->gitlab->tag->accessLevel;?></th>
|
||||
<td><?php echo html::select('create_access_level', $lang->gitlab->branch->branchCreationLevelList, $tagPriv->createAccessLevel, "class='form-control chosen'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
<?php if(!isonlybody()) echo html::a(inlink('browseTagPriv', "gitlabID=$gitlabID&projectID=$projectID"), $lang->goback, '', 'class="btn btn-wide"');?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<span class='btn btn-link btn-active-text'>
|
||||
<?php echo html::a('###', "<span class='text'> {$lang->gitlab->browseBranchPriv}</span>");?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<form class='main-form form-ajax' method='post' id='privForm'>
|
||||
<table class='table table-form'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='c-names'><?php echo $lang->gitlab->branch->name;?></th>
|
||||
<th class='c-levels'><?php echo $lang->gitlab->branch->mergeAllowed;?></th>
|
||||
<th class='c-levels'><?php echo $lang->gitlab->branch->pushAllowed;?></th>
|
||||
<th class="c-actions"><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i = 0;?>
|
||||
<?php if(!empty($hasAccessBranches)):?>
|
||||
<?php foreach($hasAccessBranches as $branch):?>
|
||||
<tr>
|
||||
<td><?php echo html::input("names[$i]", $branch->name, "class='form-control' readonly");?></td>
|
||||
<td><?php echo html::select("mergeLevels[$i]", $lang->gitlab->branch->branchCreationLevelList, $branch->mergeAccess, "class='form-control chosen'");?></td>
|
||||
<td>
|
||||
<?php echo html::select("pushLevels[$i]", $lang->gitlab->branch->branchCreationLevelList, $branch->pushAccess, "class='form-control chosen'");?>
|
||||
<?php echo html::hidden("branches[$i]", $branch->name);?>
|
||||
</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'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php for($j = 0; $j < 5; $j ++):?>
|
||||
<tr class='addedItem'>
|
||||
<td><?php echo html::select("branches[$i]", array(''=>'') + $noAccessBranches, '', "class='form-control user-picker'");?></td>
|
||||
<td><?php echo html::select("mergeLevels[$i]", $lang->gitlab->branch->branchCreationLevelList, 40, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select("pushLevels[$i]", $lang->gitlab->branch->branchCreationLevelList, 40, "class='form-control chosen'");?></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'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endfor;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
<?php
|
||||
echo html::submitButton('', '', 'hidden btn btn-wide btn-primary');
|
||||
echo html::commonButton($lang->save, 'onclick="savePriv()" id="saveBtn"', 'btn btn-wide btn-primary');
|
||||
echo html::backButton();
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php js::set('itemIndex', $i);?>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<?php $i = '%i%';?>
|
||||
<table class='hidden'>
|
||||
<tr id='addItem' class='hidden'>
|
||||
<td><?php echo html::select("branches[]", array(''=>'') + $noAccessBranches, '', "class='form-control'");?></td>
|
||||
<td><?php echo html::select("mergeLevels[]", $lang->gitlab->branch->branchCreationLevelList, 40, "class='form-control chosen'");?></td>
|
||||
<td><?php echo html::select("pushLevels[]", $lang->gitlab->branch->branchCreationLevelList, 40, "class='form-control chosen'");?></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'");?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<span class='btn btn-link btn-active-text'>
|
||||
<?php echo html::a('###', "<span class='text'> {$lang->gitlab->browseTagPriv}</span>");?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<form class='main-form form-ajax' method='post' id='privForm'>
|
||||
<table class='table table-form'>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
<th class='c-names'><?php echo $lang->gitlab->tag->name;?></th>
|
||||
<th class='c-levels'><?php echo $lang->gitlab->tag->accessLevel;?></th>
|
||||
<th class="c-actions"><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php $i = 0;?>
|
||||
<?php if(!empty($hasAccessTags)):?>
|
||||
<?php foreach($hasAccessTags as $tag):?>
|
||||
<tr>
|
||||
<td><?php echo html::input("names[$i]", $tag->name, "class='form-control' readonly");?></td>
|
||||
<td><?php echo html::select("createLevels[$i]", $lang->gitlab->branch->branchCreationLevelList, $tag->createAccess, "class='form-control chosen'");?></td>
|
||||
<td class='c-actions text-center'>
|
||||
<?php echo html::hidden("tags[$i]", $tag->name);?>
|
||||
<?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'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php for($j = 0; $j < 5; $j ++):?>
|
||||
<tr class='addedItem'>
|
||||
<td><?php echo html::select("tags[$i]", array(''=>'') + $noAccessTags, '', "class='form-control user-picker'");?></td>
|
||||
<td><?php echo html::select("createLevels[$i]", $lang->gitlab->branch->branchCreationLevelList, 40, "class='form-control chosen'");?></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'");?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endfor;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='4' class='text-center form-actions'>
|
||||
<?php
|
||||
echo html::submitButton('', '', 'hidden btn btn-wide btn-primary');
|
||||
echo html::commonButton($lang->save, 'onclick="savePriv()" id="saveBtn"', 'btn btn-wide btn-primary');
|
||||
echo html::backButton();
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<?php js::set('itemIndex', $i);?>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<?php $i = '%i%';?>
|
||||
<table class='hidden'>
|
||||
<tr id='addItem' class='hidden'>
|
||||
<td><?php echo html::select("tags[]", array(''=>'') + $noAccessTags, '', "class='form-control'");?></td>
|
||||
<td><?php echo html::select("createLevels[]", $lang->gitlab->branch->branchCreationLevelList, 40, "class='form-control chosen'");?></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'");?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -1344,17 +1344,11 @@ $lang->resource->gitlab->browseBranch = 'browseBranch';
|
||||
$lang->resource->gitlab->webhook = 'webhook';
|
||||
$lang->resource->gitlab->createWebhook = 'createWebhook';
|
||||
$lang->resource->gitlab->manageProjectMembers = 'manageProjectMembers';
|
||||
$lang->resource->gitlab->browseBranchPriv = 'browseBranchPriv';
|
||||
$lang->resource->gitlab->createBranchPriv = 'createBranchPriv';
|
||||
$lang->resource->gitlab->editBranchPriv = 'editBranchPriv';
|
||||
$lang->resource->gitlab->deleteBranchPriv = 'deleteBranchPriv';
|
||||
$lang->resource->gitlab->manageBranchPriv = 'browseBranchPriv';
|
||||
$lang->resource->gitlab->manageTagPriv = 'browseTagPriv';
|
||||
$lang->resource->gitlab->browseTag = 'browseTag';
|
||||
$lang->resource->gitlab->createTag = 'createTag';
|
||||
$lang->resource->gitlab->deleteTag = 'deleteTag';
|
||||
$lang->resource->gitlab->browseTagPriv = 'browseTagPriv';
|
||||
$lang->resource->gitlab->createTagPriv = 'createTagPriv';
|
||||
$lang->resource->gitlab->editTagPriv = 'editTagPriv';
|
||||
$lang->resource->gitlab->deleteTagPriv = 'deleteTagPriv';
|
||||
|
||||
$lang->gitlab->methodOrder[5] = 'browse';
|
||||
$lang->gitlab->methodOrder[10] = 'create';
|
||||
@@ -1381,9 +1375,11 @@ $lang->gitlab->methodOrder[115] = 'browseBranch';
|
||||
$lang->gitlab->methodOrder[120] = 'webhook';
|
||||
$lang->gitlab->methodOrder[125] = 'createWebhook';
|
||||
$lang->gitlab->methodOrder[130] = 'manageProjectMembers';
|
||||
$lang->gitlab->methodOrder[135] = 'browseTag';
|
||||
$lang->gitlab->methodOrder[140] = 'browseTagPriv';
|
||||
$lang->gitlab->methodOrder[145] = 'deleteTagPriv';
|
||||
$lang->gitlab->methodOrder[135] = 'manageBranchPriv';
|
||||
$lang->gitlab->methodOrder[140] = 'manageTagPriv';
|
||||
$lang->gitlab->methodOrder[145] = 'browseTag';
|
||||
$lang->gitlab->methodOrder[150] = 'createTag';
|
||||
$lang->gitlab->methodOrder[155] = 'deleteTag';
|
||||
|
||||
/* Gitea. */
|
||||
$lang->resource->gitea = new stdclass();
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user