Merge branch 'release/zentaopms_18.3' of https://gitlab.zcorp.cc/easycorp/zentaopms into release/zentaopms_18.3

This commit is contained in:
tianshujie
2023-04-03 18:31:24 +08:00
45 changed files with 525 additions and 230 deletions
+1 -1
View File
@@ -1 +1 @@
18.4
18.3
+1 -1
View File
@@ -16,7 +16,7 @@ if(!class_exists('config')){class config{}}
if(!function_exists('getWebRoot')){function getWebRoot(){}}
/* 基本设置。Basic settings. */
$config->version = '18.4'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it.
$config->version = '18.3'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it.
$config->liteVersion = '1.2'; // 迅捷版版本。 The version of Lite.
$config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP.
$config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time.
+1 -1
View File
@@ -165,7 +165,7 @@ $lang->admin->menuList->message['menuOrder']['10'] = 'webhook';
$lang->admin->menuList->message['menuOrder']['20'] = 'browser';
$lang->admin->menuList->message['menuOrder']['25'] = 'setting';
$lang->admin->menuList->dev['subMenu']['api'] = array('link' => "{$lang->api->doc}|dev|api|module=index");
$lang->admin->menuList->dev['subMenu']['api'] = array('link' => "{$lang->api->doc}|dev|api|module=restapi");
$lang->admin->menuList->dev['subMenu']['db'] = array('link' => "{$lang->database}|dev|db|table=" . trim(TABLE_EFFORT, '`'));
$lang->admin->menuList->dev['subMenu']['langItem'] = array('link' => "{$lang->langItem}|dev|langitem|");
$lang->admin->menuList->dev['subMenu']['editor'] = array('link' => "{$lang->editor->common}|dev|editor|", 'subModule' => 'editor');
+2 -2
View File
@@ -889,10 +889,10 @@ class apiModel extends model
*
* @param string $table
* @param stirng $version
* @access private
* @access public
* @return array
*/
private function getDemoData($table, $version)
public function getDemoData($table, $version)
{
$file = $this->app->getAppRoot() . 'db' . DS . 'api' . DS . $version . DS . $table;
return unserialize(preg_replace_callback('#s:(\d+):"(.*?)";#s', function($match){return 's:'.strlen($match[2]).':"'.$match[2].'";';}, file_get_contents($file)));
+1
View File
@@ -91,6 +91,7 @@ $lang->app = new stdclass();
$lang->zahost = new stdclass();
$lang->zanode = new stdclass();
$lang->holiday = new stdclass();
$lang->dimension = new stdclass();
$lang->projectbuild = new stdclass();
$lang->projectrelease = new stdclass();
+1
View File
@@ -219,6 +219,7 @@ $lang->app->serverLink = 'Server Link';
$lang->review->common = 'Review';
$lang->zahost->common = 'ZAhost';
$lang->zanode->common = 'ZAnode';
$lang->dimension->common = 'Dimension';
$lang->personnel->common = 'Member';
$lang->personnel->invest = 'Investment';
+1
View File
@@ -219,6 +219,7 @@ $lang->app->serverLink = 'Server Link';
$lang->review->common = 'Review';
$lang->zahost->common = 'ZAhost';
$lang->zanode->common = 'ZAnode';
$lang->dimension->common = 'Dimension';
$lang->personnel->common = 'Member';
$lang->personnel->invest = 'Investment';
+1
View File
@@ -219,6 +219,7 @@ $lang->app->serverLink = 'Server Link';
$lang->review->common = 'Review';
$lang->zahost->common = 'ZAhost';
$lang->zanode->common = 'ZAnode';
$lang->dimension->common = 'Dimension';
$lang->personnel->common = 'Member';
$lang->personnel->invest = 'Investment';
+1
View File
@@ -219,6 +219,7 @@ $lang->app->serverLink = '服务器链接';
$lang->review->common = '审批';
$lang->zahost->common = '宿主机';
$lang->zanode->common = '执行节点';
$lang->dimension->common = '维度';
$lang->personnel->common = '人员';
$lang->personnel->invest = '投入人员';
+1 -1
View File
@@ -153,7 +153,7 @@ $lang->devops->common = 'DevOps';
$lang->doc->common = '文檔';
$lang->repo->common = '代碼';
$lang->repo->codeRepo = '代碼庫';
$lang->report->common = '統計';
$lang->report->common = 'BI';
$lang->system->common = '組織';
$lang->admin->common = '後台';
$lang->task->common = '任務';
+1 -1
View File
@@ -20,7 +20,7 @@ class dev extends control
* @access public
* @return void
*/
public function api($module = '', $apiID = 1)
public function api($module = 'restapi', $apiID = 1)
{
if($module == 'restapi') return print($this->fetch('dev', 'restAPI', "apiID=$apiID"));
+3
View File
@@ -159,3 +159,6 @@ form .table-data, #content .table-data {border: 1px solid #e2e2e3;}
.paramsTable th {text-align: left!important; font-size: 14px;}
.paramsTable td {text-align: left;}
.module-content {overflow-y: auto; padding-top: 10px;}
.module-col {padding: 0 0 0 10px;}
+17
View File
@@ -0,0 +1,17 @@
$(function()
{
setHeight();
$(window).resize(setHeight);
});
/**
* Set pane height.
*
* @access public
* @return void
*/
function setHeight()
{
var paneHeight = $(window).height() - 90;
$('#sidebar .module-tree,#mainContent .module-content').css('height', paneHeight);
}
+1 -1
View File
@@ -1169,7 +1169,7 @@ class devModel extends model
$treeMenu = array();
foreach($modules as $module) $this->doc->buildTree($treeMenu, 'restapi', 0, 853, $module, $moduleAPIs, $apiID, 0);
$menu = "<ul id='modules' class='tree' data-ride='tree' data-name='tree-lib'>" . $treeMenu[0] . '</ul>';
$menu = "<ul id='modules' class='tree menu-active-primary menu-hover-primary' data-ride='tree' data-name='tree-lib'>" . $treeMenu[0] . '</ul>';
return array($restApi, $typeList, $menu);
}
}
+126 -131
View File
@@ -9,143 +9,138 @@
* @version $Id$
* @link http://www.zentao.net
*/
include '../../common/view/header.html.php';
js::set('confirmDelete', $lang->api->confirmDelete);
?>
<?php include '../../common/view/header.html.php';?>
<?php js::set('confirmDelete', $lang->api->confirmDelete);?>
<div class="fade main-row split-row" id="mainRow">
<?php $sideWidth = common::checkNotCN() ? '270' : '238';?>
<div class="side-col" style="width:<?php echo $sideWidth;?>px" data-min-width="<?php echo $sideWidth;?>">
<div class="cell" style="min-height: 286px; overflow: visible;">
<div id='title'>
<li class='menu-title'>
<div class="title"><?php echo $this->lang->api->module;?></div>
</li>
<div class="main-row" id="mainContent">
<div class='side-col' id='sidebar'>
<div class='cell module-tree'>
<div class="panel panel-sm with-list">
<div class='panel-heading'><i class='icon-list'></i> <strong><?php echo $lang->dev->moduleList?></strong></div>
<?php echo $moduleTree;?>
</div>
<?php echo $moduleTree;?>
</div>
</div>
<div class="main-col" data-min-width="500">
<div id="mainContent" class="main-row in">
<div class="main-col col-8">
<div class="cell" id="content">
<div class="no-padding">
<div class="detail-title no-padding doc-title">
<div class="http-method label"><?php echo $api->method;?></div>
<div class="path" title="<?php echo $api->path;?>"><?php echo $api->path;?></div>
</div>
<div class="main-col main-content module-col">
<div class="main-col module-content">
<div class="cell" id="content">
<div class="no-padding">
<div class="detail-title no-padding doc-title">
<div class="http-method label"><?php echo $api->method;?></div>
<div class="path" title="<?php echo $api->path;?>"><?php echo $api->path;?></div>
</div>
<div>
<h2 class="title" title="<?php echo $api->title;?>"><?php echo $api->title;?></h2>
<div class="desc"><?php echo $api->desc;?></div>
<?php if($api->params['header']):?>
<h3 class="title"><?php echo $lang->api->header;?></h3>
<table class="table table-data paramsTable">
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th><?php echo $lang->api->req->type;?></th>
<th><?php echo $lang->api->req->required;?></th>
<th><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody>
<?php foreach($api->params['header'] as $param):?>
<tr>
<td><?php echo $param['field'];?></td>
<td>String</td>
<td><?php echo $lang->api->boolList[$param['required']];?></td>
<td><?php echo $param['desc'];?></td>
<tr>
<?php endforeach;
;?>
</tbody>
</table>
<?php endif;?>
<?php if($api->params['query']):?>
<h3 class="title"><?php echo $lang->api->query;?></h3>
<table class="table table-data paramsTable">
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th><?php echo $lang->api->req->type;?></th>
<th><?php echo $lang->api->req->required;?></th>
<th><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody>
<?php foreach($api->params['query'] as $param):?>
<tr>
<td><?php echo $param['field'];?></td>
<td>String</td>
<td><?php echo $lang->api->boolList[$param['required']];?></td>
<td><?php echo $param['desc'];?></td>
<tr>
<?php endforeach;
;?>
</tbody>
</table>
<?php endif;?>
<?php
function parseTree($data, $typeList, $level = 0)
{
global $lang;
</div>
<div>
<h2 class="title" title="<?php echo $api->title;?>"><?php echo $api->title;?></h2>
<div class="desc"><?php echo $api->desc;?></div>
<?php if($api->params['header']):?>
<h3 class="title"><?php echo $lang->api->header;?></h3>
<table class="table table-data paramsTable">
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th><?php echo $lang->api->req->type;?></th>
<th><?php echo $lang->api->req->required;?></th>
<th><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody>
<?php foreach($api->params['header'] as $param):?>
<tr>
<td><?php echo $param['field'];?></td>
<td>String</td>
<td><?php echo $lang->api->boolList[$param['required']];?></td>
<td><?php echo $param['desc'];?></td>
<tr>
<?php endforeach;
;?>
</tbody>
</table>
<?php endif;?>
<?php if($api->params['query']):?>
<h3 class="title"><?php echo $lang->api->query;?></h3>
<table class="table table-data paramsTable">
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th><?php echo $lang->api->req->type;?></th>
<th><?php echo $lang->api->req->required;?></th>
<th><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody>
<?php foreach($api->params['query'] as $param):?>
<tr>
<td><?php echo $param['field'];?></td>
<td>String</td>
<td><?php echo $lang->api->boolList[$param['required']];?></td>
<td><?php echo $param['desc'];?></td>
<tr>
<?php endforeach;
;?>
</tbody>
</table>
<?php endif;?>
<?php
function parseTree($data, $typeList, $level = 0)
{
global $lang;
$str = '<tr>';
$field = '';
for($i = 0; $i < $level; $i++) $field .= '&nbsp;&nbsp;'. ($i == $level-1 ? '∟' : '&nbsp;') . '&nbsp;&nbsp;';
$field .= $data['field'];
$str .= '<td>' . $field . '</td>';
$str .= '<td>' . zget($typeList, $data['paramsType'], '') . '</td>';
$str .= '<td class="text-center">' . zget($lang->api->boolList, $data['required'], '') . '</td>';
$str .= '<td>' . $data['desc'] . '</td>';
$str .= '</tr>';
if(isset($data['children']) && count($data['children']) > 0)
{
$level++;
foreach($data['children'] as $item) $str .= parseTree($item, $typeList, $level);
}
return $str;
}
?>
<?php if($api->params['params']):?>
<h3 class="title"><?php echo $lang->api->params;?></h3>
<table class="table table-data paramsTable">
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th class="w-50px"><?php echo $lang->api->req->type;?></th>
<th class="w-50px text-center"><?php echo $lang->api->req->required;?></th>
<th class="w-300px"><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody><?php foreach($api->params['params'] as $item) echo parseTree($item, $typeList);?></tbody>
</table>
<?php endif;?>
<?php if($api->paramsExample):?>
<h3 class="title"><?php echo $lang->api->paramsExample;?></h3>
<pre><code><?php echo $api->paramsExample;?></code></pre>
<?php endif;?>
<?php if($api->response):?>
<h3 class="title"><?php echo $lang->api->response;?></h3>
<table class="table table-data">
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th class="w-50px"><?php echo $lang->api->req->type;?></th>
<th class="w-50px text-center"><?php echo $lang->api->req->required;?></th>
<th class="w-300px"><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody>
<?php foreach($api->response as $item) echo parseTree($item, $typeList);?>
</tbody>
</table>
<?php endif;?>
<?php if($api->responseExample):?>
<h3 class='title'><?php echo $lang->api->responseExample;?></h3>
<pre><code><?php echo $api->responseExample;?></code></pre>
<?php endif;?>
</div>
$str = '<tr>';
$field = '';
for($i = 0; $i < $level; $i++) $field .= '&nbsp;&nbsp;'. ($i == $level-1 ? '∟' : '&nbsp;') . '&nbsp;&nbsp;';
$field .= $data['field'];
$str .= '<td>' . $field . '</td>';
$str .= '<td>' . zget($typeList, $data['paramsType'], '') . '</td>';
$str .= '<td class="text-center">' . zget($lang->api->boolList, $data['required'], '') . '</td>';
$str .= '<td>' . $data['desc'] . '</td>';
$str .= '</tr>';
if(isset($data['children']) && count($data['children']) > 0)
{
$level++;
foreach($data['children'] as $item) $str .= parseTree($item, $typeList, $level);
}
return $str;
}
?>
<?php if($api->params['params']):?>
<h3 class="title"><?php echo $lang->api->params;?></h3>
<table class="table table-data paramsTable">
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th class="w-50px"><?php echo $lang->api->req->type;?></th>
<th class="w-50px text-center"><?php echo $lang->api->req->required;?></th>
<th class="w-300px"><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody><?php foreach($api->params['params'] as $item) echo parseTree($item, $typeList);?></tbody>
</table>
<?php endif;?>
<?php if($api->paramsExample):?>
<h3 class="title"><?php echo $lang->api->paramsExample;?></h3>
<pre><code><?php echo $api->paramsExample;?></code></pre>
<?php endif;?>
<?php if($api->response):?>
<h3 class="title"><?php echo $lang->api->response;?></h3>
<table class="table table-data">
<thead>
<tr>
<th><?php echo $lang->api->req->name;?></th>
<th class="w-50px"><?php echo $lang->api->req->type;?></th>
<th class="w-50px text-center"><?php echo $lang->api->req->required;?></th>
<th class="w-300px"><?php echo $lang->api->req->desc;?></th>
</tr>
</thead>
<tbody>
<?php foreach($api->response as $item) echo parseTree($item, $typeList);?>
</tbody>
</table>
<?php endif;?>
<?php if($api->responseExample):?>
<h3 class='title'><?php echo $lang->api->responseExample;?></h3>
<pre><code><?php echo $api->responseExample;?></code></pre>
<?php endif;?>
</div>
</div>
</div>
+5
View File
@@ -0,0 +1,5 @@
<?php
$config->dimension->changeDimensionLink = array();
$config->dimension->changeDimensionLink['screen-browse'] = 'screen|browse|dimensionID=%s';
$config->dimension->changeDimensionLink['pivot-preview'] = 'pivot|preview|dimensionID=%s';
$config->dimension->changeDimensionLink['chart-preview'] = 'chart|preview|dimensionID=%s';
+33
View File
@@ -0,0 +1,33 @@
<?php
/**
* The control file of dimension module of ZenTaoPMS.
*
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chenxuan Song <1097180981@qq.com>
* @package dimension
* @version $Id: control.php 4157 2022-11-1 10:24:12Z $
* @link http://www.zentao.net
*/
class dimension extends control
{
/**
* Drop menu page, type is used for tree-browsegroup link.
*
* @access public
* @param string currentModule
* @param string currentMethod
* @param int dimensionID
* @param string type screen|pivot|chart
* @return void
*/
public function ajaxGetDropMenu($currentModule, $currentMethod, $dimensionID, $type = '')
{
$this->view->currentModule = $currentModule;
$this->view->currentMethod = $currentMethod;
$this->view->dimensionID = $dimensionID;
$this->view->type = $type;
$this->view->dimensions = $this->dimension->getList();
$this->display();
}
}
+3
View File
@@ -0,0 +1,3 @@
<?php
$lang->dimension->common = 'Dimension';
$lang->dimension->default = 'Efficiency';
+3
View File
@@ -0,0 +1,3 @@
<?php
$lang->dimension->common = 'Dimension';
$lang->dimension->default = 'Efficiency';
+3
View File
@@ -0,0 +1,3 @@
<?php
$lang->dimension->common = 'Dimension';
$lang->dimension->default = 'Efficiency';
+3
View File
@@ -0,0 +1,3 @@
<?php
$lang->dimension->common = '维度';
$lang->dimension->default = '效能';
+116
View File
@@ -0,0 +1,116 @@
<?php
/**
* The model file of ddimension module of ZenTaoPMS.
*
* @copyright Copyright 2009-2023 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chenxuan Song <songchenxuan@easycorp.ltd>
* @package dimension
* @version $Id: model.php 5086 2022-11-1 10:26:23Z $
* @link http://www.zentao.net
*/
class dimensionModel extends model
{
/**
* Get dimension by ID.
*
* @param int $dimensionID
* @access public
* @return object
*/
public function getByID($dimensionID)
{
return $this->dao->select('*')->from(TABLE_DIMENSION)->where('id')->eq($dimensionID)->fetch();
}
/**
* Get dimension list.
*
* @access public
* @return array
*/
public function getList()
{
return $this->dao->select('*')->from(TABLE_DIMENSION)->where('deleted')->eq('0')->fetchAll('id');
}
/**
* Set switcher menu and save last dimension.
*
* @param int $dimensionID
* @param string $type screen | pivot | chart
* @access public
* @return void
*/
public function setSwitcherMenu($dimensionID = 0, $type = '')
{
$dimensionID = $this->saveState($dimensionID);
$this->loadModel('setting')->setItem($this->app->user->account . 'common.dimension.lastDimension', $dimensionID);
$moduleName = $this->app->rawModule;
$methodName = $this->app->rawMethod;
$this->lang->switcherMenu = $this->getSwitcher($dimensionID, $moduleName, $methodName, $type);
return $dimensionID;
}
/**
* Save dimension state.
*
* @param int $dimensionID
* @access public
* @return int
*/
public function saveState($dimensionID)
{
$dimensions = $this->getList();
/* When the session do not exist, get it from the database. */
if(empty($dimensionID) and isset($this->config->dimension->lastDimension) and isset($dimensions[$this->config->dimension->lastDimension]))
{
$this->session->set('dimension', $this->config->dimension->lastDimension, $this->app->tab);
return $this->session->dimension;
}
if($dimensionID == 0 and $this->session->dimension) $dimensionID = $this->session->dimension;
if($dimensionID == 0 or !isset($dimensions[$dimensionID])) $dimensionID = key($dimensions);
$this->session->set('dimension', (int)$dimensionID, $this->app->tab);
return $this->session->dimension;
}
/*
* Get project swapper.
*
* @param int $dimensionID
* @param string $currentModule
* @param string $currentMethod
* @param string $type screen | pivot | chart
* @access public
* @return string
*/
public function getSwitcher($dimensionID, $currentModule, $currentMethod, $type)
{
$currentDimensionName = $this->lang->dimension->common;
if($dimensionID)
{
$currentDimension = $this->getByID($dimensionID);
$currentDimensionName = $currentDimension->name;
}
if($this->app->viewType == 'mhtml' and $dimensionID)
{
$output = $this->lang->dimension->common . $this->lang->colon;
$output .= "<a id='currentItem' href=\"javascript:showSearchMenu('dimension', '$dimensionID', '$currentModule', '$currentMethod', '')\">{$currentDimensionName} <span class='icon-caret-down'></span></a><div id='currentItemDropMenu' class='hidden affix enter-from-bottom layer'></div>";
return $output;
}
$dropMenuLink = helper::createLink('dimension', 'ajaxGetDropMenu', "currentModule=$currentModule&currentMethod=$currentMethod&dimensionID=$dimensionID&type=$type");
$output = "<div class='btn-group header-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentDimensionName}' style='padding-bottom:2px;'><span class='text'>{$currentDimensionName}</span> <span class='caret' style='margin-bottom: -1px'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "</div></div>";
return $output;
}
}
@@ -0,0 +1,71 @@
<style>
#navTabs {position: sticky; top: 0; background: #fff; z-index: 950;}
#navTabs>li {padding: 0px 10px; display: inline-block}
#navTabs>li>span {display: inline-block;}
#navTabs>li>a {margin: 0!important; padding: 8px 0px; display: inline-block}
#tabContent {margin-top: 5px; z-index: 900; max-width: 220px}
.executionTree ul {list-style: none; margin: 0}
.executionTree .executions>ul>li>div {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;}
.executionTree .executions>ul>li label {background: rgba(255,255,255,0.5); line-height: unset; color: #838a9d; border: 1px solid #d8d8d8; border-radius: 2px; padding: 1px 4px;}
.executionTree li a i.icon {font-size: 15px !important;}
.executionTree li a i.icon:before {min-width: 16px !important;}
.executionTree li .label {position: unset; margin-bottom: 0;}
.executionTree li>a, div.hide-in-search>a {display: block; padding: 2px 10px 2px 5px; overflow: hidden; line-height: 20px; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px;}
.executionTree .tree li>.list-toggle {line-height: 24px;}
.executionTree .tree li.has-list.open:before {content: unset;}
#swapper li>div.hide-in-search>a:focus, #swapper li>div.hide-in-search>a:hover {color: #838a9d; cursor: default;}
#swapper li > a {margin-top: 4px; margin-bottom: 4px;}
#swapper li {padding-top: 0; padding-bottom: 0;}
#swapper .tree li>.list-toggle {top: -1px;}
#closed {width: 90px; height: 25px; line-height: 25px; background-color: #ddd; color: #3c495c; text-align: center; margin-left: 15px; border-radius: 2px;}
#gray-line {width: 230px;height: 1px; margin-left: 10px; margin-bottom:2px; background-color: #ddd;}
#dropMenu.has-search-text .hide-in-search {display: flex;}
#swapper li>.selected {color: #0c64eb!important; background: #e9f2fb!important;}
#dropMenu .col-left {padding-bottom: 0px;}
#dropMenu .col-footer {text-align: center}
#dropMenu .btn-manage {line-height:24px}
</style>
<?php if(!common::hasPriv('dimension', 'browse')):?>
<style>
#dropMenu .col-left {padding-bottom: 5px;}
</style>
<?php endif;?>
<?php
$dimensionNames = array();
foreach($dimensions as $id => $dimension) $dimensionNames[$id] = $dimension->name;
$dimensionsPinYin = common::convert2Pinyin($dimensionNames);
$dimensionsHtml = '<ul class="tree tree-angles" data-ride="tree">';
foreach($dimensions as $id => $dimension)
{
$dimensionLink = 'javascript:;';
$moduleMethod = $currentModule . '-' . $currentMethod;
if(isset($config->dimension->changeDimensionLink[$moduleMethod]))
{
$linkArray = explode('|', $config->dimension->changeDimensionLink[$moduleMethod]);
if(count($linkArray) != 3) continue;
list($linkModule, $linkMethod, $linkParams) = $linkArray;
$linkParams = $moduleMethod == 'tree-browsegroup' ? sprintf($linkParams, $id, $type) : sprintf($linkParams, $id);
$dimensionLink = $this->createLink($linkModule, $linkMethod, $linkParams);
}
$selected = $id == $dimensionID ? 'selected' : '';
$dimensionsHtml .= '<li>' . html::a($dimensionLink, $dimensionNames[$id], '', "class='$selected clickable' title='{$dimensionNames[$id]}' data-key='" . zget($dimensionsPinYin, $dimensionNames[$id], '') . "' data-app='{$app->tab}'") . '</li>';
}
$dimensionsHtml .= '</ul>';
?>
<div class="table-row">
<div class="table-col col-left">
<div class='list-group'>
<div class="tab-content dimensionTree" id="tabContent">
<div class="tab-pane dimensions active">
<?php echo $dimensionsHtml;?>
</div>
</div>
</div>
</div>
</div>
+18 -6
View File
@@ -19,7 +19,8 @@ class docModel extends model
public $action;
// api doc type
const DOC_TYPE_API = 'api';
const DOC_TYPE_API = 'api';
const DOC_TYPE_REST = 'restapi';
/**
* Get library by id.
@@ -2473,10 +2474,10 @@ class docModel extends model
* @param array $moduleDocs
* @param pointer $docID
* @param int $moduleID
* @access private
* @access public
* @return string
*/
private function buildTree(&$treeMenu, $type, $objectID, $libID, $module, $moduleDocs, &$docID, $moduleID = 0)
public function buildTree(&$treeMenu, $type, $objectID, $libID, $module, $moduleDocs, &$docID, $moduleID = 0)
{
if(!isset($treeMenu[$module->id])) $treeMenu[$module->id] = '';
@@ -2490,9 +2491,13 @@ class docModel extends model
if($type == static::DOC_TYPE_API)
{
$treeMenu[$module->id] .= '<li' . ($doc->id == $docID ? ' class="active"' : ' class="doc"') . '>';
$treeMenu[$module->id] .= html::a(inlink('index', "libID=0&moduleID=0&apiID={$doc->id}"), "<i class='icon icon-file-text text-muted'></i> &nbsp;" . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'");
$treeMenu[$module->id] .= '</li>';
}
elseif($type == static::DOC_TYPE_REST)
{
$treeMenu[$module->id] .= '<li' . ($doc->id == $docID ? ' class="active"' : ' class="doc"') . '>';
$treeMenu[$module->id] .= html::a(inlink('api', "type=restapi&apiID={$doc->id}"), "<i class='icon icon-file-text text-muted'></i> &nbsp;" . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title' title='{$doc->title}'");
$treeMenu[$module->id] .= '</li>';
}
else
@@ -2535,6 +2540,10 @@ class docModel extends model
{
$li = html::a(inlink('index', "libID=$libID&moduleID={$module->id}"), $module->name, '', "data-app='{$this->app->tab}' class='doc-title' title='{$module->name}'");
}
elseif($type == static::DOC_TYPE_REST)
{
$li = html::a('#', $module->name, '', "data-app='{$this->app->tab}' class='doc-title' title='{$module->name}'");
}
else
{
$moduleClass = common::hasPriv('tree', 'updateOrder') ? 'sort-module' : '';
@@ -2554,7 +2563,10 @@ class docModel extends model
}
if($treeMenu[$module->id])
{
$li .= '<ul>' . $treeMenu[$module->id] . '</ul>';
$class = '';
if($type == static::DOC_TYPE_REST) $class = 'class="menu-active-primary menu-hover-primary"';
$li .= "<ul $class>" . $treeMenu[$module->id] . '</ul>';
}
if(!isset($treeMenu[$module->parent])) $treeMenu[$module->parent] = '';
+4 -4
View File
@@ -30,8 +30,7 @@
.tree li.has-input {overflow: hidden;}
.tree-text {margin-left: 5px; overflow: hidden;}
i.btn-info, i.btn-info:hover {border: none; background: #fff; box-shadow: unset;}
.tree-version-trigger {display: flex; align-items: center; padding: 0 10px; width: 54px; border-radius: 5px; background: #F9F9F9;}
.tree-version-trigger > .version-trigger-text {flex: 0 0 30px; overflow: hidden;}
.tree-version-trigger {padding: 0 10px; width: 54px; border-radius: 5px; background: #F9F9F9;}
/* css for sidebar */
.sidebar-toggle {flex: 0 0 16px;}
@@ -225,7 +224,7 @@ $(function()
{
if(item.versions[i].id == release) versionName = item.versions[i].version;
}
$item += '<div class="tree-version-trigger" data-id="' + item.id + '"><div class="version-trigger-text">' + (versionName || versionLang) + '</div><span class="caret"></span></div>';
$item += '<div class="tree-version-trigger" data-id="' + item.id + '">' + (versionName || versionLang) + '<span class="caret"></span></div>';
}
if((libClass != 'lib' && hasModulePriv) || (libClass == 'lib' && hasLibPriv)) $item += '<i class="icon icon-drop icon-ellipsis-v hidden tree-icon" data-isCatalogue="' + (libClass ? false : true) + '"></i>';
$item += '</div>';
@@ -237,8 +236,9 @@ $(function()
if(item.active) $li.addClass('active');
}
});
if(location.href.indexOf('moduleID') == -1) ele.data('zui.tree').collapse();
var $leaf = ele.find('li.active');
if($leaf.length) $leaf[$leaf.length - 1].scrollIntoView(true);
ele.on('click', '.icon-drop', function(e)
{
+25 -7
View File
@@ -44,8 +44,9 @@ $lang->moduleOrder[105] = 'zahost';
$lang->moduleOrder[108] = 'zanode';
$lang->moduleOrder[110] = 'doc';
$lang->moduleOrder[113] = 'screen';
$lang->moduleOrder[115] = 'report';
$lang->moduleOrder[111] = 'screen';
$lang->moduleOrder[112] = 'pivot';
$lang->moduleOrder[119] = 'report';
$lang->moduleOrder[120] = 'company';
$lang->moduleOrder[125] = 'dept';
@@ -1771,17 +1772,34 @@ $lang->tree->methodOrder[30] = 'delete';
/* Screen. */
$lang->resource->screen = new stdclass();
$lang->resource->screen->browse = 'browse';
$lang->resource->screen->view = 'view';
$lang->resource->screen->browse = 'browse';
$lang->resource->screen->view = 'view';
$lang->resource->screen->annualData = 'annualData';
$lang->resource->screen->allAnnualData = 'allAnnualData';
$lang->screen->methodOrder[0] = 'browse';
$lang->screen->methodOrder[5] = 'view';
$lang->screen->methodOrder[10] = 'annualData';
$lang->screen->methodOrder[15] = 'allAnnualData';
/* Pivot. */
$lang->resource->pivot = new stdclass();
$lang->resource->pivot->preview = 'preview';
$lang->resource->pivot->productSummary = 'productSummary';
$lang->resource->pivot->projectDeviation = 'projectDeviation';
$lang->resource->pivot->bugCreate = 'bugCreate';
$lang->resource->pivot->bugAssign = 'bugAssign';
$lang->resource->pivot->workload = 'workload';
$lang->pivot->methodOrder[2] = 'preview';
$lang->pivot->methodOrder[10] = 'productSummary';
$lang->pivot->methodOrder[15] = 'projectDeviation';
$lang->pivot->methodOrder[20] = 'bugCreate';
$lang->pivot->methodOrder[25] = 'bugAssign';
$lang->pivot->methodOrder[30] = 'workload';
/* Report. */
$lang->resource->report = new stdclass();
$lang->resource->report->index = 'index';
$lang->report->methodOrder[0] = 'index';
/* Search. */
$lang->resource->search = new stdclass();
+1
View File
@@ -35,6 +35,7 @@ class pivot extends control
*/
public function preview($dimension = 0, $group = '', $module = 'pivot', $method = '', $params = '')
{
$dimension = $this->loadModel('dimension')->setSwitcherMenu($dimension);
$this->prepare4Preview($dimension, $group, $module, $method, $params);
$this->display();
}
-12
View File
@@ -16,7 +16,6 @@ class pivotZen extends pivot
{
$params = helper::safe64Decode($params);
if(!$dimension) $dimension = $this->getDefaultDimension();
if(!$group) $group = $this->getDefaultGroup($dimension);
if(!$module || !$method) list($module, $method, $params) = $this->getDefaultMethod($dimension, $group);
@@ -32,17 +31,6 @@ class pivotZen extends pivot
if(empty($this->view->title)) $this->view->title = $this->lang->pivot->list;
}
/**
* Get default dimension of pivot.
*
* @access public
* @return int
*/
public function getDefaultDimension()
{
return 1;
}
/**
* Get default group of a dimension.
*
+4 -3
View File
@@ -20,10 +20,11 @@ class screen extends control
*/
public function browse($dimensionID = 0)
{
$dimensionID = $this->commonAction($dimensionID);
$dimensionID = $this->loadModel('dimension')->setSwitcherMenu($dimensionID);
$this->view->title = $this->lang->screen->common;
$this->view->screens = $this->screen->getList($dimensionID);
$this->view->title = $this->lang->screen->common;
$this->view->screens = $this->screen->getList($dimensionID);
$this->view->dimension = $dimensionID;
$this->display();
}
+9 -7
View File
@@ -1,8 +1,10 @@
<?php
$lang->screen->browse = 'Browse screen';
$lang->screen->view = 'View screen';
$lang->screen->noscreens = 'No screen yet';
$lang->screen->allDepts = 'All depts';
$lang->screen->allUsers = 'All users';
$lang->screen->noData = 'No Data';
$lang->screen->noDesc = 'No Desc';
$lang->screen->browse = 'Browse screen';
$lang->screen->view = 'View screen';
$lang->screen->annualData = 'Annual Summary';
$lang->screen->allAnnualData = 'View everyone annual summary';
$lang->screen->noscreens = 'No screen yet';
$lang->screen->allDepts = 'All depts';
$lang->screen->allUsers = 'All users';
$lang->screen->noData = 'No Data';
$lang->screen->noDesc = 'No Desc';
+9 -7
View File
@@ -1,8 +1,10 @@
<?php
$lang->screen->browse = 'Browse screen';
$lang->screen->view = 'View screen';
$lang->screen->noscreens = 'No screen yet';
$lang->screen->allDepts = 'All depts';
$lang->screen->allUsers = 'All users';
$lang->screen->noData = 'No Data';
$lang->screen->noDesc = 'No Desc';
$lang->screen->browse = 'Browse screen';
$lang->screen->view = 'View screen';
$lang->screen->annualData = 'Annual Summary';
$lang->screen->allAnnualData = 'View everyone annual summary';
$lang->screen->noscreens = 'No screen yet';
$lang->screen->allDepts = 'All depts';
$lang->screen->allUsers = 'All users';
$lang->screen->noData = 'No Data';
$lang->screen->noDesc = 'No Desc';
+9 -7
View File
@@ -1,8 +1,10 @@
<?php
$lang->screen->browse = 'Browse screen';
$lang->screen->view = 'View screen';
$lang->screen->noscreens = 'No screen yet';
$lang->screen->allDepts = 'All depts';
$lang->screen->allUsers = 'All users';
$lang->screen->noData = 'No Data';
$lang->screen->noDesc = 'No Desc';
$lang->screen->browse = 'Browse screen';
$lang->screen->view = 'View screen';
$lang->screen->annualData = 'Annual Summary';
$lang->screen->allAnnualData = 'View everyone annual summary';
$lang->screen->noscreens = 'No screen yet';
$lang->screen->allDepts = 'All depts';
$lang->screen->allUsers = 'All users';
$lang->screen->noData = 'No Data';
$lang->screen->noDesc = 'No Desc';
+9 -7
View File
@@ -1,8 +1,10 @@
<?php
$lang->screen->browse = '浏览数据大屏';
$lang->screen->view = '查看数据大屏';
$lang->screen->noscreens = '暂时没有可视化大屏';
$lang->screen->allDepts = '所有部门';
$lang->screen->allUsers = '所有用户';
$lang->screen->noData = '暂时没有数据';
$lang->screen->noDesc = '暂无描述';
$lang->screen->browse = '浏览大屏';
$lang->screen->view = '查看大屏';
$lang->screen->annualData = '年度总结';
$lang->screen->allAnnualData = '查看所有人年度总结';
$lang->screen->noscreens = '暂时没有可视化大屏';
$lang->screen->allDepts = '所有部门';
$lang->screen->allUsers = '所有用户';
$lang->screen->noData = '暂时没有数据';
$lang->screen->noDesc = '暂无描述';
+1
View File
@@ -7,6 +7,7 @@
<?php else:?>
<div class='row'>
<?php foreach ($screens as $screenID => $screen):?>
<?php if($screenID == 3 && !common::hasPriv('screen', 'annualData')) continue;?>
<div class='col-md-3' data-id='<?php echo $screen->id;?>'>
<?php if(common::hasPriv('screen', 'view')):?>
<a href='<?php echo $this->createLink('screen', 'view', "id=$screen->id");?>' target="_blank" />
+2 -2
View File
@@ -35,7 +35,7 @@ $config->upgrade->maxVersion['max4_0'] = '18_0';
$config->upgrade->maxVersion['max4_1'] = '18_1';
$config->upgrade->maxVersion['max4_2'] = '18_2';
$config->upgrade->maxVersion['max4_3'] = '18_3'; // max insert position.
$config->upgrade->maxVersion['max4_4'] = '18_4';
//$config->upgrade->maxVersion['max4_4'] = '18_4';
$config->upgrade->bizVersion = array();
$config->upgrade->bizVersion['biz1_0'] = '9_5_1';
@@ -109,7 +109,7 @@ $config->upgrade->bizVersion['biz8_0'] = '18_0';
$config->upgrade->bizVersion['biz8_1'] = '18_1';
$config->upgrade->bizVersion['biz8_2'] = '18_2';
$config->upgrade->bizVersion['biz8_3'] = '18_3'; // biz insert position.
$config->upgrade->bizVersion['biz8_4'] = '18_4';
//$config->upgrade->bizVersion['biz8_4'] = '18_4';
$config->upgrade->proVersion = array();
$config->upgrade->proVersion['pro1_0'] = '3_1';
+1
View File
@@ -392,3 +392,4 @@ $lang->upgrade->fromVersions['max4_0_beta3'] = 'Max4.0.beta3';
$lang->upgrade->fromVersions['max4_0'] = 'Max4.0';
$lang->upgrade->fromVersions['max4_1'] = 'Max4.1';
$lang->upgrade->fromVersions['max4_2'] = 'Max4.2'; // max insert position.
$lang->upgrade->fromVersions['max4_3'] = 'Max4.3';
+20 -12
View File
@@ -20,34 +20,33 @@ class webhookModel extends model
*/
public function getByID($id)
{
$webhook = $this->dao->select('*')->from(TABLE_WEBHOOK)->where('id')->eq($id)->fetch();
return $webhook;
return $this->dao->select('*')->from(TABLE_WEBHOOK)->where('id')->eq($id)->fetch();
}
/**
* Get a webhook by type.
*
* @param int $type
* @param string $type
* @access public
* @return object
*/
public function getByType($type)
{
$webhook = $this->dao->select('*')->from(TABLE_WEBHOOK)->where('type')->eq($type)->andWhere('deleted')->eq('0')->fetch();
return $webhook;
return $this->dao->select('*')->from(TABLE_WEBHOOK)->where('type')->eq($type)->andWhere('deleted')->eq('0')->fetch();
}
/**
* Get a webhook by type.
*
* @param int $type
* @param int $webhookID
* @param string $webhookType
* @param string $openID
* @access public
* @return object
*/
public function getBindAccount($webhookID, $webhookType, $openID)
{
$account = $this->dao->select('account')->from(TABLE_OAUTH)->where('providerID')->eq($webhookID)->andWhere('providerType')->eq($webhookType)->andWhere('openID')->eq($openID)->fetch('account');
return $account;
return $this->dao->select('account')->from(TABLE_OAUTH)->where('providerID')->eq($webhookID)->andWhere('providerType')->eq($webhookType)->andWhere('openID')->eq($openID)->fetch('account');
}
/**
@@ -61,12 +60,11 @@ class webhookModel extends model
*/
public function getList($orderBy = 'id_desc', $pager = null, $decode = true)
{
$webhooks = $this->dao->select('*')->from(TABLE_WEBHOOK)
return $this->dao->select('*')->from(TABLE_WEBHOOK)
->where('deleted')->eq('0')
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
return $webhooks;
}
/**
@@ -354,6 +352,7 @@ class webhookModel extends model
* @param int $objectID
* @param string $actionType
* @param int $actionID
* @param string $actor
* @access public
* @return bool
*/
@@ -609,8 +608,15 @@ class webhookModel extends model
public function getFeishuData($title, $text)
{
$data = new stdclass();
$data->msg_type = 'text';
$data->content['text'] = $text;
$data->msg_type = 'interactive';
$data->card = array();
$data->card['header'] = array();
$data->card['elements'] = array();
$data->card['elements'][] = array('tag' => 'markdown', 'content' => $text);
$data->card['header']['title'] = array('tag' => 'plain_text', 'content' => $title);
$data->card['header']['template'] = 'blue';
return $data;
}
@@ -618,6 +624,7 @@ class webhookModel extends model
/**
* Get openID list.
*
* @param int $webhookID
* @param int $actionID
* @access public
* @return string
@@ -742,6 +749,7 @@ class webhookModel extends model
* @param int $webhookID
* @param int $actionID
* @param string $data
* @param string $actor
* @access public
* @return bool
*/
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long