diff --git a/db/zentaopms299.sql b/db/zentaopms299.sql index 87169ce5ce..c77c0549e6 100644 --- a/db/zentaopms299.sql +++ b/db/zentaopms299.sql @@ -1,4 +1,5 @@ UPDATE `zt_doc` SET `type` = 'text' WHERE `type` = 'url'; +UPDATE `zt_doc` SET `acl` = 'private' WHERE `acl` = 'custom'; UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'custom' and `acl` = 'custom'; UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'product' AND `acl` = 'custom'; diff --git a/module/common/model.php b/module/common/model.php index fbcdcdba81..d583121d92 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -894,7 +894,7 @@ class commonModel extends model global $lang, $config, $app; if(!$tab) return; - if($tab == 'admin' and method_exists($app->control, 'loadModel')) $app->control->loadModel('admin')->setMenu(); + if($tab == 'admin' and $app->control and method_exists($app->control, 'loadModel')) $app->control->loadModel('admin')->setMenu(); $icon = zget($lang->navIcons, $tab, ''); if(!in_array($tab, array('program', 'product', 'project'))) diff --git a/module/doc/css/create.css b/module/doc/css/create.css index f3a6bc97c9..0ff00a852b 100644 --- a/module/doc/css/create.css +++ b/module/doc/css/create.css @@ -31,9 +31,12 @@ #basicInfoLink {border: unset;} -#modalBasicInfo .modal-content {overflow-x: hidden; overflow-y: scroll;} +#modalBasicInfo .modal-dialog {width:800px;} +#modalBasicInfo .modal-content {padding:0px;} #modalBasicInfo .modal-header {padding: 0px; border:0px; margin:0px;} -#modalBasicInfo .modal-body {padding-bottom: 10px; padding-top:0px;} +#modalBasicInfo .modal-header .close {position:absolute; right:20px; top:20px} +#modalBasicInfo .modal-body {padding:0 30px 0 10px; ;overflow-x: hidden !important;} +#basicInfoBox{margin-bottom: 10px;} #basicInfoBox tfoot td {padding-bottom: 0;} .aclBox .radio-inline{display:block;} .aclBox .radio-inline+.radio-inline {margin-left: 0px !important;} diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 53e67ddd1a..853e6f22dc 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -1,11 +1,12 @@ /** - * Load modules by libID. + * Load modules by objectID and objectType. * - * @param int $libID + * @param string $objectType + * @param int $objectID * @access public * @return void */ -function loadModules(objectType, objectID) +function loadObjectModules(objectType, objectID) { var link = createLink('doc', 'ajaxGetModules', 'objectType=' + objectType + '&objectID=' + objectID); $('#moduleBox').load(link, function(){$('#moduleBox').find('select').chosen()}); @@ -14,15 +15,15 @@ function loadModules(objectType, objectID) /** * Load executions. * - * @param id $projectID + * @param int $projectID * @access public * @return void */ function loadExecutions(projectID) { var link = createLink('project', 'ajaxGetExecutions', "projectID=" + projectID + "&executionID=0&mode=multiple"); - $('#executionBox').load(link, function(){$('#executionBox').find('select').attr('data-placeholder', holders.execution).attr('onchange', "loadModules(this.value, 'execution')").chosen()}); - loadModules('project', projectID); + $('#executionBox').load(link, function(){$('#executionBox').find('select').attr('data-placeholder', holders.execution).attr('onchange', "loadObjectModules('execution', this.value)").chosen()}); + loadObjectModules('project', projectID); } /** diff --git a/module/doc/js/create.js b/module/doc/js/create.js index 8547c1beeb..6691676916 100644 --- a/module/doc/js/create.js +++ b/module/doc/js/create.js @@ -1,21 +1,22 @@ $(function() { + /* Set editor content height. */ + var contentHeight = $(document).height() - 92; + setTimeout(function(){$('.ke-edit-iframe, .ke-edit, .ke-edit-textarea').height(contentHeight);}, 100); + setTimeout(function(){$('.CodeMirror').height($(document).height() - 112);}, 100); + + /* Change for show create error. */ + $('#contentBox #content').attr('id', 'contentHTML'); + /* Copy doc title to modal title. */ + $('#modalBasicInfo').on('show.zui.modal', function() + { + $('#modalBasicInfo #copyTitle').html($('.doc-title #editorTitle').val().replace(/&/g, "&").replace(//g, ">").replace(/"/g, """).replace(/'/g, "'")); + }); + + $('iframe.ke-edit-iframe').contents().find('.article-content').css('padding', '20px 20px 0 20px'); + toggleAcl($('input[name="acl"]:checked').val(), 'doc'); setTimeout(function(){initPage(docType)}, 50); - $('input[name="type"]').change(function() - { - var type = $(this).val(); - if(type == 'text') - { - $('#contentBox').removeClass('hidden'); - $('#urlBox').addClass('hidden'); - } - else if(type == 'url') - { - $('#contentBox').addClass('hidden'); - $('#urlBox').removeClass('hidden'); - } - }); if(typeof(window.editor) != 'undefined') { $('.ke-toolbar .ke-outline:last').after("Markdown"); diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index 1d4a6755b0..b8a3f9c381 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -196,12 +196,8 @@ $lang->doc->libIconList['custom'] = 'icon-folder-o'; $lang->doc->systemLibs['product'] = $lang->productCommon; $lang->doc->systemLibs['execution'] = $lang->executionCommon; -$lang->doc->aclList['open'] = '公开'; -$lang->doc->aclList['custom'] = '自定义'; -$lang->doc->aclList['private'] = '私有'; - -$lang->doc->projectAclList['open'] = "公开(有所属库权限即可访问)"; -$lang->doc->projectAclList['private'] = "私有(仅创建者和白名单用户可访问)"; +$lang->doc->aclList['open'] = "公开(有所属库权限即可访问)"; +$lang->doc->aclList['private'] = "私有(仅创建者和白名单用户可访问)"; $lang->doc->typeList['html'] = '富文本'; $lang->doc->typeList['markdown'] = 'Markdown'; @@ -211,7 +207,6 @@ $lang->doc->typeList['ppt'] = 'PPT'; $lang->doc->typeList['excel'] = 'Excel'; $lang->doc->createList['html'] = '创建文档'; -$lang->doc->createList['api'] = '创建接口'; $lang->doc->createList['template'] = '由模板创建'; $lang->doc->createList['word'] = 'Word'; $lang->doc->createList['ppt'] = 'PPT'; diff --git a/module/doc/model.php b/module/doc/model.php index 604755ce3a..7c1051fce5 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2914,7 +2914,7 @@ class docModel extends model */ public function printCreateBtn($lib, $type, $objectID, $moduleID, $apiLibID = 0, $from = '') { - $libType = isset($lib->type) && $lib->type == 'api' ? 'api' : 'lib'; + if(!common::hasPriv('doc', 'create')) return null; $class = $from == 'list' ? 'btn-info' : 'btn-primary'; $html = "