+ Add create branch and tag page.
This commit is contained in:
@@ -935,10 +935,10 @@ class gitlab extends control
|
||||
if($_POST)
|
||||
{
|
||||
$this->gitlab->createBranch($gitlabID, $projectID);
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
|
||||
$locate = $this->session->gitlabBranchList ? $this->session->gitlabBranchList : inlink('browseBranch', "gitlibID=$gitlabID&projectID=$projectID");
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->gitlab->createSuccess, 'locate' => $locate));
|
||||
return $this->sendSuccess(array('message' => $this->lang->gitlab->createSuccess, 'load' => $locate));
|
||||
}
|
||||
|
||||
/* Get branches by api. */
|
||||
@@ -1374,8 +1374,8 @@ class gitlab extends control
|
||||
{
|
||||
$this->gitlab->createTag($gitlabID, $projectID);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browseTag', "gitlabID=$gitlabID&projectID=$projectID")));
|
||||
if(dao::isError()) return $this->sendError(dao::getError());
|
||||
return $this->sendSuccess(array('load' => inlink('browseTag', "gitlabID=$gitlabID&projectID=$projectID")));
|
||||
}
|
||||
|
||||
$gitlabBranches = $this->gitlab->apiGetBranches($gitlabID, $projectID);
|
||||
|
||||
@@ -2829,6 +2829,7 @@ class gitlabModel extends model
|
||||
$tag = fixer::input('post')->get();
|
||||
if(empty($tag->tag_name)) dao::$errors['tag_name'][] = $this->lang->gitlab->tag->emptyNameError;
|
||||
if(empty($tag->ref)) dao::$errors['ref'][] = $this->lang->gitlab->tag->emptyRefError;
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$singleBranch = $this->apiGetSingleTag($gitlabID, $projectID, $tag->tag_name);
|
||||
if(!empty($singleBranch->name)) dao::$errors['tag_name'][] = $this->lang->gitlab->tag->issetNameError;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The createbranch view file of gitlab module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Yanyi Cao<caoyanyi@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::id('gitlabCreateForm'),
|
||||
set::title($lang->gitlab->createBranch),
|
||||
set::actionsClass('w-1/2'),
|
||||
formGroup
|
||||
(
|
||||
set::name('branch'),
|
||||
set::label($lang->gitlab->branch->name),
|
||||
set::required(true),
|
||||
set::width('1/2')
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->gitlab->branch->from),
|
||||
set::required(true),
|
||||
set::width('1/2'),
|
||||
picker
|
||||
(
|
||||
set::name('ref'),
|
||||
set::items($branchPairs),
|
||||
set::required(true)
|
||||
)
|
||||
),
|
||||
);
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The createtag view file of gitlab module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Yanyi Cao<caoyanyi@easycorp.ltd>
|
||||
* @package gitlab
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
formPanel
|
||||
(
|
||||
set::id('gitlabCreateForm'),
|
||||
set::title($lang->gitlab->createTag),
|
||||
set::actionsClass('w-1/2'),
|
||||
formGroup
|
||||
(
|
||||
set::name('tag_name'),
|
||||
set::label($lang->gitlab->tag->name),
|
||||
set::required(true),
|
||||
set::width('1/2')
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::label($lang->gitlab->tag->ref),
|
||||
set::required(true),
|
||||
set::width('1/2'),
|
||||
picker
|
||||
(
|
||||
set::name('ref'),
|
||||
set::items($branches),
|
||||
set::required(true)
|
||||
)
|
||||
),
|
||||
formGroup
|
||||
(
|
||||
set::control('textarea'),
|
||||
set::name('message'),
|
||||
set::label($lang->gitlab->tag->message),
|
||||
set::width('1/2')
|
||||
),
|
||||
);
|
||||
Reference in New Issue
Block a user