diff --git a/module/doc/css/createlib.css b/module/doc/css/createlib.css index 0baf88c868..b035dd192d 100644 --- a/module/doc/css/createlib.css +++ b/module/doc/css/createlib.css @@ -1,7 +1,9 @@ .modal-dialog {width: 75%;} -form {margin-bottom: 100px; padding-left: 65px;} +form {margin-bottom: 50px;} table {width: 90% !important;} +table th {width: 70px;} +#aclBox .acl-tip {color: #838a9d;} #whiteListBox div.input-group {margin-bottom: 2px;} #product_chosen {width: 50% !important;} diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 9b798ba2eb..f92dd4e03e 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -31,7 +31,7 @@ function toggleAcl(acl, type) else if(acl == 'private') { $('#whiteListBox').removeClass('hidden'); - $('#groupBox').addClass('hidden'); + $('#groupBox').remove('hidden'); if(type == 'doc') { loadWhitelist(libID); @@ -46,6 +46,8 @@ function toggleAcl(acl, type) if(type == 'lib') { + if((libType == 'api' || libType == 'book') && acl == 'private') $('#whiteListBox').addClass('hidden'); + if(libType == 'project' && typeof(doclibID) != 'undefined') { var link = createLink('doc', 'ajaxGetWhitelist', 'doclibID=' + doclibID + '&acl=' + acl); @@ -57,11 +59,6 @@ function toggleAcl(acl, type) }) } } - else - { - var notice = typeof(noticeAcl[acl]) != 'undefined' ? noticeAcl[acl] : ''; - $('#noticeAcl').html(notice); - } } /** diff --git a/module/doc/js/createlib.js b/module/doc/js/createlib.js index ee7acfa3ef..e69de29bb2 100644 --- a/module/doc/js/createlib.js +++ b/module/doc/js/createlib.js @@ -1,140 +0,0 @@ -$(function() -{ - $('input[name="type"]').change(function() - { - var libType = $(this).val(); - changeByLibType(libType); - }) - changeByLibType($('input[name="type"]:checked').val()); - toggleAcl($('form [name=acl]:checked').val(), 'lib'); -}); - -/** - * Change form by lib type. - * - * @param string libType - * @access public - * @return void - */ -function changeByLibType(libType) -{ - if(libType == 'product') - { - $('table tr.product').removeClass('hidden'); - $('#product').attr('disabled', false); - - $('table tr.project').addClass('hidden'); - $('#project').attr('disabled', true); - - $('table tr.execution').addClass('hidden'); - $('#execution').attr('disabled', true); - - $('.normalLib').removeClass('hidden'); - $('.normalLib input').attr('disabled', false); - - $('table tr.apilib').addClass('hidden'); - $('.apilib input, #desc, #baseUrl').attr('disabled', true); - - $('form').removeAttr('action'); - - changeDoclibAcl(libType); - } - else if(libType == 'project') - { - $('table tr.project').removeClass('hidden'); - $('#project').attr('disabled', false); - - $('table tr.product').addClass('hidden'); - $('#product').attr('disabled', true); - - $('table tr.execution').addClass('hidden'); - $('#execution').attr('disabled', true); - - $('.normalLib').removeClass('hidden'); - $('.normalLib input').attr('disabled', false); - - $('table tr.apilib').addClass('hidden'); - $('.apilib input, #desc, #baseUrl').attr('disabled', true); - - $('form').removeAttr('action'); - - changeDoclibAcl(libType); - } - else if(libType == 'execution') - { - $('table tr.execution').removeClass('hidden'); - $('#execution').attr('disabled', false); - - $('table tr.product').addClass('hidden'); - $('#product').attr('disabled', true); - - $('table tr.project').addClass('hidden'); - $('#project').attr('disabled', true); - - $('.normalLib').removeClass('hidden'); - $('.normalLib input').attr('disabled', false); - - $('table tr.apilib').addClass('hidden'); - $('.apilib input, #desc, #baseUrl').attr('disabled', true); - - $('form').removeAttr('action'); - - changeDoclibAcl(libType); - } - else if(libType == 'api') - { - $('table tr.product').addClass('hidden'); - $('#product').attr('disabled', true); - - $('table tr.project').addClass('hidden'); - $('#project').attr('disabled', true); - - $('table tr.execution').addClass('hidden'); - $('#execution').attr('disabled', true); - - $('.normalLib').addClass('hidden'); - $('.normalLib input').attr('disabled', true); - - $('table tr.apilib').removeClass('hidden'); - $('.apilib input, #desc, #baseUrl').attr('disabled', false); - - $('form').attr('action', createLink('api', 'createLib')); - - changeDoclibAcl(libType); - } - else - { - $('table tr.product').addClass('hidden'); - $('#product').attr('disabled', true); - - $('table tr.project').addClass('hidden'); - $('#project').attr('disabled', true); - - $('table tr.execution').addClass('hidden'); - $('#execution').attr('disabled', true); - - $('.normalLib').removeClass('hidden'); - $('.normalLib input').attr('disabled', false); - - $('table tr.apilib').addClass('hidden'); - $('.apilib input, #desc, #baseUrl').attr('disabled', true); - - $('form').removeAttr('action'); - - changeDoclibAcl(libType); - } - - $('#whiteListBox').addClass('hidden'); -} - -function changeDoclibAcl(libType) -{ - if(libType == 'product' || libType == 'execution') - { - $('form input[name="acl"]').closest('td').find('span:first').html($('#aclBoxA td').html()); - } - else - { - $('form input[name="acl"]').closest('td').find('span:first').html($('#aclBoxB td').html()); - } -} diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index b47452b53d..7d7fc75828 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -10,7 +10,7 @@ * @link http://www.zentao.net */ $lang->doclib = new stdclass(); -$lang->doclib->name = '文档库名称'; +$lang->doclib->name = '库名称'; $lang->doclib->control = '访问控制'; $lang->doclib->group = '分组'; $lang->doclib->user = '用户'; @@ -29,6 +29,10 @@ $lang->doclib->aclListB['open'] = '公开'; $lang->doclib->aclListB['custom'] = '自定义'; $lang->doclib->aclListB['private'] = '私有'; +$lang->doclib->aclList = array(); +$lang->doclib->aclList['open'] = "公开 (有文档视图权限即可访问)"; +$lang->doclib->aclList['private'] = "私有 (仅创建者和白名单用户可访问)"; + $lang->doclib->create['product'] = '创建' . $lang->productCommon . '文档库'; $lang->doclib->create['execution'] = '创建' . $lang->executionCommon . '文档库'; $lang->doclib->create['custom'] = '创建自定义文档库'; diff --git a/module/doc/model.php b/module/doc/model.php index 5b73c6b3de..129107b1fd 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -196,6 +196,7 @@ class docModel extends model ->setForce('execution', $this->post->type == 'execution' ? $this->post->execution : 0) ->join('groups', ',') ->join('users', ',') + ->remove('uid,contactListMenu') ->get(); if($lib->type == 'execution' and $lib->execution) diff --git a/module/doc/view/createlib.html.php b/module/doc/view/createlib.html.php index 3be904d5e9..b6bf8067e3 100644 --- a/module/doc/view/createlib.html.php +++ b/module/doc/view/createlib.html.php @@ -40,6 +40,14 @@