+ Add binduser page for gitea and gogs.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
#featureBar {display: flex; gap: 1rem;}
|
||||
@@ -0,0 +1,16 @@
|
||||
window.setUserEmail = function()
|
||||
{
|
||||
let email = '';
|
||||
const account = $(this).val();
|
||||
if(account && zentaoUsers[account]) email = zentaoUsers[account].email;
|
||||
|
||||
$(this).closest('.dtable-cell').prev().find('.dtable-cell-content').text(email);
|
||||
}
|
||||
|
||||
window.renderGitlabUser = function(result, {row})
|
||||
{
|
||||
const giteaID = row.data.giteaID;
|
||||
result.push({html: `<input type="hidden" name='giteaUserNames[]' value='${giteaID}'>`});
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The bind user file of gitea 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 gitea
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
/* zin: Define the set::module('compile') feature bar on main menu. */
|
||||
featureBar
|
||||
(
|
||||
to::leading(array(backBtn(set::icon('back'), set::class('secondary'), $lang->goback))),
|
||||
set::current($type),
|
||||
set::link($this->createLink('gitea', 'binduser', "giteaID=$giteaID&type={key}")),
|
||||
);
|
||||
|
||||
/* zin: Define the toolbar on main menu. */
|
||||
toolbar();
|
||||
|
||||
jsVar('zentaoUsers', $zentaoUsers);
|
||||
$config->gitea->dtable->bindUser->fieldList['giteaEmail']['onRenderCell'] = jsRaw('renderGitlabUser');
|
||||
$config->gitea->dtable->bindUser->fieldList['zentaoUsers']['controlItems'] = $userPairs;
|
||||
form
|
||||
(
|
||||
setID('bindForm'),
|
||||
setClass('mb-4 h-full'),
|
||||
set::action(createLink('gitea', 'bindUser', "giteaID={$giteaID}")),
|
||||
set::actions(array()),
|
||||
on::change('input[name^="zentaoUsers"]', 'setUserEmail'),
|
||||
dtable
|
||||
(
|
||||
set::cols($config->gitea->dtable->bindUser->fieldList),
|
||||
set::data($userList),
|
||||
set::plugins(array('form')),
|
||||
set::rowHeight(50),
|
||||
set::showToolbarOnChecked(false),
|
||||
set::footer(array('toolbar')),
|
||||
set::rowKey('giteaID'),
|
||||
set::footToolbar(array(
|
||||
'className' => 'w-full form-actions form-group no-label',
|
||||
'items' => array(
|
||||
array(
|
||||
'text' => $lang->save,
|
||||
'btnType' => 'primary',
|
||||
'onClick' => jsRaw("() => {\$('#bindForm').trigger('submit')}")
|
||||
),
|
||||
array(
|
||||
'text' => $lang->goback,
|
||||
'btnType' => 'info',
|
||||
'onClick' => jsRaw('() => {goBack()}'),
|
||||
)
|
||||
)
|
||||
)),
|
||||
)
|
||||
);
|
||||
@@ -0,0 +1 @@
|
||||
#featureBar {display: flex; gap: 1rem;}
|
||||
@@ -0,0 +1,16 @@
|
||||
window.setUserEmail = function()
|
||||
{
|
||||
let email = '';
|
||||
const account = $(this).val();
|
||||
if(account && zentaoUsers[account]) email = zentaoUsers[account].email;
|
||||
|
||||
$(this).closest('.dtable-cell').prev().find('.dtable-cell-content').text(email);
|
||||
}
|
||||
|
||||
window.renderGitlabUser = function(result, {row})
|
||||
{
|
||||
const gogsID = row.data.gogsID;
|
||||
result.push({html: `<input type="hidden" name='gogsUserNames[]' value='${gogsID}'>`});
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The bind user file of gogs 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 gogs
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
|
||||
namespace zin;
|
||||
|
||||
/* zin: Define the set::module('compile') feature bar on main menu. */
|
||||
featureBar
|
||||
(
|
||||
to::leading(array(backBtn(set::icon('back'), set::class('secondary'), $lang->goback))),
|
||||
set::current($type),
|
||||
set::link($this->createLink('gogs', 'binduser', "gogsID=$gogsID&type={key}")),
|
||||
);
|
||||
|
||||
/* zin: Define the toolbar on main menu. */
|
||||
toolbar();
|
||||
|
||||
jsVar('zentaoUsers', $zentaoUsers);
|
||||
$config->gogs->dtable->bindUser->fieldList['gogsEmail']['onRenderCell'] = jsRaw('renderGitlabUser');
|
||||
$config->gogs->dtable->bindUser->fieldList['zentaoUsers']['controlItems'] = $userPairs;
|
||||
form
|
||||
(
|
||||
setID('bindForm'),
|
||||
setClass('mb-4 h-full'),
|
||||
set::action(createLink('gogs', 'bindUser', "gogsID={$gogsID}")),
|
||||
set::actions(array()),
|
||||
on::change('input[name^="zentaoUsers"]', 'setUserEmail'),
|
||||
dtable
|
||||
(
|
||||
set::cols($config->gogs->dtable->bindUser->fieldList),
|
||||
set::data($userList),
|
||||
set::plugins(array('form')),
|
||||
set::rowHeight(50),
|
||||
set::showToolbarOnChecked(false),
|
||||
set::footer(array('toolbar')),
|
||||
set::rowKey('gogsID'),
|
||||
set::footToolbar(array(
|
||||
'className' => 'w-full form-actions form-group no-label',
|
||||
'items' => array(
|
||||
array(
|
||||
'text' => $lang->save,
|
||||
'btnType' => 'primary',
|
||||
'onClick' => jsRaw("() => {\$('#bindForm').trigger('submit')}")
|
||||
),
|
||||
array(
|
||||
'text' => $lang->goback,
|
||||
'btnType' => 'info',
|
||||
'onClick' => jsRaw('() => {goBack()}'),
|
||||
)
|
||||
)
|
||||
)),
|
||||
)
|
||||
);
|
||||
Reference in New Issue
Block a user