* Finish task#54208
This commit is contained in:
@@ -467,3 +467,5 @@ UPDATE `zt_workflowaction` SET `method`='browse' WHERE module='product' and `act
|
||||
UPDATE `zt_workflowaction` SET `type` ='single' WHERE `action`='browse' AND `type`='batch' AND `buildin`=1;
|
||||
|
||||
UPDATE `zt_workflowaction` SET `show`='direct' WHERE `buildin`=1;
|
||||
|
||||
UPDATE `zt_project` SET `status` = 'doing' WHERE `type` = 'program' and `status` = 'wait' and `realBegan` != '0000-00-00' and `realBegan` != '';
|
||||
|
||||
@@ -690,12 +690,13 @@ class gitlabModel extends model
|
||||
* @param string $simple
|
||||
* @param int $minID
|
||||
* @param int $maxID
|
||||
* @param bool $sudo
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function apiGetProjects($gitlabID, $simple = 'true', $minID = 0, $maxID = 0)
|
||||
public function apiGetProjects($gitlabID, $simple = 'true', $minID = 0, $maxID = 0, $sudo = true)
|
||||
{
|
||||
$apiRoot = $this->getApiRoot($gitlabID);
|
||||
$apiRoot = $this->getApiRoot($gitlabID, $sudo);
|
||||
if(!$apiRoot) return array();
|
||||
|
||||
$url = sprintf($apiRoot, "/projects");
|
||||
|
||||
@@ -1152,9 +1152,10 @@ class repo extends control
|
||||
*/
|
||||
public function ajaxGetGitlabProjects($gitlabID, $projectIdList = '', $filter = '')
|
||||
{
|
||||
if($this->app->user->admin)
|
||||
$showAll = ($filter == 'ALL' and common::hasPriv('repo', 'create')) ? true : false;
|
||||
if($this->app->user->admin or $showAll)
|
||||
{
|
||||
$projects = $this->loadModel('gitlab')->apiGetProjects($gitlabID);
|
||||
$projects = $this->loadModel('gitlab')->apiGetProjects($gitlabID, true, 0, 0, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ $(function()
|
||||
$('#gitlabHost').change(function()
|
||||
{
|
||||
host = $('#gitlabHost').val();
|
||||
url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host);
|
||||
url = createLink('repo', 'ajaxgetgitlabprojects', "host=" + host + "&projectIdList=&filter=ALL");
|
||||
if(host == '') return false;
|
||||
|
||||
$.get(url, function(response)
|
||||
|
||||
Reference in New Issue
Block a user