diff --git a/module/api/control.php b/module/api/control.php index a307a4f3db..0e1463bf0c 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -389,12 +389,12 @@ class api extends control /* Record action for create api library. */ $this->action->create('doclib', $libID, 'created'); + if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); /* Set locate object data. */ - setCookie("objectType", $this->post->libType, $this->config->cookieLife, $this->config->webRoot, '', false, true); - setCookie("objectID", $this->post->libType == 'project' ? $this->post->project : $this->post->product, $this->config->cookieLife, $this->config->webRoot, '', false, true); + setCookie("objectType", $this->post->libType, $this->config->cookieLife, $this->config->webRoot); + setCookie("objectID", $this->post->libType == 'project' ? $this->post->project : $this->post->product, $this->config->cookieLife, $this->config->webRoot); - if(isonlybody()) return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent')); if(!helper::isAjaxRequest()) return print(js::locate($this->createLink('api', 'index', "libID=$libID"), 'parent.parent')); return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('api', 'index', "libID=$libID"))); } diff --git a/module/api/css/index.css b/module/api/css/index.css index 4f6d61bb3f..54e84116f8 100644 --- a/module/api/css/index.css +++ b/module/api/css/index.css @@ -25,3 +25,105 @@ a.lib {margin-bottom: 0; width: unset;} /* 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;} +.file-tree a {height: 30px;} + +.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;} +.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;} +.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;} +.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%;} + diff --git a/module/api/js/common.js b/module/api/js/common.js index 161b5765d7..7becb01d72 100644 --- a/module/api/js/common.js +++ b/module/api/js/common.js @@ -42,13 +42,21 @@ function toggleLibType(libType) { $('#projectBox').removeClass('hidden'); $('#productBox').addClass('hidden'); + $('#acldefault').closest('.radio').show(); $('#acldefault').next('.acl-tip').html($('#acldefault').next('.acl-tip').html().replace(productLang, projectLang)); } + else if(libType == 'product') + { + $('#projectBox').addClass('hidden'); + $('#productBox').removeClass('hidden'); + $('#acldefault').closest('.radio').show(); + $('#acldefault').next('.acl-tip').html($('#acldefault').next('.acl-tip').html().replace(projectLang, productLang)); + } else { $('#projectBox').addClass('hidden'); - $('#productBox').removeClass('hidden'); - $('#acldefault').next('.acl-tip').html($('#acldefault').next('.acl-tip').html().replace(projectLang, productLang)); + $('#productBox').addClass('hidden'); + $('#acldefault').closest('.radio').hide(); } } diff --git a/module/api/lang/de.php b/module/api/lang/de.php index 62b489bc14..d65886c82d 100644 --- a/module/api/lang/de.php +++ b/module/api/lang/de.php @@ -177,6 +177,7 @@ $lang->api->requestTypeOptions['multipart/form-data'] = 'multipart $lang->api->libTypeList = array(); $lang->api->libTypeList['product'] = $lang->productCommon . ' Api Library'; $lang->api->libTypeList['project'] = $lang->projectCommon . ' Api Library'; +$lang->api->libTypeList['nolink'] = 'No Linked Api Library'; $lang->api->statusOptions = array( 'done' => 'Done', diff --git a/module/api/lang/en.php b/module/api/lang/en.php index 9670e8feb4..5184c3f953 100644 --- a/module/api/lang/en.php +++ b/module/api/lang/en.php @@ -177,6 +177,7 @@ $lang->api->requestTypeOptions['multipart/form-data'] = 'multipart $lang->api->libTypeList = array(); $lang->api->libTypeList['product'] = $lang->productCommon . ' Api Library'; $lang->api->libTypeList['project'] = $lang->projectCommon . ' Api Library'; +$lang->api->libTypeList['nolink'] = 'No Linked Api Library'; $lang->api->statusOptions = array( 'done' => 'Done', diff --git a/module/api/lang/fr.php b/module/api/lang/fr.php index 3e9ed3239c..d5c9798c13 100644 --- a/module/api/lang/fr.php +++ b/module/api/lang/fr.php @@ -177,6 +177,7 @@ $lang->api->requestTypeOptions['multipart/form-data'] = 'multipart $lang->api->libTypeList = array(); $lang->api->libTypeList['product'] = $lang->productCommon . ' Api Library'; $lang->api->libTypeList['project'] = $lang->projectCommon . ' Api Library'; +$lang->api->libTypeList['nolink'] = 'No Linked Api Library'; $lang->api->statusOptions = array( 'done' => 'Done', diff --git a/module/api/lang/zh-cn.php b/module/api/lang/zh-cn.php index 9b5397e7ba..a217ede093 100755 --- a/module/api/lang/zh-cn.php +++ b/module/api/lang/zh-cn.php @@ -177,6 +177,7 @@ $lang->api->requestTypeOptions['multipart/form-data'] = 'multipart $lang->api->libTypeList = array(); $lang->api->libTypeList['product'] = $lang->productCommon . '接口库'; $lang->api->libTypeList['project'] = $lang->projectCommon . '接口库'; +$lang->api->libTypeList['nolink'] = '无关联接口库'; $lang->api->statusOptions = array( 'done' => '开发完成', diff --git a/module/doc/control.php b/module/doc/control.php index 3e8e8334f5..66512217a5 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -321,12 +321,11 @@ class doc extends control * @param int|string $libID * @param int $moduleID * @param string $docType html|word|ppt|excel - * @param bool $fromGlobal * @param string $from * @access public * @return void */ - public function create($objectType, $objectID, $libID, $moduleID = 0, $docType = '', $fromGlobal = false, $from = 'doc') + public function create($objectType, $objectID, $libID, $moduleID = 0, $docType = '', $from = 'doc') { $linkType = $objectType; if($objectType == 'execution' and $this->app->tab != 'execution') $linkType = 'project'; @@ -430,7 +429,6 @@ class doc extends control $this->view->docType = $docType; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted'); - $this->view->fromGlobal = $fromGlobal; $this->view->from = $from; $this->display(); diff --git a/module/doc/css/create.css b/module/doc/css/create.css index 7dc3875d6f..6a209b8b9d 100644 --- a/module/doc/css/create.css +++ b/module/doc/css/create.css @@ -1,6 +1,6 @@ #main {padding: 0;} .container {padding: 0 !important;} -#mainContent {padding: 0 !important;} +#mainContent {padding: 0;} .doc-title input {border: unset; font-size: 18px; font-weight: bold; color: #3c4353; padding-left: 16px;} .doc-title .form-control:focus {border: unset; box-shadow: unset;} .doc-title input::-webkit-input-placeholder {color: #D8DBDE;} @@ -33,11 +33,11 @@ #modalBasicInfo .modal-dialog {width:800px;} #modalBasicInfo .modal-content {padding:0px;} -#modalBasicInfo .modal-body {padding:10px 30px 10px 10px; ;overflow-x: hidden !important;} +#modalBasicInfo .modal-body {padding:10px 30px 10px 10px; overflow-x: hidden !important;} #modalBasicInfo .modal-body .close {position:absolute; right:15px; top:15px} #basicInfoBox{margin-bottom: 10px;} #basicInfoBox tfoot td {padding-bottom: 0;} -.aclBox .radio-inline{display:block;} +.aclBox .radio-inline{display:block; padding-bottom:5px;} .aclBox .radio-inline+.radio-inline {margin-left: 0px !important;} #whiteListBox .input-group:last-child {margin-top: 10px;} diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 6e561d4623..86ab2447b4 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -93,9 +93,8 @@ function loadDocModule(libID) var link = createLink('doc', 'ajaxGetChild', 'libID=' + libID); $.post(link, function(data) { - $('#module').replaceWith(data); - $('#module_chosen').remove(); - $('#module').chosen(); + $('#moduleBox').html(data); + $('#module').picker(); }); loadWhitelist(libID); diff --git a/module/doc/js/selectlibtype.js b/module/doc/js/selectlibtype.js index 0b4b399ca4..e8b8ae5c76 100644 --- a/module/doc/js/selectlibtype.js +++ b/module/doc/js/selectlibtype.js @@ -27,7 +27,7 @@ function redirectParentWindow(objectType, libID, docType) } config.onlybody = 'no'; - var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=' + libID + '&moduleID=0&docType=' + docType + '&fromGlobal=true') + '#app=doc'; + var link = createLink('doc', 'create', 'objectType=' + objectType + '&objectID=0&libID=' + libID + '&moduleID=0&docType=' + docType) + '#app=doc'; window.parent.$.apps.open(link); } diff --git a/module/doc/js/tablecontents.js b/module/doc/js/tablecontents.js index a4801093ed..714612fff5 100644 --- a/module/doc/js/tablecontents.js +++ b/module/doc/js/tablecontents.js @@ -12,7 +12,7 @@ $(function() if(option.type != 'dropDownLibrary') libClass = '.moduleDorpdown'; if($(libClass).find('li').length == 0) return ''; var dropdown = '
'; return dropdown; } @@ -23,7 +23,6 @@ $(function() 'api': 'interface' } - console.log(treeData, 'treeData'); $('#fileTree').tree( { initialState: 'active', @@ -40,7 +39,7 @@ $(function() $item += ''; $item += item.name $item += ''; - $item += ''; + $item += ''; $item += ''; $item += ''; @@ -141,7 +140,6 @@ $(function() type : dropDownID, libID : libID, moduleID : moduleID, - moduleType : moduleType, hasChildren : hasChildren }; @@ -237,7 +235,7 @@ $(function() if(item.hasChildren) { var $input = $('[data-id=liTreeModal]').html(); - var $rootDom = $('[data-id=' + item.libid + ']a + ul'); + var $rootDom = $('[data-id=' + item.moduleid+ ']a + ul'); $rootDom.append($input); } else @@ -262,10 +260,12 @@ $(function() break; case 'addCataChild' : moduleData.parentID = item.id; + console.log(item); if(item.hasChildren) { var $input = $('[data-id=liTreeModal]').html(); - var $rootDom = $('#fileTree [data-id=' + item.id + ']a + ul '); + var $rootDom = $('#fileTree [data-id=' + item.id + ']a + ul'); + var $rootDom = $('#fileTree [data-id=' + item.id + ']a + ul'); } else { diff --git a/module/doc/model.php b/module/doc/model.php index e0b7963b96..574d7235a4 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -47,7 +47,7 @@ class docModel extends model ->where('deleted')->eq(0) ->andWhere('type')->eq('api') ->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi() - ->beginIF(!empty($objectType) && $objectID > 0)->andWhere($objectType)->eq($objectID)->fi() + ->beginIF(!empty($objectType) && $objectID > 0 and $objectType != 'nolink')->andWhere($objectType)->eq($objectID)->fi() ->beginIF($objectType == 'nolink') ->andWhere('product')->eq(0) ->andWhere('project')->eq(0) @@ -234,6 +234,7 @@ class docModel extends model ->join('users', ',') ->setForce('product', $this->post->libType == 'product' ? $this->post->product : 0) ->setForce('project', $this->post->libType == 'project' ? $this->post->project : 0) + ->setForce('execution', $this->post->libType == 'project' ? $this->post->execution : 0) ->add('addedBy', $this->app->user->account) ->add('addedDate', helper::now()) ->remove('uid,contactListMenu,libType') @@ -247,7 +248,8 @@ class docModel extends model $this->lang->doclib->project = $this->lang->api->project; $this->lang->doclib->product = $this->lang->api->product; - $this->config->api->createlib->requiredFields .= $this->post->libType == 'product' ? ',product' : ',project'; + if($this->post->libType == 'product') $this->config->api->createlib->requiredFields .= ',product'; + if($this->post->libType == 'project') $this->config->api->createlib->requiredFields .= ',project'; $data->type = static::DOC_TYPE_API; $this->dao->insert(TABLE_DOCLIB)->data($data)->autoCheck() @@ -286,8 +288,8 @@ class docModel extends model $this->lang->doclib->project = $this->lang->api->project; $this->lang->doclib->product = $this->lang->api->product; - - $this->config->api->editlib->requiredFields .= $this->post->libType == 'product' ? ',product' : ',project'; + if($this->post->libType == 'product') $this->config->api->createlib->requiredFields .= ',product'; + if($this->post->libType == 'project') $this->config->api->createlib->requiredFields .= ',project'; $data->type = static::DOC_TYPE_API; $this->dao->update(TABLE_DOCLIB)->data($data)->autoCheck() @@ -2945,35 +2947,10 @@ class docModel extends model $attr = "data-app='{$this->app->tab}'"; $class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : ''; $params = "objectType={$lib->type}&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=$typeKey"; + if($typeKey == 'template') $params = "objectType=$type&objectID=$objectID&libID={$lib->id}&moduleID=$moduleID&type=html&from=template"; $html .= "