Merge branch 'release/zentaopms_18.3' of https://gitlab.zcorp.cc/easycorp/zentaopms into release/zentaopms_18.3
This commit is contained in:
+22
-20
@@ -1023,17 +1023,14 @@ class doc extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function showFiles($type, $objectID, $viewType = '', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $searchTitle = '')
|
||||
public function showFiles($type, $objectID, $viewType = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1, $searchTitle = '')
|
||||
{
|
||||
$this->loadModel('file');
|
||||
if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'list';
|
||||
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
|
||||
|
||||
$objects = $this->doc->getOrderedObjects($type);
|
||||
$objectID = $this->{$type}->saveState($objectID, $objects);
|
||||
$libs = $this->doc->getLibsByObject($type, $objectID);
|
||||
|
||||
$tab = strpos('doc,product,project,execution', $this->app->tab) !== false ? $this->app->tab : 'doc';
|
||||
if($tab != 'doc') $this->loadModel($tab)->setMenu($objectID);
|
||||
$objects = $this->doc->getOrderedObjects($type);
|
||||
list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, 0);
|
||||
|
||||
$table = $this->config->objectTables[$type];
|
||||
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
|
||||
@@ -1042,27 +1039,32 @@ class doc extends control
|
||||
if(empty($_POST) and !empty($searchTitle)) $this->post->title = $searchTitle;
|
||||
|
||||
/* Load pager. */
|
||||
$rawMethod = $this->app->rawMethod;
|
||||
$this->app->rawMethod = 'showFiles';
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$this->app->rawMethod = $rawMethod;
|
||||
|
||||
$files = $this->doc->getLibFiles($type, $objectID, $orderBy, $pager);
|
||||
|
||||
$this->view->title = $object->name;
|
||||
$this->view->position[] = $object->name;
|
||||
|
||||
$this->view->type = $type;
|
||||
$this->view->object = $object;
|
||||
$this->view->files = $files;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->pager = $pager;
|
||||
$this->view->viewType = $viewType;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
|
||||
$this->view->summary = $this->doc->summary($files);
|
||||
$this->view->sourcePairs = $this->doc->getFileSourcePairs($files);
|
||||
$this->view->fileIcon = $this->doc->getFileIcon($files);
|
||||
$this->view->libTree = $this->doc->getLibTree(0, $libs, $type, 0, $objectID);
|
||||
$this->view->type = $type;
|
||||
$this->view->object = $object;
|
||||
$this->view->files = $files;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->pager = $pager;
|
||||
$this->view->viewType = $viewType;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->objectID = $objectID;
|
||||
$this->view->canBeChanged = common::canModify($type, $object); // Determines whether an object is editable.
|
||||
$this->view->summary = $this->doc->summary($files);
|
||||
$this->view->sourcePairs = $this->doc->getFileSourcePairs($files);
|
||||
$this->view->fileIcon = $this->doc->getFileIcon($files);
|
||||
$this->view->libTree = $this->doc->getLibTree(0, $libs, $type, 0, $objectID);
|
||||
$this->view->objectDropdown = $objectDropdown;
|
||||
$this->view->searchTitle = $searchTitle;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,100 @@
|
||||
.c-id {width: 80px;}
|
||||
.c-source {width: 300px;}
|
||||
.c-size {width: 100px;}
|
||||
.c-type {width: 70px;}
|
||||
|
||||
.flex {display: flex;}
|
||||
.flex-none {flex: none;}
|
||||
.flex-auto {flex: auto;}
|
||||
.flex-full > .panel {box-shadow: none;}
|
||||
.float-r {float: right;}
|
||||
.h-full {height: 100%;}
|
||||
.w-full {width: 100%;}
|
||||
.overflow-x-auto {overflow-x: auto;}
|
||||
.overflow-auto {overflow: auto;}
|
||||
.overflow-visible {overflow: visible;}
|
||||
.overflow-hidden {overflow: hidden;}
|
||||
.img-lib {width: 14px; height: 14px; margin-bottom: 2px; flex: 0 0 14px;}
|
||||
#mainContent {padding-top: 0; padding-bottom: 0;}
|
||||
#mainContent #createDropdown {display: inline-block;}
|
||||
#mainContent #createDropdown ul {position: absolute;}
|
||||
#pageNav .dropdown-menu {max-height: inherit;}
|
||||
#mainContent > .panel {margin-bottom: 0; height: calc(100vh - 125px); overflow-y: auto;}
|
||||
#mainContent > .main-col {padding-left: 0;}
|
||||
|
||||
.no-content {width: 100px; height: 100px; margin: 0 auto;}
|
||||
.notice {text-align: center; padding-left: 15px; padding-top: 20px;}
|
||||
.no-content-button {text-align: center; padding-top: 20px;}
|
||||
.no-content-button a:nth-child(2) {margin-left: 20px;}
|
||||
|
||||
.cell .detail .detail-title {padding-left: 5px; list-style: none;}
|
||||
.menu-actions {position: absolute; top: 7px; right: 45px; padding: 7px 8px;}
|
||||
.detail ul {position: relative;}
|
||||
.tail-info {position: absolute; right: 0; padding-left: 10px; padding-top: 1px;}
|
||||
.tail-info, .doc-title, span.item {background: #fff;}
|
||||
span.item>a {padding-left: 6px;}
|
||||
span.dotted-line+a {display: block;}
|
||||
#modules li.doc:before, .chapterNode:before, .independent:before {content: " "; width: 100%; border-bottom: 1px dashed #b5b9c5; position: absolute; top: 13px; right: 0; left: 30px;}
|
||||
.doc-title ,.item{display: inline-block !important; position: relative; padding-right: 10px; max-width:80%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;}
|
||||
#modules i.icon-file-text {color: #D0D2D6; font-size: 14px;}
|
||||
|
||||
.sortable-sorting .module-name > a {cursor: move;}
|
||||
.sortable-sorting li >.tree-group {opacity: .5;}
|
||||
.sortable-sorting li:before {opacity: .3;}
|
||||
.sortable-sorting .drop-here .tree-group {background-color: #fff3e0;}
|
||||
.sortable-sorting .drop-here .tree-group > * {opacity: .1;}
|
||||
.sortable-sorting .drag-shadow .tree-group {opacity: 1!important;}
|
||||
.sortable-sorting .drag-shadow .tree-actions {visibility: hidden;}
|
||||
.is-sorting > li:before {opacity: 1;}
|
||||
.is-sorting > li > .tree-group {opacity: 1; border-radius: 4px;}
|
||||
.is-sorting > li ul {display: none!important;}
|
||||
li.drag-shadow ul {display: none!important;}
|
||||
|
||||
.tree-group {position: relative;}
|
||||
.tree-group > .module-name {white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block;}
|
||||
.tree li.has-list.open:before {left: 6px;}
|
||||
.main-table-content {display: flex; gap: 20px;}
|
||||
.main-table-content > .side {flex: 0 0 300px;}
|
||||
.main-table-content > .content {flex: 1;}
|
||||
|
||||
/* css for mian */
|
||||
#mainContent > #sideBar {flex: 0 0 150px; overflow-x: auto; padding-right: 5px;}
|
||||
[lang^=zh] #mainContent > #sideBar {flex: 0 0 180px;}
|
||||
|
||||
/* css for tree */
|
||||
|
||||
.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;}
|
||||
.tree li > .list-toggle {top: 4px;}
|
||||
.input-tree {width: 120px;}
|
||||
.tree-icon {position: absolute; right: 0;}
|
||||
.tree li.has-input {overflow: hidden;}
|
||||
|
||||
/* css for sidebar */
|
||||
.sidebar-toggle {flex: 0 0 16px;}
|
||||
.sidebar-toggle > .icon {width: 12px; height: 30px; margin-top: -10px; line-height: 30px; color: #fff; text-align: center; background: #7dcdfe; border-radius: 6px; cursor: pointer;}
|
||||
|
||||
.spliter {flex: 0 0 12px;}
|
||||
.spliter-btn {height: 28px; width: 10px; background: #fff; position: absolute; top: 30%; left: -1px; border: 1px solid #D9D9D9; border-radius: 2px;}
|
||||
.spliter-btn > .spliter-inner {width: 4px; height: 12px; border-left: 1px solid #D9D9D9; border-right: 1px solid #D9D9D9;}
|
||||
|
||||
#mainContent .table-empty-tip > p, #createDocs {display: inline-block;}
|
||||
.createDropdown a.btn-primary, .createDropdown a.btn-info {border-right: 1px solid rgba(255,255,255,0.2);}
|
||||
.createDropdown button.dropdown-toggle.btn-primary, .createDropdown button.dropdown-toggle.btn-info {padding: 6px;}
|
||||
.createDropdown ul > li {text-align: left;}
|
||||
.createDropdown .btn.btn-info:hover {box-shadow: none;}
|
||||
|
||||
.table .c-name > a:first-child {display: inline-block; max-width: 90%; overflow: hidden;}
|
||||
.table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: -3px;}
|
||||
table.table > thead > tr {height: 32px;}
|
||||
|
||||
#bysearchTab::before {display: none;}
|
||||
#leftBar .selectBox #currentItem {width: 150px; display: flex; align-items: center;}
|
||||
[lang^=zh] #leftBar .selectBox #currentItem {width: 180px;}
|
||||
#leftBar .selectBox #currentItem > .text {overflow: hidden; text-align: left; flex: 0 1 100%;}
|
||||
#leftBar .searchBox {padding-left: 5px;}
|
||||
|
||||
@@ -4,4 +4,332 @@ $(function()
|
||||
|
||||
$('#navbar .nav li').removeClass('active');
|
||||
$("#navbar .nav li[data-id=" + type + ']').addClass('active');
|
||||
|
||||
/**
|
||||
* Render Dropdown dom.
|
||||
*
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function renderDropdown(option)
|
||||
{
|
||||
var libClass = '.libDorpdown';
|
||||
if(option.type != 'dropDownLibrary') libClass = '.moduleDorpdown';
|
||||
if($(libClass).find('li').length == 0) return '';
|
||||
var dropdown = '<ul class="dropdown-menu dropdown-in-tree" id="' + option.type + '" style="display: unset; left:' + option.left + 'px; top:' + option.top + 'px;">';
|
||||
dropdown += $(libClass).html().replace(/%libID%/g, option.libID).replace(/%moduleID%/g, option.moduleID).replace(/%hasChildren%/g, option.hasChildren);
|
||||
dropdown += '</ul>';
|
||||
return dropdown;
|
||||
}
|
||||
|
||||
var imgObj = {
|
||||
'annex': 'annex',
|
||||
'lib': 'wiki-file-lib',
|
||||
'api': 'interface'
|
||||
}
|
||||
|
||||
$('#fileTree').tree(
|
||||
{
|
||||
initialState: 'active',
|
||||
data: treeData,
|
||||
itemCreator: function($li, item)
|
||||
{
|
||||
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 + '">';
|
||||
|
||||
$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>';
|
||||
$item += '<span style="padding-left: 5px;">';
|
||||
$item += item.name
|
||||
$item += '</span>';
|
||||
$item += '<i class="icon icon-drop icon-ellipsis-v hidden tree-icon" data-isCatalogue="' + (item.type ? false : true) + '"></i>';
|
||||
$item += '</div>';
|
||||
$item += '</a>';
|
||||
|
||||
$li.append($item);
|
||||
$li.addClass(libClass);
|
||||
if(item.active) $li.addClass('active open in');
|
||||
}
|
||||
});
|
||||
|
||||
$('li.has-list > ul, #fileTree').addClass("menu-active-primary menu-hover-primary");
|
||||
|
||||
$('#fileTree').on('mousemove', 'a', function()
|
||||
{
|
||||
if($(this).data('type') == 'annex') return;
|
||||
if(!$(this).data('action')) return;
|
||||
|
||||
var libClass = '.libDorpdown';
|
||||
if(!$(this).hasClass('lib')) libClass = '.moduleDorpdown';
|
||||
|
||||
$(this).find('.icon').removeClass('hidden');
|
||||
$(this).addClass('show-icon'); if($(libClass).find('li').length == 0) return false;
|
||||
|
||||
}).on('mouseout', 'a', function()
|
||||
{
|
||||
$(this).find('.icon').addClass('hidden');
|
||||
$(this).removeClass('show-icon');
|
||||
}).on('click', 'a', function(e)
|
||||
{
|
||||
if(!$(this).data('action')) return;
|
||||
|
||||
var isLib = $(this).hasClass('lib');
|
||||
var moduleID = $(this).data('id');
|
||||
var libID = 0;
|
||||
var params = '';
|
||||
|
||||
if(isLib)
|
||||
{
|
||||
if($(this).data('type') == 'annex' && !canViewFiles) return false;
|
||||
|
||||
libID = moduleID;
|
||||
moduleID = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
libID = $(this).closest('.lib').data('id');
|
||||
}
|
||||
linkParams = linkParams.replace('%s', '&libID=' + libID + '&moduleID=' + moduleID);
|
||||
var link = $(this).data('type') == 'annex' ? createLink('doc', 'showFiles', 'type=' + objectType + '&objectID=' + objectID) : createLink('doc', 'tableContents', linkParams);
|
||||
location.href = link
|
||||
});
|
||||
|
||||
var moduleData = {
|
||||
"name" : "",
|
||||
"createType" : "",
|
||||
"libID" : "",
|
||||
"parentID" : "",
|
||||
"objectID" : "",
|
||||
"moduleType" : "",
|
||||
"order" : "",
|
||||
"isUpdate" : ""
|
||||
};
|
||||
|
||||
$('#fileTree').on('click', '.icon-drop', function(e)
|
||||
{
|
||||
$('.dropdown-in-tree').css('display', 'none');
|
||||
var isCatalogue = $(this).attr('data-isCatalogue') === 'false' ? false : true;
|
||||
var dropDownID = isCatalogue ? 'dropDownCatalogue' : 'dropDownLibrary';
|
||||
var libID = 0;
|
||||
var moduleID = 0;
|
||||
var parentID = 0;
|
||||
var $module = $(this).closest('a');
|
||||
var hasChildren = $module.data('has-children');
|
||||
var moduleType = '';
|
||||
if($module.hasClass('lib'))
|
||||
{
|
||||
libID = $module.data('id');
|
||||
moduleType = $module.data('type');
|
||||
parentID = libID;
|
||||
}
|
||||
else
|
||||
{
|
||||
moduleID = $module.data('id');
|
||||
libID = $module.closest('.lib').data('id');
|
||||
moduleType = $module.closest('.lib').data('type');
|
||||
parentID = $module.closest('ul').closest('.lib').data('id');
|
||||
}
|
||||
|
||||
moduleData = {
|
||||
"libID" : libID,
|
||||
"parentID" : parentID,
|
||||
"objectID" : moduleID,
|
||||
"moduleType": moduleType == 'lib' ? 'doc' : moduleType,
|
||||
};
|
||||
|
||||
var option = {
|
||||
left : e.pageX,
|
||||
top : e.pageY,
|
||||
type : dropDownID,
|
||||
libID : libID,
|
||||
moduleID : moduleID,
|
||||
hasChildren : hasChildren
|
||||
};
|
||||
|
||||
var dropDown = renderDropdown(option);
|
||||
$(".m-doc-showfiles").append(dropDown);
|
||||
e.stopPropagation();
|
||||
}).on('blur', '.file-tree input.input-tree', function()
|
||||
{
|
||||
var $input = $(this);
|
||||
var value = $input.val();
|
||||
if(!value)
|
||||
{
|
||||
$input.closest('[data-id=insert]').remove();
|
||||
return;
|
||||
}
|
||||
|
||||
moduleData.name = value;
|
||||
$.post(createLink('tree', 'ajaxCreateModule'), moduleData, function(result)
|
||||
{
|
||||
result = JSON.parse(result);
|
||||
if(result.result == 'fail')
|
||||
{
|
||||
bootbox.alert(
|
||||
result.message[0],
|
||||
function()
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
$('.file-tree .input-tree').focus()
|
||||
}, 10)
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
var module = result.module;
|
||||
var resultDom = $('[data-id=aTreeModal]').html().replace(/%name%/g, module.name).replace(/%id%/g, module.id).replace('insert', module.id);
|
||||
$input.closest('ul').find('.has-input').css('padding-left', '15px');
|
||||
$input.after(resultDom);
|
||||
$input.remove();
|
||||
if(moduleData.isUpdate)
|
||||
{
|
||||
$.getJSON(createLink('doc', 'tableContents', 'type=' + objectType + '&objectID=' + objectID , 'json'), function(data){
|
||||
var treeData = JSON.parse(data.data);
|
||||
$('#fileTree').data('zui.tree').reload(treeData.libTree);
|
||||
$('li.has-list > ul').addClass("menu-active-primary menu-hover-primary");
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('body').on('click', function()
|
||||
{
|
||||
$('.dropdown-in-tree').remove();
|
||||
}).on('click', '.sidebar-toggle', function()
|
||||
{
|
||||
var $icon = $(this).find('.icon');
|
||||
if($('#sideBar').hasClass('hidden'))
|
||||
{
|
||||
$icon.addClass('icon-angle-left');
|
||||
$icon.removeClass('icon-angle-right');
|
||||
$('#sideBar').removeClass('hidden');
|
||||
}
|
||||
else
|
||||
{
|
||||
$icon.addClass('icon-angle-right');
|
||||
$icon.removeClass('icon-angle-left');
|
||||
$('#sideBar').addClass('hidden');
|
||||
}
|
||||
}).on('click', '.dropdown-in-tree li', function(e)
|
||||
{
|
||||
var item = $(this).data();
|
||||
if($(this).hasClass('edit-module'))
|
||||
{
|
||||
new $.zui.ModalTrigger({
|
||||
keyboard : true,
|
||||
type : 'ajax',
|
||||
url : $(this).find('a').data('href')
|
||||
}).show();
|
||||
}
|
||||
if(item.type !== 'add') return;
|
||||
|
||||
var $item = $(this);
|
||||
moduleData.parentID = 0;
|
||||
moduleData.isUpdate = false;
|
||||
moduleData.createType = 'child';
|
||||
switch(item.method)
|
||||
{
|
||||
case 'addCataLib' :
|
||||
if(item.hasChildren)
|
||||
{
|
||||
var $input = $('[data-id=liTreeModal]').html();
|
||||
var $rootDom = $('[data-id=' + item.libid + ']a + ul');
|
||||
$rootDom.append($input);
|
||||
}
|
||||
else
|
||||
{
|
||||
var $input = $('[data-id=ulTreeModal]').html();
|
||||
var $rootDom = $('[data-id=' + item.libid + ']a');
|
||||
var $li = $rootDom.parent();
|
||||
moduleData.isUpdate = true;
|
||||
$rootDom.after($input);
|
||||
$li.addClass('open in has-list');
|
||||
}
|
||||
$('#fileTree').data('zui.tree').expand($('li[data-id="' + item.libid + '"]'));
|
||||
$rootDom.parent().find('input').focus();
|
||||
break;
|
||||
case 'addCataBro' :
|
||||
moduleData.createType = 'same';
|
||||
var $input = $('[data-id=liTreeModal]').html();
|
||||
var $rootDom = $('#fileTree li[data-id=' + item.id + ']');
|
||||
$rootDom.after($input);
|
||||
$rootDom.closest('ul').find('.has-input').css('padding-left', '0');
|
||||
$('#fileTree').find('input').focus();
|
||||
break;
|
||||
case 'addCataChild' :
|
||||
moduleData.parentID = item.id;
|
||||
if(item.hasChildren)
|
||||
{
|
||||
var $input = $('[data-id=liTreeModal]').html();
|
||||
var $rootDom = $('#fileTree [data-id=' + item.id + ']a + ul ');
|
||||
}
|
||||
else
|
||||
{
|
||||
var $input = $('[data-id=ulTreeModal]').html();
|
||||
var $rootDom = $('#fileTree [data-id=' + item.id + ']li');
|
||||
moduleData.isUpdate = true;
|
||||
$rootDom.addClass('open in has-list');
|
||||
}
|
||||
|
||||
$('#fileTree').data('zui.tree').expand($('li[data-id="' + item.id + '"]'));
|
||||
$rootDom.append($input);
|
||||
$rootDom.find('input').focus();
|
||||
break;
|
||||
}
|
||||
}).on('blur', '.file-tree input.input-tree', function()
|
||||
{
|
||||
var $input = $(this);
|
||||
var value = $input.val();
|
||||
if(!value)
|
||||
{
|
||||
$input.closest('[data-id=insert]').remove();
|
||||
return;
|
||||
}
|
||||
|
||||
moduleData.name = value;
|
||||
$.post(createLink('tree', 'ajaxCreateModule'), moduleData, function(result)
|
||||
{
|
||||
result = JSON.parse(result);
|
||||
if(result.result == 'fail')
|
||||
{
|
||||
bootbox.alert(
|
||||
result.message[0],
|
||||
function()
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
$('.file-tree .input-tree').focus()
|
||||
}, 10)
|
||||
}
|
||||
);
|
||||
return false;
|
||||
}
|
||||
var module = result.module;
|
||||
var resultDom = $('[data-id=aTreeModal]').html().replace(/%name%/g, module.name).replace(/%id%/g, module.id).replace('insert', module.id);
|
||||
$input.closest('ul').find('.has-input').css('padding-left', '15px');
|
||||
$input.after(resultDom);
|
||||
$input.remove();
|
||||
if(moduleData.isUpdate)
|
||||
{
|
||||
$.getJSON(createLink('doc', 'tableContents', 'type=' + objectType + '&objectID=' + objectID , 'json'), function(data){
|
||||
var treeData = JSON.parse(data.data);
|
||||
$('#fileTree').data('zui.tree').reload(treeData.libTree);
|
||||
$('li.has-list > ul').addClass("menu-active-primary menu-hover-primary");
|
||||
});
|
||||
}
|
||||
});
|
||||
}).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});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ $(function()
|
||||
if(option.type != 'dropDownLibrary') libClass = '.moduleDorpdown';
|
||||
if($(libClass).find('li').length == 0) return '';
|
||||
var dropdown = '<ul class="dropdown-menu dropdown-in-tree" id="' + option.type + '" style="display: unset; left:' + option.left + 'px; top:' + option.top + 'px;">';
|
||||
dropdown += $(libClass).html().replace(/%libID%/g, option.libID).replace(/%moduleID%/g, option.moduleID).replace(/%hasChildren%/g, option.hasChildren);
|
||||
dropdown += $(libClass).html().replace(/%libID%/g, option.libID).replace(/%moduleID%/g, option.moduleID).replace(/%hasChildren%/g, option.hasChildren).replace(/%libType%/g, option.libType);
|
||||
dropdown += '</ul>';
|
||||
return dropdown;
|
||||
}
|
||||
@@ -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.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>';
|
||||
@@ -77,7 +78,7 @@ $(function()
|
||||
|
||||
if(isLib)
|
||||
{
|
||||
if($(this).data('type') == 'annex') return false;
|
||||
if($(this).data('type') == 'annex' && !canViewFiles) return false;
|
||||
|
||||
libID = moduleID;
|
||||
moduleID = 0;
|
||||
@@ -87,7 +88,8 @@ $(function()
|
||||
libID = $(this).closest('.lib').data('id');
|
||||
}
|
||||
linkParams = linkParams.replace('%s', '&libID=' + libID + '&moduleID=' + moduleID);
|
||||
location.href = createLink('doc', 'tableContents', linkParams);
|
||||
var link = $(this).data('type') == 'annex' ? createLink('doc', 'showFiles', 'type=' + objectType + '&objectID=' + objectID) : createLink('doc', 'tableContents', linkParams);
|
||||
location.href = link
|
||||
});
|
||||
|
||||
var moduleData = {
|
||||
@@ -139,6 +141,7 @@ $(function()
|
||||
type : dropDownID,
|
||||
libID : libID,
|
||||
moduleID : moduleID,
|
||||
moduleType : moduleType,
|
||||
hasChildren : hasChildren
|
||||
};
|
||||
|
||||
|
||||
+10
-3
@@ -2888,7 +2888,7 @@ class docModel extends model
|
||||
if(in_array($type, array('product', 'project', 'execution')))
|
||||
{
|
||||
$libTree[$type] = array_merge($libTree[$type], $apiLibs);
|
||||
if($type == 'project' and !empty($libTree['execution'])) $libTree[$type] = array_merge($libTree[$type], $libTree['execution']);
|
||||
if($type == 'project' and !empty($libTree['execution'])) $libTree['execution'] = array_values($libTree['execution']);
|
||||
|
||||
$annex = new stdclass();
|
||||
$annex->id = 0;
|
||||
@@ -2898,14 +2898,21 @@ class docModel extends model
|
||||
$annex->objectID = $objectID;
|
||||
$annex->active = empty($libID) ? 1 : 0;
|
||||
|
||||
$libTree[$type][] = $annex;
|
||||
if($type == 'project')
|
||||
{
|
||||
$libTree['annex'] = $annex;
|
||||
}
|
||||
else
|
||||
{
|
||||
$libTree[$type][''] = $annex;
|
||||
}
|
||||
}
|
||||
elseif($type == 'api')
|
||||
{
|
||||
$libTree[$type] = array_merge($libTree[$type], $apiLibs);
|
||||
}
|
||||
|
||||
$libTree = array_values($libTree[$type]);
|
||||
if($type != 'project') $libTree = array_values($libTree[$type]);
|
||||
return $libTree;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,42 @@
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<div class="main-row fade" id="mainRow">
|
||||
<div class="main-col" data-min-width="400">
|
||||
<?php js::set('treeData', $libTree);?>
|
||||
<?php js::set('linkParams', "type=$type&objectID=$objectID%s");?>
|
||||
<?php js::set('docLang', $lang->doc);?>
|
||||
<?php js::set('libType', 'annex');?>
|
||||
<?php js::set('objectType', $type);?>
|
||||
<?php js::set('objectID', $objectID);?>
|
||||
<?php js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));?>
|
||||
<?php js::set('type', $type);?>
|
||||
<?php js::set('tab', $this->app->tab);?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="leftBar" class="btn-toolbar pull-left">
|
||||
<?php echo $objectDropdown;?>
|
||||
<div class='btn-group searchBox'>
|
||||
<form class="input-control has-icon-right table-col" method="post">
|
||||
<?php echo html::input('title', $this->post->title, "class='form-control' placeholder='{$lang->doc->fileTitle}'");?>
|
||||
<?php echo html::submitButton("<i class='icon icon-search'></i>", '', "btn btn-icon btn-link input-control-icon-right");?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<div class='btn-group'>
|
||||
<?php echo html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=list&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}&searchTitle=$searchTitle"), "<i class='icon icon-bars'></i>", '', "title={$this->lang->doc->browseTypeList['list']} class='btn btn-icon" . ($viewType == 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'");?>
|
||||
<?php echo html::a(inlink('showFiles', "type=$type&objectID=$objectID&viewType=card&orderBy=$orderBy&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}&searchTitle=$searchTitle"), "<i class='icon icon-cards-view'></i>", '', "title={$this->lang->doc->browseTypeList['grid']} class='btn btn-icon" . ($viewType != 'list' ? ' text-primary' : '') . "' data-app='{$this->app->tab}'");?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main-row fade <?php if(!empty($libTree)) echo 'flex';?>" id="mainContent">
|
||||
<div id='sideBar' class="panel side side-col col overflow-auto" data-min-width="150">
|
||||
<div id="fileTree" class="file-tree"></div>
|
||||
</div>
|
||||
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
|
||||
<div class="main-col flex-full overflow-visible flex-auto" data-min-width="500">
|
||||
<?php if($viewType == 'list'):?>
|
||||
<?php if(!empty($files)):?>
|
||||
<div class='main-table'>
|
||||
<table class="table has-sort-head">
|
||||
<table class="table has-sort-head" id='#filesTable'>
|
||||
<thead>
|
||||
<tr>
|
||||
<?php $this->app->rawMethod = 'showfiles';?>
|
||||
@@ -24,7 +54,7 @@
|
||||
<th class="c-id"><?php common::printOrderLink('id', $orderBy, $vars, $lang->doc->id);?></th>
|
||||
<th class="c-name"><?php common::printOrderLink('title', $orderBy, $vars, $lang->doc->fileTitle);?></th>
|
||||
<th class="c-source"><?php common::printOrderLink('objectID', $orderBy, $vars, $lang->doc->source);?></th>
|
||||
<th class="c-size"><?php common::printOrderLink('extension', $orderBy, $vars, $lang->doc->extension);?></th>
|
||||
<th class="c-type"><?php common::printOrderLink('extension', $orderBy, $vars, $lang->doc->extension);?></th>
|
||||
<th class="c-size"><?php common::printOrderLink('size', $orderBy, $vars, $lang->doc->size);?></th>
|
||||
<th class="c-size"><?php common::printOrderLink('addedBy', $orderBy, $vars, $lang->doc->addedBy);?></th>
|
||||
<th class="c-size"><?php common::printOrderLink('addedDate', $orderBy, $vars, $lang->doc->addedDate);?></th>
|
||||
@@ -84,8 +114,8 @@
|
||||
<div class='col'>
|
||||
<div class='lib-file'>
|
||||
<?php
|
||||
$imageSize = $this->loadModel('file')->getImageSize($file);
|
||||
$imageWidth = $imageSize[0];
|
||||
$imageSize = $this->file->getImageSize($file);
|
||||
$imageWidth = isset($imageSize[0]) ? $imageSize[0] : 0;
|
||||
|
||||
$fileID = $file->id;
|
||||
$url = helper::createLink('file', 'download', 'fileID=' . $fileID);
|
||||
@@ -140,8 +170,42 @@
|
||||
<?php endif?>
|
||||
</div>
|
||||
</div>
|
||||
<?php js::set('type', $type);?>
|
||||
<?php js::set('tab', $this->app->tab);?>
|
||||
<div class='hidden' id='dropDownData'>
|
||||
<ul class='libDorpdown'>
|
||||
<?php if(common::hasPriv('tree', 'browse')):?>
|
||||
<li data-method="addCataLib" data-has-children='%hasChildren%' data-libid='%libID%' data-moduleid="%moduleID%" data-type="add"><a><i class="icon icon-controls"></i><?php echo $lang->doc->libDropdown['addModule'];?></a></li>
|
||||
<?php endif;?>
|
||||
<?php if(common::hasPriv('doc', 'editLib')):?>
|
||||
<li data-method="editLib"><a href='<?php echo inlink('editLib', 'libID=%libID%');?>' data-toggle='modal' data-type='iframe'><i class="icon icon-edit"></i><?php echo $lang->doc->libDropdown['editLib'];?></a></li>
|
||||
<?php endif;?>
|
||||
<?php if(common::hasPriv('doc', 'deleteLib')):?>
|
||||
<li data-method="deleteLib"><a href='<?php echo inlink('deleteLib', 'libID=%libID%');?>' target='hiddenwin'><i class="icon icon-trash"></i><?php echo $lang->doc->libDropdown['deleteLib'];?></a></li>
|
||||
<?php endif;?>
|
||||
</ul>
|
||||
<ul class='moduleDorpdown'>
|
||||
<?php if(common::hasPriv('tree', 'browse')):?>
|
||||
<li data-method="addCataBro" data-type="add" data-id="%moduleID%"><a><i class="icon icon-controls"></i><?php echo $lang->doc->libDropdown['addSameModule'];?></a></li>
|
||||
<li data-method="addCataChild" data-type="add" data-id="%moduleID%" data-has-children='%hasChildren%'><a><i class="icon icon-edit"></i><?php echo $lang->doc->libDropdown['addSubModule'];?></a></li>
|
||||
<li data-method="editCata" class='edit-module'><a data-href='<?php echo helper::createLink('tree', 'edit', 'moduleID=%moduleID%&type=doc');?>'><i class="icon icon-edit"></i><?php echo $lang->doc->libDropdown['editModule'];?></a></li>
|
||||
<li data-method="deleteCata"><a href='<?php echo helper::createLink('tree', 'delete', 'rootID=%libID%&moduleID=%moduleID%');?>' target='hiddenwin'><i class="icon icon-trash"></i><?php echo $lang->doc->libDropdown['delModule'];?></a></li>
|
||||
<?php endif;?>
|
||||
</ul>
|
||||
</div>
|
||||
<div class='hidden' data-id="ulTreeModal">
|
||||
<ul data-id="liTreeModal" class="menu-active-primary menu-hover-primary has-input">
|
||||
<li data-id="insert" class="has-input">
|
||||
<input data-target="%target%" class="form-control input-tree"></input>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="hidden" data-id="aTreeModal">
|
||||
<a href="###" style="position: relative" data-has-children="false" data-action="true" title="%name%" data-id="%id%">
|
||||
<div class="text h-full w-full flex-between overflow-hidden" style="position: relative;">
|
||||
<span style="padding-left: 5px;">%name%</span>
|
||||
<i class="icon icon-drop icon-ellipsis-v tree-icon hidden" data-iscatalogue="true"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<script>
|
||||
<?php $sessionString = session_name() . '=' . session_id();?>
|
||||
function downloadFile(fileID, extension, imageWidth)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<?php js::set('libType', $libType);?>
|
||||
<?php js::set('objectType', $type);?>
|
||||
<?php js::set('objectID', $objectID);?>
|
||||
<?php js::set('canViewFiles', common::hasPriv('doc', 'showfiles'));?>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div id="leftBar" class="btn-toolbar pull-left">
|
||||
<?php echo $objectDropdown;?>
|
||||
@@ -65,7 +66,7 @@
|
||||
<div id="fileTree" class="file-tree"></div>
|
||||
</div>
|
||||
<div class="sidebar-toggle flex-center"><i class="icon icon-angle-left"></i></div>
|
||||
<div class="main-col flex-full overflow-visible flex-auto overflow-visible" data-min-width="500">
|
||||
<div class="main-col flex-full overflow-visible flex-auto" data-min-width="500">
|
||||
<div class="cell<?php if($browseType == 'bySearch') echo ' show';?>" style="min-width: 400px" id="queryBox" data-module=<?php echo $type . $libType . 'Doc';?>></div>
|
||||
<?php
|
||||
if($browseType == 'annex')
|
||||
|
||||
Reference in New Issue
Block a user