diff --git a/module/index/config.php b/module/index/config.php index 5e7d5f8516..12c758d87a 100644 --- a/module/index/config.php +++ b/module/index/config.php @@ -29,8 +29,8 @@ $config->index->oldPages[] = 'program-kanban'; $config->index->oldPages[] = 'project-kanban'; $config->index->oldPages[] = 'execution-kanban'; $config->index->oldPages[] = 'execution-taskkanban'; -$config->index->oldPages[] = 'webhook-browse'; -$config->index->oldPages[] = 'webhook-create'; +$config->index->oldPages[] = 'webhook-bind'; +$config->index->oldPages[] = 'webhook-choosedept'; $config->index->oldPages[] = 'repo-setrules'; $config->index->oldPages[] = 'host-treemap'; $config->index->oldPages[] = 'gogs-binduser'; diff --git a/module/webhook/config/dtable.php b/module/webhook/config/dtable.php new file mode 100644 index 0000000000..5606c0243b --- /dev/null +++ b/module/webhook/config/dtable.php @@ -0,0 +1,54 @@ +webhook->dtable = new stdclass(); +$config->webhook->dtable->fieldList['id']['name'] = 'id'; +$config->webhook->dtable->fieldList['id']['title'] = $lang->idAB; +$config->webhook->dtable->fieldList['id']['fixed'] = 'left'; +$config->webhook->dtable->fieldList['id']['required'] = 'yes'; +$config->webhook->dtable->fieldList['id']['type'] = 'checkID'; +$config->webhook->dtable->fieldList['id']['checkbox'] = false; +$config->webhook->dtable->fieldList['id']['show'] = true; +$config->webhook->dtable->fieldList['id']['sortType'] = true; +$config->webhook->dtable->fieldList['id']['group'] = 1; + +$config->webhook->dtable->fieldList['type']['name'] = 'type'; +$config->webhook->dtable->fieldList['type']['title'] = $lang->webhook->type; +$config->webhook->dtable->fieldList['type']['width'] = 136; +$config->webhook->dtable->fieldList['type']['type'] = 'html'; +$config->webhook->dtable->fieldList['type']['sortType'] = true; +$config->webhook->dtable->fieldList['type']['align'] = 'left'; + +$config->webhook->dtable->fieldList['name']['name'] = 'name'; +$config->webhook->dtable->fieldList['name']['title'] = $lang->webhook->name; +$config->webhook->dtable->fieldList['name']['minWidth'] = 108; +$config->webhook->dtable->fieldList['name']['type'] = 'html'; +$config->webhook->dtable->fieldList['name']['sortType'] = true; +$config->webhook->dtable->fieldList['name']['align'] = 'left'; + +$config->webhook->dtable->fieldList['url']['name'] = 'url'; +$config->webhook->dtable->fieldList['url']['title'] = $lang->webhook->url; +$config->webhook->dtable->fieldList['url']['minWidth'] = 150; +$config->webhook->dtable->fieldList['url']['type'] = 'html'; +$config->webhook->dtable->fieldList['url']['sortType'] = true; +$config->webhook->dtable->fieldList['url']['align'] = 'left'; + +$config->webhook->dtable->fieldList['actions']['name'] = 'actions'; +$config->webhook->dtable->fieldList['actions']['title'] = $lang->actions; +$config->webhook->dtable->fieldList['actions']['type'] = 'actions'; +$config->webhook->dtable->fieldList['actions']['minWidth'] = '110'; +$config->webhook->dtable->fieldList['actions']['fixed'] = 'right'; + +$config->webhook->dtable->fieldList['actions']['actionsMap']['chooseDept']['icon'] = 'link'; +$config->webhook->dtable->fieldList['actions']['actionsMap']['chooseDept']['hint'] = $lang->webhook->chooseDept; + +$config->webhook->dtable->fieldList['actions']['actionsMap']['bind']['icon'] = 'link'; +$config->webhook->dtable->fieldList['actions']['actionsMap']['bind']['hint'] = $lang->webhook->bind; + +$config->webhook->dtable->fieldList['actions']['actionsMap']['delete']['icon'] = 'trash'; +$config->webhook->dtable->fieldList['actions']['actionsMap']['delete']['hint'] = $lang->webhook->delete; + +$config->webhook->dtable->fieldList['actions']['actionsMap']['log']['icon'] = 'file-text'; +$config->webhook->dtable->fieldList['actions']['actionsMap']['log']['hint'] = $lang->webhook->log; + +$config->webhook->dtable->fieldList['actions']['actionsMap']['edit']['icon'] = 'edit'; +$config->webhook->dtable->fieldList['actions']['actionsMap']['edit']['hint'] = $lang->webhook->edit; diff --git a/module/webhook/config/formdata.php b/module/webhook/config/formdata.php new file mode 100644 index 0000000000..11a9446d67 --- /dev/null +++ b/module/webhook/config/formdata.php @@ -0,0 +1,43 @@ +webhook->form = new stdclass(); +$config->webhook->form->create = array(); +$config->webhook->form->create['type'] = array('type' => 'string', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => $lang->webhook->typeList); +$config->webhook->form->create['name'] = array('type' => 'string', 'control' => 'text', 'required' => true, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['url'] = array('type' => 'string', 'control' => 'text', 'required' => true, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['secret'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['agentId'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['appKey'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['appSecret'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['wechatCorpId'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['wechatCorpSecret'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['wechatAgentId'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['feishuAppId'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['feishuAppSecret'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['domain'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->create['sendType'] = array('type' => 'string', 'control' => 'picker', 'required' => false, 'default' => 'sync', 'options' => $lang->webhook->sendTypeList); +$config->webhook->form->create['products'] = array('type' => 'array', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => array(), 'multiple' => true); +$config->webhook->form->create['executions'] = array('type' => 'array', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => array(), 'multiple' => true); +$config->webhook->form->create['params'] = array('type' => 'array', 'control' => 'checkList', 'required' => false, 'default' => '', 'options' => $lang->webhook->paramsList, 'width' => 'full', 'inline' => true); +$config->webhook->form->create['desc'] = array('type' => 'string', 'control' => 'editor', 'required' => false, 'default' => '', 'width' => 'full'); + +$config->webhook->form->edit = array(); +$config->webhook->form->edit['type'] = array('type' => 'string', 'control' => 'hidden', 'required' => false, 'default' => ''); +$config->webhook->form->edit['name'] = array('type' => 'string', 'control' => 'text', 'required' => true, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['url'] = array('type' => 'string', 'control' => 'text', 'required' => true, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['secret'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['agentId'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['appKey'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['appSecret'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['wechatCorpId'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['wechatCorpSecret'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['wechatAgentId'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['feishuAppId'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['feishuAppSecret'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['domain'] = array('type' => 'string', 'control' => 'text', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->webhook->form->edit['sendType'] = array('type' => 'string', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => $lang->webhook->sendTypeList); +$config->webhook->form->edit['products'] = array('type' => 'array', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => array(), 'multiple' => true); +$config->webhook->form->edit['executions'] = array('type' => 'array', 'control' => 'picker', 'required' => false, 'default' => '', 'options' => array(), 'multiple' => true); +$config->webhook->form->edit['params'] = array('type' => 'array', 'control' => 'checkList', 'required' => false, 'default' => '', 'options' => $lang->webhook->paramsList, 'width' => 'full', 'inline' => true); +$config->webhook->form->edit['desc'] = array('type' => 'string', 'control' => 'editor', 'required' => false, 'default' => '', 'width' => 'full'); + diff --git a/module/webhook/control.php b/module/webhook/control.php index 82cc9bab5b..75d47fe947 100644 --- a/module/webhook/control.php +++ b/module/webhook/control.php @@ -114,7 +114,7 @@ class webhook extends control $this->webhook->delete(TABLE_WEBHOOK, $id); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - $this->send(array('result' => 'success')); + return $this->sendSuccess(array('load' => $this->createLink('webhook', 'true'))); } /** diff --git a/module/webhook/css/create.ui.css b/module/webhook/css/create.ui.css new file mode 100644 index 0000000000..575d231c0f --- /dev/null +++ b/module/webhook/css/create.ui.css @@ -0,0 +1,3 @@ +.form-grid .form-row .form-group {padding-left:110px;} +.form-grid .form-row .form-group.no-label {padding-left:10px; padding-top:5px;} +.form-group .form-label{width:110px;} diff --git a/module/webhook/css/edit.ui.css b/module/webhook/css/edit.ui.css new file mode 100644 index 0000000000..8f0dbc026c --- /dev/null +++ b/module/webhook/css/edit.ui.css @@ -0,0 +1,4 @@ +.form-grid .form-row .form-group {padding-left:110px;} +.form-grid .form-row .form-group.no-label {padding-left:10px; padding-top:5px;} +.form-group .form-label{width:110px;} +.webhookType{padding-top:6px;} diff --git a/module/webhook/js/create.ui.js b/module/webhook/js/create.ui.js new file mode 100644 index 0000000000..c0a7a456ed --- /dev/null +++ b/module/webhook/js/create.ui.js @@ -0,0 +1,13 @@ +window.changeType = function() +{ + var type = $('[name=type]').val(); + $('#sendTypeTR').toggle(type != 'dinggroup' && type != 'dinguser' && type != 'wechatuser' && type != 'wechatgroup' && type != 'feishuuser' && type != 'feishugroup'); + $('#secretTR').toggle(type == 'dinggroup' || type == 'feishugroup'); + $('#urlTR').toggle(type != 'dinguser' && type != 'wechatuser' && type != 'feishuuser'); + $('.dinguserTR').toggle(type == 'dinguser'); + $('.wechatTR').toggle(type == 'wechatuser'); + $('.feishuTR').toggle(type == 'feishuuser'); + $('#paramsTR').toggle(type != 'bearychat' && type != 'dinggroup' && type != 'dinguser' && type != 'wechatuser' && type != 'wechatgroup' && type != 'feishuuser' && type != 'feishugroup'); + $('#urlNote').html(urlNote[type]); +} +changeType(); diff --git a/module/webhook/model.php b/module/webhook/model.php index db2f144890..2cb94be92f 100644 --- a/module/webhook/model.php +++ b/module/webhook/model.php @@ -264,7 +264,8 @@ class webhookModel extends model ->remove('allParams, allActions') ->get(); $webhook->domain = trim($webhook->domain, '/'); - $webhook->params = $this->post->params ? implode(',', $this->post->params) . ',text' : 'text'; + $webhook->params = $this->post->params ? implode(',', $this->post->params) : 'text'; + if(!str_contains($webhook->params, 'text')) $webhook->params .= ',text'; if($webhook->type == 'dinguser') { diff --git a/module/webhook/ui/browse.html.php b/module/webhook/ui/browse.html.php new file mode 100644 index 0000000000..ca7566a445 --- /dev/null +++ b/module/webhook/ui/browse.html.php @@ -0,0 +1,57 @@ + + * @package webhook + * @link https://www.zentao.net + */ +namespace zin; + +featureBar(); +toolbar +( + item(set(array + ( + 'id' => 'createBtn', + 'text' => $lang->webhook->create, + 'icon' => 'plus', + 'class' => 'primary', + 'url' => (common::hasPriv('webhook', 'create') and ($app->rawMethod == 'browse') or $app->rawMethod == 'log') ? createLink('webhook', 'create') : null, + ))), +); + +$cols = $config->webhook->dtable->fieldList; +$data = array(); +foreach($webhooks as $webhook) +{ + $webhook->actions = array(); + $canChooseDept = (($webhook->type == 'dinguser' or $webhook->type == 'feishuuser') and common::hasPriv('webhook', 'chooseDept')); + $canBind = ($webhook->type == 'wechatuser' and common::hasPriv('webhook', 'bind')); + $canSeeLog = common::hasPriv('webhook', 'log'); + $canEdit = common::hasPriv('webhook', 'edit'); + $canDelete = common::hasPriv('webhook', 'delete'); + if(!$canBind) $webhook->actions[] = array('name' => 'chooseDept', 'disabled' => !$canChooseDept, 'url' => createLink('webhook', 'chooseDept', "webhookID={$webhook->id}"), 'title' => $lang->webhook->chooseDept); + if($canBind) $webhook->actions[] = array('name' => 'bind', 'url' => createLink('webhook', 'bind', "webhookID={$webhook->id}"), 'title' => $lang->webhook->bind); + $webhook->actions[] = array('name' => 'log', 'disabled' => !$canSeeLog, 'url' => createLink('webhook', 'log', "webhookID={$webhook->id}"), 'title' => $lang->webhook->log); + $webhook->actions[] = array('name' => 'edit', 'disabled' => !$canEdit, 'url' => createLink('webhook', 'edit', "webhookID={$webhook->id}"), 'title' => $lang->webhook->edit); + $webhook->actions[] = array('name' => 'delete', 'disabled' => !$canDelete, 'url' => createLink('webhook', 'delete', "webhookID={$webhook->id}&confirm=yes"), 'title' => $lang->webhook->delete, 'className' => 'ajax-submit', 'data-confirm' => $lang->webhook->confirmDelete); + + $webhook->type = zget($lang->webhook->typeList, $webhook->type); + $data[] = $webhook; +} +dtable +( + set::id('webhookList'), + set::checkable(false), + set::cols($cols), + set::data($data), + set::sortLink(createLink('webhook', 'browse', "orderBy={name}_{sortType}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}")), + set::orderBy($orderBy), + set::footPager(usePager()), +); + +render(); + diff --git a/module/webhook/ui/create.html.php b/module/webhook/ui/create.html.php new file mode 100644 index 0000000000..c6b071e580 --- /dev/null +++ b/module/webhook/ui/create.html.php @@ -0,0 +1,97 @@ + + * @package webhook + * @link https://www.zentao.net + */ +namespace zin; + +$fields = $config->webhook->form->create; +$fields['domain']['default'] = common::getSysURL(); +$fields['products']['options'] = $products; +$fields['executions']['options'] = $executions; + +$defaultWidth = '1/2'; +$formItems = array(); +foreach($fields as $field => $attr) +{ + $width = zget($attr, 'width', $defaultWidth); + $fieldName = $field; + $notice = ''; + $required = zget($attr, 'required', false); + $rowID = ''; + $rowClass = ''; + $title = $field; + $control = array(); + + $control['type'] = $attr['control']; + if(!empty($attr['options'])) $control['items'] = $attr['options']; + if(!empty($attr['inline'])) $control['inline'] = $attr['inline']; + if($attr['control'] == 'checkList') $fieldName = $field . '[]'; + if(!empty($attr['multiple'])) + { + $control['multiple'] = true; + $fieldName = $field . '[]'; + } + + if(isset($lang->webhook->{$field})) $title = $lang->webhook->{$field}; + if($field == 'appKey') $title = $lang->webhook->dingAppKey; + if($field == 'appSecret') $title = $lang->webhook->dingAppSecret; + if($field == 'agentId') $title = $lang->webhook->dingAgentId; + if($field == 'products') $title = $lang->webhook->product; + if($field == 'executions') $title = $lang->webhook->execution; + + if($field == 'secret') $rowID = 'secretTR'; + if($field == 'url') $rowID = 'urlTR'; + if($field == 'sendType') $rowID = 'sendTypeTR'; + + if($field == 'wechatCorpId') $notice = $lang->webhook->note->wechatHelp; + if($field == 'url') $notice = $lang->webhook->note->typeList['default']; + if($field == 'agentId') $notice = $lang->webhook->note->dingHelp; + if($field == 'sendType') $notice = $lang->webhook->note->async; + if($field == 'products') $notice = $lang->webhook->note->product; + if($field == 'executions') $notice = $lang->webhook->note->execution; + + if($field == 'agentId' || $field == 'appKey' || $field == 'appSecret') $rowClass = 'dinguserTR'; + if($field == 'feishuAppId' || $field == 'feishuAppSecret') $rowClass = 'feishuTR'; + if($field == 'wechatCorpId' || $field == 'wechatCorpSecret' || $field == 'wechatAgentId') $rowClass = 'wechatTR'; + + if($field == 'agentId' || $field == 'appKey' || $field == 'appSecret') $required = true; + if($field == 'feishuAppId' || $field == 'feishuAppSecret') $required = true; + if($field == 'wechatCorpId' || $field == 'wechatCorpSecret' || $field == 'wechatAgentId') $required = true; + + $formItems[] = formRow + ( + $rowID ? setID($rowID) : null, + $rowClass ? setClass($rowClass) : null, + formGroup + ( + set::width($width), + set::name($fieldName), + set::label($title), + set::control($control), + set::value($attr['default']), + set::required($required), + ), + $notice ? formGroup + ( + $field == 'url' ? setID('urlNote') : null, + html($notice), + ) : null, + ); +} + +jsVar('urlNote', $lang->webhook->note->typeList); + +formPanel +( + on::change('[name=type]', 'changeType'), + $formItems +); + +render(); + diff --git a/module/webhook/ui/edit.html.php b/module/webhook/ui/edit.html.php new file mode 100644 index 0000000000..ed7a47b843 --- /dev/null +++ b/module/webhook/ui/edit.html.php @@ -0,0 +1,132 @@ + + * @package webhook + * @link https://www.zentao.net + */ +namespace zin; + +$fields = $config->webhook->form->create; +$fields['domain']['default'] = common::getSysURL(); +$fields['products']['options'] = $products; +$fields['executions']['options'] = $executions; + +$defaultWidth = '1/2'; +$formItems = array(); +$secret = json_decode($webhook->secret); +foreach($fields as $field => $attr) +{ + if($field == 'type') continue; + if($field == 'secret' && $webhook->type != 'dinggroup' && $webhook->type != 'feishugroup') continue; + if($field == 'sendType' && !str_contains("|dinggroup|dinguser|wechatgroup|wechatuser|feishuuser|feishugroup|", "|{$webhook->type}|")) continue; + if($field == 'params' && !str_contains('|bearychat|dinggroup|dinguser|wechatgroup|wechatuser|feishuuser|feishugroup|', "|{$webhook->type}|")) continue; + if(($field == 'agentId' || $field == 'appKey' || $field == 'appSecret') && $webhook->type != 'dinguser') continue; + if(($field == 'wechatCorpId' || $field == 'wechatCorpSecret' || $field == 'wechatAgentId') && $webhook->type != 'wechatuser') continue; + if(($field == 'feishuAppId' || $field == 'feishuAppSecret') && $webhook->type != 'feishuuser') continue; + + $width = zget($attr, 'width', $defaultWidth); + $fieldName = $field; + $notice = ''; + $required = zget($attr, 'required', false); + $rowID = ''; + $rowClass = ''; + $title = $field; + $default = zget($webhook, $field, ''); + $control = array(); + + $control['type'] = $attr['control']; + if(!empty($attr['options'])) $control['items'] = $attr['options']; + if(!empty($attr['inline'])) $control['inline'] = $attr['inline']; + if($attr['control'] == 'checkList') $fieldName = $field . '[]'; + if(!empty($attr['multiple'])) + { + $control['multiple'] = true; + $fieldName = $field . '[]'; + } + + if($webhook->type == 'dinguser') + { + if($field == 'agentId') $default = $secret->agentId; + if($field == 'appKey') $default = $secret->appKey; + if($field == 'appSecret') $default = $secret->appSecret; + } + if($webhook->type == 'wechatuser') + { + if($field == 'wechatCorpId') $default = $secret->appKey; + if($field == 'wechatCorpSecret') $default = $secret->appSecret; + if($field == 'wechatAgentId') $default = $secret->agentId; + } + if($webhook->type == 'feishuuser') + { + if($field == 'feishuAppId') $default = $secret->appId; + if($field == 'feishuAppSecret') $default = $secret->appSecret; + } + + if(isset($lang->webhook->{$field})) $title = $lang->webhook->{$field}; + if($field == 'appKey') $title = $lang->webhook->dingAppKey; + if($field == 'appSecret') $title = $lang->webhook->dingAppSecret; + if($field == 'agentId') $title = $lang->webhook->dingAgentId; + if($field == 'products') $title = $lang->webhook->product; + if($field == 'executions') $title = $lang->webhook->execution; + + if($field == 'secret') $rowID = 'secretTR'; + if($field == 'url') $rowID = 'urlTR'; + if($field == 'sendType') $rowID = 'sendTypeTR'; + + if($field == 'wechatCorpId') $notice = $lang->webhook->note->wechatHelp; + if($field == 'url') $notice = zget($lang->webhook->note->typeList, $webhook->type, ''); + if($field == 'agentId') $notice = $lang->webhook->note->dingHelp; + if($field == 'sendType') $notice = $lang->webhook->note->async; + if($field == 'products') $notice = $lang->webhook->note->product; + if($field == 'executions') $notice = $lang->webhook->note->execution; + + if($field == 'agentId' || $field == 'appKey' || $field == 'appSecret') $rowClass = 'dinguserTR'; + if($field == 'feishuAppId' || $field == 'feishuAppSecret') $rowClass = 'feishuTR'; + if($field == 'wechatCorpId' || $field == 'wechatCorpSecret' || $field == 'wechatAgentId') $rowClass = 'wechatTR'; + if($field == 'url' && str_contains("|dinguser|wechatuser|feishuuser|", "|{$webhook->type}|")) $rowClass = 'hidden'; + + if($field == 'agentId' || $field == 'appKey' || $field == 'appSecret') $required = true; + if($field == 'feishuAppId' || $field == 'feishuAppSecret') $required = true; + if($field == 'wechatCorpId' || $field == 'wechatCorpSecret' || $field == 'wechatAgentId') $required = true; + + $formItems[] = formRow + ( + $rowID ? setID($rowID) : null, + $rowClass ? setClass($rowClass) : null, + formGroup + ( + set::width($width), + set::name($fieldName), + set::label($title), + set::control($control), + set::value($default), + set::required($required), + ), + $notice ? formGroup + ( + $field == 'url' ? setID('urlNote') : null, + html($notice), + ) : null, + ); +} + +jsVar('urlNote', $lang->webhook->note->typeList); + +formPanel +( + formGroup + ( + setClass('webhookType'), + set::label($lang->webhook->type), + formHidden('type', $webhook->type), + zget($lang->webhook->typeList, $webhook->type), + ), + $formItems +); + +render(); +