Merge branch 'release/zentaopms_18.3' of https://gitlab.zcorp.cc/easycorp/zentaopms into release/zentaopms_18.3
This commit is contained in:
@@ -8,6 +8,7 @@ UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'project' AND `acl` = 'c
|
||||
UPDATE `zt_doclib` SET `acl` = 'default' WHERE `type` = 'project' AND `acl` IN ('open', 'private');
|
||||
UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'api' and `acl` = 'custom';
|
||||
UPDATE `zt_doclib` SET `acl` = 'default' WHERE `type` = 'api' and `acl` = 'open';
|
||||
UPDATE `zt_doclib` SET `acl` = 'default' WHERE `main` = '1';
|
||||
|
||||
ALTER TABLE `zt_doclib` ADD `addedBy` varchar(30) NOT NULL AFTER `order`;
|
||||
ALTER TABLE `zt_doclib` ADD `addedDate` datetime NOT NULL AFTER `addedBy`;
|
||||
|
||||
@@ -1,20 +1,27 @@
|
||||
.flex {display: flex;}
|
||||
.flex-center {display: flex; justify-content: center; align-items: center;}
|
||||
.flex-start {display: flex; align-items: center;}
|
||||
#main {padding-bottom: 0;}
|
||||
|
||||
.selectBox > button {width: 180px;}
|
||||
|
||||
/* main-content */
|
||||
#mainContent {}
|
||||
#mainContent > #sideBar {flex: 0 0 180px; height: calc(100vh - 120px); overflow: auto;}
|
||||
#mainContent > .sidebar-toggle {flex: 0 0 16px;}
|
||||
#mainContent > .main-col {flex: auto; height: calc(100vh - 120px); overflow: auto;}
|
||||
|
||||
/* tree */
|
||||
#sideBar {padding-left: 0; padding-right: 0;}
|
||||
li.lib {width: unset;}
|
||||
a.lib {margin-bottom: 0; width: unset;}
|
||||
.tree-icon {position: absolute; right: 0;}
|
||||
.tree li > a {max-width: 100%; padding: 2px;}
|
||||
.file-tree a.show-icon {padding-right: 15px;}
|
||||
.file-tree a.show-icon > div {padding-right: 15px;}
|
||||
.file-tree .tree-text {overflow: hidden;}
|
||||
.tree li.has-input {overflow: hidden;}
|
||||
.tree li.has-list.open:before {display: none;}
|
||||
|
||||
.img-lib {flex: 0 0 16px; height: 14px;}
|
||||
/* sideBar */
|
||||
|
||||
.sidebar-toggle > .icon {width: 16px; height: 30px; margin-top: -10px; line-height: 30px; color: #fff; text-align: center; background: #7dcdfe; border-radius: 6px; cursor: pointer;}
|
||||
|
||||
@@ -71,10 +71,10 @@ $(document).ready(function()
|
||||
var hasChild = item.children ? !!item.children.length : false;
|
||||
var $item = '<a href="###" style="position: relative" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' + item.id + '" class="' + libClass + '" data-type="' + item.type + '">';
|
||||
$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/interfacelib.svg)"></div>';
|
||||
$item += '<span style="padding-left: 5px;">';
|
||||
if(libClass == 'lib') $item += '<div class="img-lib" style="background-image:url(static/svg/interface-doclib.svg)"></div>';
|
||||
$item += '<div class="tree-text" style="padding-left: 5px;">';
|
||||
$item += item.name
|
||||
$item += '</span>';
|
||||
$item += '</div>';
|
||||
$item += '<i class="icon icon-drop icon-ellipsis-v hidden tree-icon" data-isCatalogue="' + (item.type ? false : true) + '"></i>';
|
||||
$item += '</div>';
|
||||
$item += '</a>';
|
||||
|
||||
@@ -107,7 +107,8 @@
|
||||
<?php else:?>
|
||||
<div class="cell main-col" data-min-width="400">
|
||||
<div class="detail base-url">
|
||||
<p><?php echo $lang->api->baseUrl . ': ' . $lib->baseUrl;?></p>
|
||||
<?php $delimiter = strpos($app->clientLang, 'zh') === 0 ? ':' : ': ';?>
|
||||
<p><?php echo $lang->api->baseUrl . $delimiter . $lib->baseUrl;?></p>
|
||||
</div>
|
||||
<div class="detail">
|
||||
<ul class="list-group">
|
||||
|
||||
@@ -50,13 +50,13 @@
|
||||
</tr>
|
||||
<tr id='aclBox'>
|
||||
<th><?php echo $lang->api->control;?></th>
|
||||
<td colspan='2'>
|
||||
<td>
|
||||
<span><?php echo html::radio('acl', $lang->api->aclList, 'open', "onchange='toggleAcl(this.value, \"lib\")'", 'block');?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='hidden'>
|
||||
<th><?php echo $lang->api->whiteList;?></th>
|
||||
<td colspan='2'>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon groups-addon'><?php echo $lang->api->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, '', "class='form-control chosen' multiple")?>
|
||||
@@ -69,13 +69,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->desc;?></th>
|
||||
<td colspan='2'>
|
||||
<?php echo html::textarea('desc', '', "rows='8' class='form-control kindeditor' hidefocus='true' tabindex=''");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='text-center form-actions' colspan='3'><?php echo html::submitButton();?></td>
|
||||
<td class='text-center form-actions' colspan='2'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='<?php echo $lib->acl != 'open' ? '' : 'hidden';?>'>
|
||||
<th><?php echo $lang->api->whiteList;?></th>
|
||||
<td colspan='2'>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon groups-addon'><?php echo $lang->api->group?></span>
|
||||
<?php echo html::select('groups[]', $groups, $lib->groups, "class='form-control chosen' multiple");?>
|
||||
@@ -68,12 +68,6 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->api->desc;?></th>
|
||||
<td colspan='2'>
|
||||
<?php echo html::textarea('desc', $lib->desc, "rows='8' class='form-control kindeditor' hidefocus='true' tabindex=''");?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='text-center form-actions' colspan='2'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
<div class="hidden" data-id="aTreeModal">
|
||||
<a href="###" data-has-children="false" title="%name%" data-id="%id%">
|
||||
<div class="text h-full w-full flex-between overflow-hidden" style="position: relative;">
|
||||
<span>%name%</span>
|
||||
<div>%name%</div>
|
||||
<i class="icon icon-drop icon-ellipsis-v hidden file-drop-icon" data-iscatalogue="true"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
@@ -259,6 +259,7 @@ class doc extends control
|
||||
$this->lang->doclib->aclList['private'] = sprintf($this->lang->doclib->privateACL, $this->lang->{$type}->common);
|
||||
unset($this->lang->doclib->aclList['open']);
|
||||
}
|
||||
if(!empty($lib->main)) unset($this->lang->doclib->aclList['private'], $this->lang->doclib->aclList['open']);
|
||||
|
||||
$this->view->lib = $lib;
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
|
||||
@@ -61,7 +61,6 @@ li.drag-shadow ul {display: none!important;}
|
||||
.tree li.has-list.open:before {content: unset;}
|
||||
.tree li > a {max-width: 100%; padding: 2px;}
|
||||
.file-tree a {height: 30px;}
|
||||
.file-tree a.show-icon {padding-right: 15px;}
|
||||
.flex-between {display: flex; align-items: center; justify-content: space-between;}
|
||||
.flex-center {display: flex; align-items: center; justify-content: center;}
|
||||
.flex-start {display: flex; align-items: center;}
|
||||
@@ -69,6 +68,12 @@ li.drag-shadow ul {display: none!important;}
|
||||
.input-tree {width: 120px;}
|
||||
.tree-icon {position: absolute; right: 0;}
|
||||
.tree li.has-input {overflow: hidden;}
|
||||
.img-lib {flex: 0 0 16px; height: 14px;}
|
||||
.tree-icon {position: absolute; right: 0;}
|
||||
.tree li > a {max-width: 100%; padding: 2px;}
|
||||
.file-tree a.show-icon > div {padding-right: 15px;}
|
||||
.tree li.has-input {overflow: hidden;}
|
||||
|
||||
|
||||
/* css for sidebar */
|
||||
.sidebar-toggle {flex: 0 0 16px;}
|
||||
|
||||
@@ -23,6 +23,7 @@ $(function()
|
||||
'api': 'interface'
|
||||
}
|
||||
|
||||
console.log(treeData, 'treeData');
|
||||
$('#fileTree').tree(
|
||||
{
|
||||
initialState: 'active',
|
||||
@@ -32,7 +33,7 @@ $(function()
|
||||
var libClass = ['lib', 'annex', 'api', 'execution'].indexOf(item.type) !== -1 ? 'lib' : '';
|
||||
var hasChild = item.children ? !!item.children.length : false;
|
||||
var link = item.hasAction ? '###' : '#';
|
||||
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 + '">';
|
||||
var $item = '<a href="' + link + '" style="position: relative" data-has-children="' + hasChild + '" title="' + item.name + '" data-id="' (item.type || 'lib') + 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.type != 'execution') $item += '<div class="img-lib" style="background-image:url(static/svg/' + imgObj[item.type || 'lib'] + '.svg)"></div>';
|
||||
@@ -323,12 +324,5 @@ $(function()
|
||||
}).on('keydown', '.file-tree input.input-tree', function(e)
|
||||
{
|
||||
if(e.keyCode == 13) $(this).trigger('blur');
|
||||
}).on('click', '#mainMenu .btn-toolbar a, .no-content-button a', function()
|
||||
{
|
||||
if(libType == 'api')
|
||||
{
|
||||
$.cookie('objectType', objectType, {expires: config.cookieLife, path: config.webRoot});
|
||||
$.cookie('objectID', objectID, {expires: config.cookieLife, path: config.webRoot});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -2389,11 +2389,8 @@ class docModel extends model
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy('grade desc, `order`')
|
||||
->get();
|
||||
$stmt = $this->dbh->query($query);
|
||||
while ($module = $stmt->fetch())
|
||||
{
|
||||
$this->buildTree($treeMenu, $type, $objectID, $rootID, $module, $moduleDocs, $docID);
|
||||
}
|
||||
$stmt = $this->dbh->query($query);
|
||||
while($module = $stmt->fetch()) $this->buildTree($treeMenu, $type, $objectID, $rootID, $module, $moduleDocs, $docID);
|
||||
|
||||
if(isset($moduleDocs[0]))
|
||||
{
|
||||
@@ -2804,6 +2801,7 @@ class docModel extends model
|
||||
$item = new stdclass();
|
||||
$item->id = $module->id;
|
||||
$item->name = $module->name;
|
||||
$item->type = $module->type;
|
||||
$item->active = $module->id == $moduleID ? 1 : 0;
|
||||
$item->children = $this->getModuleTree($rootID, $moduleID, $type, $module->id, $modules);
|
||||
|
||||
|
||||
@@ -44,8 +44,9 @@
|
||||
<tr id="aclBox">
|
||||
<th><?php echo $lang->doclib->control;?></th>
|
||||
<td>
|
||||
<?php if($lib->type != 'api') echo html::radio('acl', $lang->doclib->aclList, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'", 'block')?>
|
||||
<?php if($lib->type == 'api') echo html::radio('acl', $lang->api->aclList, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'", 'block')?>
|
||||
<?php if($lib->type != 'api' and empty($lib->main)) echo html::radio('acl', $lang->doclib->aclList, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'", 'block')?>
|
||||
<?php if($lib->type == 'api' and empty($lib->main)) echo html::radio('acl', $lang->api->aclList, $lib->acl, "onchange='toggleAcl(this.value, \"lib\")'", 'block')?>
|
||||
<?php if(!empty($lib->main)) echo html::radio('acl', $lang->doclib->aclList, 'default', "onchange='toggleAcl(this.value, \"lib\")'", 'block');;?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id='whiteListBox' class='hidden'>
|
||||
|
||||
@@ -37,7 +37,14 @@
|
||||
echo html::a(helper::createLink('doc', 'createLib', "type=$type&objectID=$objectID"), '<i class="icon icon-plus"></i> ' . $this->lang->doc->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
}
|
||||
|
||||
if($libID and common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID, $apiLibID);
|
||||
if($libType == 'api')
|
||||
{
|
||||
if(common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID", '', true), '<i class="icon icon-plus"></i> ' . $lang->api->createApi, '', 'class="btn btn-primary iframe" data-width="95%"');
|
||||
}
|
||||
elseif($libID and common::hasPriv('doc', 'create'))
|
||||
{
|
||||
echo $this->doc->printCreateBtn($lib, $type, $objectID, $moduleID, $apiLibID);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1416,7 +1416,7 @@ class projectModel extends model
|
||||
$lib->name = $this->lang->doclib->main['project'];
|
||||
$lib->type = 'project';
|
||||
$lib->main = '1';
|
||||
$lib->acl = $project->acl != 'program' ? $project->acl : 'custom';
|
||||
$lib->acl = 'default';
|
||||
$lib->users = ',' . implode(',', array_filter($authorizedUsers)) . ',';
|
||||
$lib->vision = zget($project, 'vision', 'rnd');
|
||||
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
|
||||
|
||||
Reference in New Issue
Block a user