This commit is contained in:
caoyanyi
2022-07-22 09:17:57 +08:00
parent 26f7d5c2b6
commit aee9970d4a
8 changed files with 23 additions and 5 deletions
+11 -3
View File
@@ -106,11 +106,19 @@ class mr extends control
$repoID = $this->loadModel('repo')->saveState(0);
$repo = $this->repo->getRepoByID($repoID);
$this->loadModel('gitea');
if($repo->SCM == 'Gitea')
{
$project = $this->gitea->apiGetSingleProject($repo->gitService, $repo->project);
if(empty($project) or !$project->allow_merge_commits) $repo = array();
}
$hosts = $this->loadModel('pipeline')->getList(array('gitea', 'gitlab'));
if(!$this->app->user->admin)
{
$gitlabUsers = $this->loadModel('gitlab')->getGitLabListByAccount();
$giteaUsers = $this->loadModel('gitea')->getGiteaListByAccount();
$giteaUsers = $this->gitea->getGiteaListByAccount();
foreach($hosts as $hostID => $host)
{
if($host->type == 'gitLab' and isset($gitlabUsers[$hostID])) continue;
@@ -575,7 +583,7 @@ class mr extends control
$this->app->loadLang('productplan');
$product = $this->loadModel('product')->getById($productID);
$modules = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'story');
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'story');
/* Load pager. */
$this->app->loadClass('pager', $static = true);
@@ -619,7 +627,7 @@ class mr extends control
}
else
{
$allStories = $this->story->getProductStories($productID, 0, $moduleID = '0', $status = 'draft,active,changed', 'story', 'id_desc', $hasParent = false, array_keys($linkedStories), $pager);
$allStories = $this->story->getProductStories($productID, 0, '0', 'draft,active,changed', 'story', 'id_desc', false, array_keys($linkedStories), $pager);
}
$this->view->modules = $modules;
+2
View File
@@ -119,6 +119,7 @@ $lang->mr->apiErrorMap[3] = "401 Unauthorized";
$lang->mr->apiErrorMap[4] = "403 Forbidden";
$lang->mr->apiErrorMap[5] = "/(pull request already exists for these targets).*/";
$lang->mr->apiErrorMap[6] = "Invalid PullRequest: There are no changes between the head and the base";
$lang->mr->apiErrorMap[7] = "/(user doesn't have access to repo).*/";
$lang->mr->errorLang[1] = 'The source project branch cannot be the same as the target project branch';
$lang->mr->errorLang[2] = 'Another open merge request already exists for this source branch: ID%u';
@@ -126,6 +127,7 @@ $lang->mr->errorLang[3] = "Unauthorized";
$lang->mr->errorLang[4] = 'Permission denied';
$lang->mr->errorLang[5] = 'Another open merge request already exists for this source branch';
$lang->mr->errorLang[6] = 'The source project branch cannot be the same as the target project branch';
$lang->mr->errorLang[7] = "user doesn't have access to repo";
$lang->mr->from = "from";
$lang->mr->to = "to";
+2
View File
@@ -119,6 +119,7 @@ $lang->mr->apiErrorMap[3] = "401 Unauthorized";
$lang->mr->apiErrorMap[4] = "403 Forbidden";
$lang->mr->apiErrorMap[5] = "/(pull request already exists for these targets).*/";
$lang->mr->apiErrorMap[6] = "Invalid PullRequest: There are no changes between the head and the base";
$lang->mr->apiErrorMap[7] = "/(user doesn't have access to repo).*/";
$lang->mr->errorLang[1] = 'The source project branch cannot be the same as the target project branch';
$lang->mr->errorLang[2] = 'Another open merge request already exists for this source branch: ID%u';
@@ -126,6 +127,7 @@ $lang->mr->errorLang[3] = "Unauthorized";
$lang->mr->errorLang[4] = 'Permission denied';
$lang->mr->errorLang[5] = 'Another open merge request already exists for this source branch';
$lang->mr->errorLang[6] = 'The source project branch cannot be the same as the target project branch';
$lang->mr->errorLang[7] = "user doesn't have access to repo";
$lang->mr->from = "from";
$lang->mr->to = "to";
+2
View File
@@ -119,6 +119,7 @@ $lang->mr->apiErrorMap[3] = "401 Unauthorized";
$lang->mr->apiErrorMap[4] = "403 Forbidden";
$lang->mr->apiErrorMap[5] = "/(pull request already exists for these targets).*/";
$lang->mr->apiErrorMap[6] = "Invalid PullRequest: There are no changes between the head and the base";
$lang->mr->apiErrorMap[7] = "/(user doesn't have access to repo).*/";
$lang->mr->errorLang[1] = 'The source project branch cannot be the same as the target project branch';
$lang->mr->errorLang[2] = 'Another open merge request already exists for this source branch: ID%u';
@@ -126,6 +127,7 @@ $lang->mr->errorLang[3] = "Unauthorized";
$lang->mr->errorLang[4] = 'Permission denied';
$lang->mr->errorLang[5] = 'Another open merge request already exists for this source branch';
$lang->mr->errorLang[6] = 'The source project branch cannot be the same as the target project branch';
$lang->mr->errorLang[7] = "user doesn't have access to repo";
$lang->mr->from = "from";
$lang->mr->to = "to";
+2
View File
@@ -119,6 +119,7 @@ $lang->mr->apiErrorMap[3] = "401 Unauthorized";
$lang->mr->apiErrorMap[4] = "403 Forbidden";
$lang->mr->apiErrorMap[5] = "/(pull request already exists for these targets).*/";
$lang->mr->apiErrorMap[6] = "Invalid PullRequest: There are no changes between the head and the base";
$lang->mr->apiErrorMap[7] = "/(user doesn't have access to repo).*/";
$lang->mr->errorLang[1] = 'The source project branch cannot be the same as the target project branch';
$lang->mr->errorLang[2] = 'Another open merge request already exists for this source branch: ID%u';
@@ -126,6 +127,7 @@ $lang->mr->errorLang[3] = "Unauthorized";
$lang->mr->errorLang[4] = 'Permission denied';
$lang->mr->errorLang[5] = 'Another open merge request already exists for this source branch';
$lang->mr->errorLang[6] = 'The source project branch cannot be the same as the target project branch';
$lang->mr->errorLang[7] = "user doesn't have access to repo";
$lang->mr->from = "from";
$lang->mr->to = "to";
+2
View File
@@ -119,6 +119,7 @@ $lang->mr->apiErrorMap[3] = "401 Unauthorized";
$lang->mr->apiErrorMap[4] = "403 Forbidden";
$lang->mr->apiErrorMap[5] = "/(pull request already exists for these targets).*/";
$lang->mr->apiErrorMap[6] = "Invalid PullRequest: There are no changes between the head and the base";
$lang->mr->apiErrorMap[7] = "/(user doesn't have access to repo).*/";
$lang->mr->errorLang[1] = '源项目分支与目标项目分支不能相同';
$lang->mr->errorLang[2] = '存在另外一个同样的合并请求在源项目分支中: ID%u';
@@ -126,6 +127,7 @@ $lang->mr->errorLang[3] = '权限不足';
$lang->mr->errorLang[4] = '权限不足';
$lang->mr->errorLang[5] = '存在另外一个同样的合并请求在源项目分支中';
$lang->mr->errorLang[6] = '源项目分支与目标项目分支不能相同';
$lang->mr->errorLang[7] = '您无权合并改版本库';
$lang->mr->from = "";
$lang->mr->to = "合并到";
+1 -1
View File
@@ -24,7 +24,7 @@
<table class='table table-form'>
<tr>
<th><?php echo $lang->mr->server;?></th>
<td class='required'><?php echo html::select('hostID', array('') + $hostPairs, $repo->gitService, "class='form-control chosen'");?></td>
<td class='required'><?php echo html::select('hostID', array('') + $hostPairs, zget($repo, 'gitService', ''), "class='form-control chosen'");?></td>
</tr>
<tr>
<th style="white-space: nowrap;"><?php echo $lang->mr->sourceProject;?></th>
+1 -1
View File
@@ -47,7 +47,7 @@
</td>
<td><span class='label-pri <?php echo 'label-pri-' . $story->pri;?>' title='<?php echo zget($lang->story->priList, $story->pri, $story->pri)?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri)?></span></td>
<td><?php echo $story->planTitle;?></td>
<td title='<?php echo $modules[$story->module]?>' class='text-left'><?php echo $modules[$story->module];?></td>
<td title='<?php echo zget($modules, $story->module, '/')?>' class='text-left'><?php echo zget($modules, $story->module, '/');?></td>
<td class='text-left nobr' title='<?php echo $story->title?>'>
<?php
if($story->parent > 0) echo "<span class='label label-badge label-light' title={$lang->story->children}>{$lang->story->childrenAB}</span>";