From 22a6755bfecb51210f6f2c712ba4b28493eee042 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Thu, 11 Aug 2022 14:26:04 +0800 Subject: [PATCH] * Modify edit mr. --- module/mr/model.php | 4 ++-- module/mr/view/edit.html.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/module/mr/model.php b/module/mr/model.php index db37d6d565..0da57f512f 100644 --- a/module/mr/model.php +++ b/module/mr/model.php @@ -903,13 +903,13 @@ class mrModel extends model } else { - $url = sprintf($this->loadModel('gitea')->getApiRoot($hostID), "/repos/$projectID/pulls/$MRID"); + $url = sprintf($this->loadModel($host->type)->getApiRoot($hostID), "/repos/$projectID/pulls/$MRID"); $newMR->base = $MR->targetBranch; $newMR->body = $MR->description; if($MR->assignee) { - $assignee = $this->gitea->getUserIDByZentaoAccount($this->post->hostID, $MR->assignee); + $assignee = $this->{$host->type}->getUserIDByZentaoAccount($this->post->hostID, $MR->assignee); if($assignee) $newMR->assignee = $assignee; } diff --git a/module/mr/view/edit.html.php b/module/mr/view/edit.html.php index f25de0ee27..7f1b3b697d 100644 --- a/module/mr/view/edit.html.php +++ b/module/mr/view/edit.html.php @@ -50,7 +50,7 @@ mr->targetProject;?>
- status == 'merged' or $MR->status == 'closed'):?> + status == 'merged' or $MR->status == 'closed' or $host->type == 'gogs'):?> type == 'gitlab' ? $this->loadModel('gitlab')->apiGetSingleProject($MR->hostID, $MR->targetProject)->name_with_namespace : $MR->targetProject;?>: targetBranch;?>