From 41ba08a2ed595e1b90690aa71e888762ad4d80d9 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 10 Sep 2024 09:03:25 +0800 Subject: [PATCH] * [misc] adjust locate page for no repo. --- module/repo/control.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/module/repo/control.php b/module/repo/control.php index 54c069c7ec..33be243fba 100644 --- a/module/repo/control.php +++ b/module/repo/control.php @@ -41,11 +41,12 @@ class repo extends control * Common actions. * * @param int $repoID - * @param int $objectID projectID|executionID + * @param int $objectID projectID|executionID + * @param string $createLink create|createRepo * @access public * @return void */ - public function commonAction(int $repoID = 0, int $objectID = 0) + public function commonAction(int $repoID = 0, int $objectID = 0, string $createLink = 'create') { $fromModal = in_array($this->app->rawModule, array('git', 'svn')); $tab = $fromModal ? '' :$this->app->tab; @@ -78,7 +79,10 @@ class repo extends control $this->repo->setMenu($this->repos, $repoID); } - if(empty($this->repos) && !in_array($this->methodName, array('create', 'setrules'))) return $this->locate($this->repo->createLink('create', "objectID=$objectID")); + if(empty($this->repos) && !in_array(strtolower($this->methodName), array('create', 'setrules', 'createrepo', 'import'))) + { + return $this->locate(inLink($createLink, "objectID=$objectID")); + } $this->view->fromModal = $fromModal; }