Merge branch 'release/zentaopms_18.3' into 'master'

Release/zentaopms 18.3

See merge request easycorp/zentaopms!7305
This commit is contained in:
王怡栋
2023-04-04 03:23:33 +00:00
13 changed files with 69 additions and 30 deletions
+1
View File
@@ -120,6 +120,7 @@ class api extends control
$this->view->objectType = $objectType;
$this->view->objectID = $objectID;
$this->view->moduleID = $moduleID;
$this->view->version = $version;
$this->view->libTree = $this->api->getLibTree($libID, $libs, $moduleID, $objectID, $browseType);
$this->view->users = $this->user->getPairs('noclosed,noletter');
$this->view->objectDropdown = isset($libs[$libID]) ? $this->generateLibsDropMenu($libs[$libID], $release) : '';
+7 -15
View File
@@ -38,12 +38,10 @@ js::set('struct_paramsType', $lang->struct->paramsType);
</div>
<div class='modal-body'>
<table class='table table-form'>
<tbody>
<tr>
<td><?php echo html::select('filter', $allStruct, '', "class='form-control chosen filterSelect'");?></td>
<td></td>
</tr>
</tbody>
<tr>
<td><?php echo html::select('filter', $allStruct, '', "class='form-control chosen filterSelect'");?></td>
<td></td>
</tr>
</table>
</div>
<div class="modal-footer">
@@ -105,9 +103,7 @@ js::set('struct_paramsType', $lang->struct->paramsType);
<td><?php echo html::radio('status', $lang->api->statusOptions, apiModel::STATUS_DONE);?></td>
</tr>
<tr>
<th>
<nobr><?php echo $lang->api->owner;?></nobr>
</th>
<th><?php echo $lang->api->owner;?></th>
<td>
<div class='input-group'>
<?php echo html::select('owner', $allUsers, $user, "class='form-control chosen'");?>
@@ -190,9 +186,7 @@ js::set('struct_paramsType', $lang->struct->paramsType);
</td>
</tr>
<tr>
<th>
<nobr><?php echo $lang->api->paramsExample;?></nobr>
</th>
<th><?php echo $lang->api->paramsExample;?></th>
<td>
<div class='input-group'>
<?php echo html::textarea('paramsExample', '', "style='width:100%;height:200px'");?>
@@ -207,9 +201,7 @@ js::set('struct_paramsType', $lang->struct->paramsType);
</td>
</tr>
<tr>
<th>
<nobr><?php echo $lang->api->responseExample;?></nobr>
</th>
<th><?php echo $lang->api->responseExample;?></th>
<td>
<div class='input-group'>
<?php echo html::textarea('responseExample', '', "style='width:100%;height:200px'");?>
+3 -3
View File
@@ -25,9 +25,9 @@
if($libTree and common::hasPriv('api', 'struct')) echo html::a($this->createLink('api', 'struct', "libID=$libID"), "<i class='icon-treemap muted'> </i>" . $lang->api->struct, '', "class='btn btn-link'");
if($libTree and common::hasPriv('api', 'releases')) echo html::a($this->createLink('api', 'releases', "libID=$libID", 'html', true), "<i class='icon-version muted'> </i>" . $lang->api->releases, '', "class='btn btn-link iframe' data-width='800px'");
if($libTree and common::hasPriv('api', 'createRelease')) echo html::a($this->createLink('api', 'createRelease', "libID=$libID"), "<i class='icon-publish muted'> </i>" . $lang->api->createRelease, '', "class='btn btn-link iframe' data-width='800px'");
//if($config->edition != 'open' and $libTree and common::hasPriv('api', 'export')) echo html::a($this->createLink('api', 'export', "libID=$libID", 'html', true), "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export' id='export'");
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType == 'project' ? 'project' : 'product') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
if($libTree and common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-primary"');
if($libTree and common::hasPriv('api', 'export') and $config->edition != 'open') echo html::a($this->createLink('api', 'export', "libID=$libID&version=$version&release=$release", 'html', true), "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export' id='export'");
if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType == 'project' ? 'project' : 'product') . "&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
if($libTree and common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-primary"');
?>
</div>
</div>
+6 -5
View File
@@ -51,11 +51,12 @@ class dev extends control
$moduleID = $api->module;
$api->desc = htmlspecialchars_decode($api->desc);
}
$this->view->title = $this->lang->dev->api;
$this->view->moduleTree = $menu;
$this->view->typeList = $typeList;
$this->view->api = $api;
$this->view->apiID = $apiID;
$this->view->title = $this->lang->dev->api;
$this->view->selectedModule = 'restapi';
$this->view->moduleTree = $menu;
$this->view->typeList = $typeList;
$this->view->api = $api;
$this->view->apiID = $apiID;
$this->display();
}
+4
View File
@@ -21,6 +21,7 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','.";
$lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, Please turn on.";
$lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
$lang->dev->confirmRestore = 'Do you want to reset?';
$lang->dev->apiTips = 'Every page can be called through the JSON interface';
$lang->dev->language = 'Language: %s';
$lang->dev->default = 'Default';
@@ -201,6 +202,9 @@ $lang->dev->endGroupList['admin'] = 'Admin';
$lang->dev->endGroupList['system'] = 'System';
$lang->dev->endGroupList['other'] = 'Andere';
$lang->dev->featureBar['api']['restapi'] = 'RESTful';
$lang->dev->featureBar['api']['index'] = 'Built In';
$lang->dev->featureBar['langItem']['common'] = 'Common';
$lang->dev->featureBar['langItem']['first'] = 'First Menu';
$lang->dev->featureBar['langItem']['second'] = 'Second Menu';
+4
View File
@@ -21,6 +21,7 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','.";
$lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, Please turn on.";
$lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
$lang->dev->confirmRestore = 'Do you want to reset?';
$lang->dev->apiTips = 'Every page can be called through the JSON interface';
$lang->dev->language = 'Language: %s';
$lang->dev->default = 'Default';
@@ -201,6 +202,9 @@ $lang->dev->endGroupList['admin'] = 'Admin';
$lang->dev->endGroupList['system'] = 'System';
$lang->dev->endGroupList['other'] = 'Others';
$lang->dev->featureBar['api']['restapi'] = 'RESTful';
$lang->dev->featureBar['api']['index'] = 'Built In';
$lang->dev->featureBar['langItem']['common'] = 'Common';
$lang->dev->featureBar['langItem']['first'] = 'First Menu';
$lang->dev->featureBar['langItem']['second'] = 'Second Menu';
+4
View File
@@ -21,6 +21,7 @@ $lang->dev->paramMailto = "User account. Separate accounts by ','.";
$lang->dev->noteEditor = "The editor is disabled for security reasons. To use this feature, Please turn on.";
$lang->dev->noteTranslate = "The translation is disabled for security reasons. To use this feature, please go to the official website to download and install the plugin of <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>translation</a>.";
$lang->dev->confirmRestore = 'Do you want to reset?';
$lang->dev->apiTips = 'Every page can be called through the JSON interface';
$lang->dev->language = 'Language: %s';
$lang->dev->default = 'Default';
@@ -201,6 +202,9 @@ $lang->dev->endGroupList['admin'] = 'Admin';
$lang->dev->endGroupList['system'] = 'System';
$lang->dev->endGroupList['other'] = 'Others';
$lang->dev->featureBar['api']['restapi'] = 'RESTful';
$lang->dev->featureBar['api']['index'] = 'Built In';
$lang->dev->featureBar['langItem']['common'] = 'Common';
$lang->dev->featureBar['langItem']['first'] = 'First Menu';
$lang->dev->featureBar['langItem']['second'] = 'Second Menu';
+4
View File
@@ -21,6 +21,7 @@ $lang->dev->paramMailto = "填写帐号,多个账号用','分隔。";
$lang->dev->noteEditor = "编辑器功能存在部分安全问题,如需使用该功能,可在此开启。";
$lang->dev->noteTranslate = "翻译功能因为安全原因被禁用。使用该功能,请到官网下载安装 <a href='https://www.zentao.net/extension-viewExt-151.html' target='_blank'>翻译</a> 插件。";
$lang->dev->confirmRestore = '是否要恢复默认?';
$lang->dev->apiTips = '可访问的每个页面都可通过JSON接口调取';
$lang->dev->language = '语言:%s';
$lang->dev->default = '默认值';
@@ -201,6 +202,9 @@ $lang->dev->endGroupList['admin'] = '后台';
$lang->dev->endGroupList['system'] = '系统';
$lang->dev->endGroupList['other'] = '其他';
$lang->dev->featureBar['api']['restapi'] = 'RESTful接口';
$lang->dev->featureBar['api']['index'] = '内置页面接口';
$lang->dev->featureBar['langItem']['common'] = '公共';
$lang->dev->featureBar['langItem']['first'] = '一级菜单';
$lang->dev->featureBar['langItem']['second'] = '二级菜单';
+20
View File
@@ -2,3 +2,23 @@
<?php if(isset($tab)):?>
<script>$('#mainMenu #<?php echo $tab;?>').addClass('btn-active-text')</script>
<?php endif;?>
<?php if($app->rawMethod == 'api'):?>
<style>.api-tip-icon.icon-help:before {margin-top: 10px; margin-left: -14px; font-size: 12px;}</style>
<div id='mainMenu' class='clearfix menu-secondary'>
<div class="btn-toolbar pull-left">
<?php
foreach($lang->dev->featureBar['api'] as $key => $label)
{
$active = $selectedModule == $key ? 'btn-active-text' : '';
if($key == 'index' and $selectedModule != 'restapi') $active = 'btn-active-text';
$label = "<span class='text'>$label</span>";
echo html::a(inlink('api', "module=$key"), $label, '', "class='btn btn-link $active'");
if($key == 'index') echo "<icon class='icon icon-help api-tip-icon' data-toggle='popover' data-trigger='focus hover' data-placement='bottom' data-tip-class='text-muted popover-sm' data-content='{$lang->dev->apiTips}'></icon>";
}
?>
</div>
</div>
<script>$('[data-toggle="popover"]').popover();</script>
<?php endif;?>
+1 -1
View File
@@ -9,7 +9,7 @@
* @version $Id$
* @link http://www.zentao.net
*/
include '../../common/view/header.html.php';
include 'header.html.php';
js::set('confirmDelete', $lang->api->confirmDelete);
?>
<div class="main-row" id="mainContent">
+4 -2
View File
@@ -1291,6 +1291,7 @@ class doc extends control
*/
public function tableContents($type = 'custom', $objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$this->view->isFirstLoad = $objectID == 0 ? 'true' : 'false';
$this->session->set('createProjectLocate', $this->app->getURI(true), 'doc');
if(empty($browseType)) $browseType = 'all';
@@ -1359,10 +1360,11 @@ class doc extends control
$this->view->pager = $pager;
$this->view->objectID = $objectID;
$this->view->orderBy = $orderBy;
$this->view->exportMethod = $type . '2export';
$this->view->canExport = common::hasPriv('doc', $type . '2export');
$this->view->canExport = $libType == 'api' ? common::hasPriv('api', 'export') : common::hasPriv('doc', $type . '2export');
$this->view->exportMethod = $libType == 'api' ? 'export' : $type . '2export';
$this->view->apiLibID = key($apiLibs);
$this->display();
}
+6 -3
View File
@@ -61,6 +61,7 @@ js::set('versionLang', $lang->build->common);
/* ObjectType and objectID used for other space. */
js::set('objectType', isset($type) ? $type : '');
js::set('objectID', isset($objectID) ? $objectID : '');
js::set('isFirstLoad', isset($isFirstLoad) ? $isFirstLoad: '');
?>
<div id="fileTree" class="file-tree">
@@ -205,6 +206,8 @@ $(function()
initialState: 'active',
itemCreator: function($li, item)
{
if(typeof item.hasAction == 'undefined') item.hasAction = true;
var objectType = config.currentModule == 'api' ? item.objectType : item.type;
var libClass = ['lib', 'annex', 'api', 'execution'].indexOf(objectType) !== -1 ? 'lib' : '';
var hasChild = item.children ? !!item.children.length : false;
@@ -212,7 +215,7 @@ $(function()
var $item = '<a href="' + link + '" style="position: relative" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' + item.id + '" class="' + libClass + '" data-type="' + item.type + '" data-action="' + item.hasAction + '">';
$item += '<div class="text h-full w-full flex-start overflow-hidden">';
if(libClass == 'lib') $item += '<div class="img-lib" style="background-image:url(static/svg/' + imgObj[item.type || 'lib'] + '.svg)"></div>';
if(libClass == 'lib' && (item.type == 'execution' && item.hasAction)) $item += '<div class="img-lib" style="background-image:url(static/svg/' + imgObj[item.type || 'lib'] + '.svg)"></div>';
$item += '<div class="tree-text">';
$item += item.name;
$item += '</div>';
@@ -236,7 +239,7 @@ $(function()
if(item.active) $li.addClass('active');
}
});
if(location.href.indexOf('moduleID') == -1) ele.data('zui.tree').collapse();
if(isFirstLoad !== 'false') ele.data('zui.tree').collapse();
var $leaf = ele.find('li.active');
if($leaf.length) $leaf[$leaf.length - 1].scrollIntoView(true);
@@ -484,7 +487,7 @@ $(function()
}).on('click', '#versionSwitcher a', function()
{
var $item = $(this);
linkParams = linkParams.replace('%s', '&libID=' + $item.closest('ul').data('libId') + '&moduleID=0&apiID=0&version=0&release=' + $item.data('id'));
linkParams = linkParams.replace('%s', 'libID=' + $item.closest('ul').data('libId') + '&moduleID=0&apiID=0&version=0&release=' + $item.data('id'));
location.href = createLink(config.currentModule, 'index', linkParams);
}).on('blur', '.file-tree input.input-tree', function()
{
+5 -1
View File
@@ -20,11 +20,13 @@
<div id="leftBar" class="btn-toolbar pull-left">
<?php echo $objectDropdown;?>
<?php if(!empty($libTree)):?>
<?php if($libType != 'api'):?>
<?php foreach($lang->doc->featureBar['tableContents'] as $barType => $barName):?>
<?php $active = $barType == $browseType ? 'btn-active-text' : '';?>
<?php $linkParams = $app->rawMethod == 'tablecontents' ? "type=$type&objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$barType": "objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$barType";?>
<?php echo html::a($this->createLink('doc', $app->rawMethod, $linkParams), $barName, '', "class='btn btn-link $active' id='{$barType}Tab'");?>
<?php endforeach;?>
<?php endif;?>
<a class="btn btn-link querybox-toggle" id='bysearchTab'><i class="icon icon-search muted"></i> <?php echo $lang->doc->searchDoc;?></a>
<?php endif;?>
</div>
@@ -39,7 +41,9 @@
if($canExport)
{
echo html::a($this->createLink('doc', $exportMethod, "libID=$libID&docID=0", 'html', true), "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export' id='{$exportMethod}'");
$exportLink = $this->createLink('doc', $exportMethod, "libID=$libID&docID=0", 'html', true);
if($libType == 'api') $exportLink = $this->createLink('api', $exportMethod, "libID=$libID", 'html', true);
echo html::a($exportLink, "<i class='icon-export muted'> </i>" . $lang->export, '', "class='btn btn-link export' id='{$exportMethod}'");
}
if(common::hasPriv('doc', 'createLib'))