Merge branch 'devops20_caoyanyi' into 'master'

* Modify mr view style.

See merge request easycorp/zentaopms!1653
This commit is contained in:
李玉春
2022-01-27 00:40:22 +00:00
3 changed files with 12 additions and 4 deletions
+10 -2
View File
@@ -247,6 +247,13 @@ class mr extends control
$sourceBranch = $this->gitlab->apiGetSingleBranch($MR->gitlabID, $MR->sourceProject, $MR->sourceBranch);
$targetBranch = $this->gitlab->apiGetSingleBranch($MR->gitlabID, $MR->targetProject, $MR->targetBranch);
$projectOwner = true;
if(isset($MR->gitlabID) and !$this->app->user->admin)
{
$openID = $this->gitlab->getUserIDByZentaoAccount($MR->gitlabID, $this->app->user->account);
if(!$projectOwner and isset($sourceProject->owner->id) and $sourceProject->owner->id == $openID) $projectOwner = true;
}
$this->view->sourceProjectName = $sourceProject->name_with_namespace;
$this->view->targetProjectName = $targetProject->name_with_namespace;
$this->view->sourceProjectURL = isset($sourceBranch->web_url) ? $sourceBranch->web_url : '';
@@ -260,8 +267,9 @@ class mr extends control
$this->app->loadLang('productplan');
$product = $this->mr->getMRProduct($MR);
$this->view->compile = $this->loadModel('compile')->getById($MR->compileID);
$this->view->compileJob = $MR->jobID ? $this->job->getById($MR->jobID) : false;
$this->view->compile = $this->loadModel('compile')->getById($MR->compileID);
$this->view->compileJob = $MR->jobID ? $this->job->getById($MR->jobID) : false;
$this->view->projectOwner = $projectOwner;
$this->view->title = $this->lang->mr->view;
$this->view->MR = $MR;
+1 -1
View File
@@ -57,7 +57,7 @@ class mrModel extends model
foreach($filterProjects as $gitlabID => $projects)
{
$projectIDList = array_keys($projects);
if(!empty($projectIDList)) $filterProjectSql .= "(gitlabID = {$gitlabID} and sourceProject ".helper::dbIN($projectIDList).") or ";
if(!empty($projectIDList)) $filterProjectSql .= "(gitlabID = {$gitlabID} and sourceProject " . helper::dbIN($projectIDList) . ") or ";
}
if($filterProjectSql) $filterProjectSql = '(' . substr($filterProjectSql, 0, -3) . ')'; // Remove last or.
+1 -1
View File
@@ -119,7 +119,7 @@
<?php common::printIcon('mr', 'edit', "mr=$MR->id", $MR, 'button', 'edit');?>
<?php endif;?>
<?php if($MR->synced and $rawMR->state == 'closed') common::printIcon('mr', 'reopen', "mr=$MR->id", $MR, 'button', 'restart', 'hiddenwin', 'mergeButton'); ?>
<?php common::printIcon('mr', 'delete', "mr=$MR->id", $MR, 'button', 'trash', 'hiddenwin');?>
<?php if($projectOwner) common::printIcon('mr', 'delete', "mr=$MR->id", $MR, 'button', 'trash', 'hiddenwin');?>
</div>
</div>
</div>