From 481cf610e530c028fb5a2b90edc049061909ef8c Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 29 Mar 2023 11:06:43 +0800 Subject: [PATCH 1/4] * code for task #89136. --- module/doc/lang/de.php | 10 +++++----- module/doc/lang/en.php | 10 +++++----- module/doc/lang/fr.php | 9 +++++---- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index ebd368afc6..535afaa67e 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -63,6 +63,7 @@ $lang->doc->project = $lang->projectCommon; $lang->doc->execution = $lang->execution->common; $lang->doc->lib = 'Bibliothek'; $lang->doc->module = 'Modul'; +$lang->doc->libAndModule = 'Bibliothek & Modul'; $lang->doc->object = 'Object'; $lang->doc->title = 'Titel'; $lang->doc->digest = 'Zusammenfassung'; @@ -195,9 +196,8 @@ $lang->doc->libIconList['custom'] = 'icon-folder-o'; $lang->doc->systemLibs['product'] = $lang->productCommon . 'Dok Bibliothek'; $lang->doc->systemLibs['execution'] = $lang->executionCommon . 'Dok Bibliothek'; -$lang->doc->aclList['open'] = 'Öffentlich'; -$lang->doc->aclList['custom'] = 'Eigene'; -$lang->doc->aclList['private'] = 'Privat'; +$lang->doc->aclList['open'] = "Öffentlich (Access with library permissions)"; +$lang->doc->aclList['private'] = "Privat (Only creators and whitelist users can access)"; $lang->doc->typeList['html'] = 'Html'; $lang->doc->typeList['markdown'] = 'Markdown'; @@ -207,7 +207,6 @@ $lang->doc->typeList['ppt'] = 'PPT'; $lang->doc->typeList['excel'] = 'Excel'; $lang->doc->createList['html'] = 'Create Document'; -$lang->doc->createList['api'] = 'Create API'; $lang->doc->createList['template'] = 'Create By Template'; $lang->doc->createList['word'] = 'Word'; $lang->doc->createList['ppt'] = 'PPT'; @@ -294,7 +293,8 @@ $lang->doc->noticeAcl['doc']['custom'] = 'Users in the whiltelist can access it $lang->doc->noticeAcl['doc']['private'] = 'Only the one who created it can access it.'; $lang->doc->placeholder = new stdclass(); -$lang->doc->placeholder->url = 'Url'; +$lang->doc->placeholder->url = 'URL'; +$lang->doc->placeholder->execution = 'When the execution is empty, the document is created in the project library'; $lang->doc->summary = "Total files on this page: %s , total size: %s, %s."; $lang->doc->ge = ':'; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 9823ad66df..79a4187793 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -63,6 +63,7 @@ $lang->doc->project = $lang->projectCommon; $lang->doc->execution = $lang->execution->common; $lang->doc->lib = 'Library'; $lang->doc->module = 'Catalog'; +$lang->doc->libAndModule = 'Library & Catalog'; $lang->doc->object = 'Object'; $lang->doc->title = 'Name'; $lang->doc->digest = 'Summary'; @@ -195,9 +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'] = 'Public'; -$lang->doc->aclList['custom'] = 'Custom'; -$lang->doc->aclList['private'] = 'Private'; +$lang->doc->aclList['open'] = "Public (Access with library permissions)"; +$lang->doc->aclList['private'] = "Private (Only creators and whitelist users can access)"; $lang->doc->typeList['html'] = 'Html'; $lang->doc->typeList['markdown'] = 'Markdown'; @@ -207,7 +207,6 @@ $lang->doc->typeList['ppt'] = 'PPT'; $lang->doc->typeList['excel'] = 'Excel'; $lang->doc->createList['html'] = 'Create Document'; -$lang->doc->createList['api'] = 'Create API'; $lang->doc->createList['template'] = 'Create By Template'; $lang->doc->createList['word'] = 'Word'; $lang->doc->createList['ppt'] = 'PPT'; @@ -294,7 +293,8 @@ $lang->doc->noticeAcl['doc']['custom'] = 'Users in the whiltelist can access it $lang->doc->noticeAcl['doc']['private'] = 'Only the one who created it can access it.'; $lang->doc->placeholder = new stdclass(); -$lang->doc->placeholder->url = 'URL'; +$lang->doc->placeholder->url = 'URL'; +$lang->doc->placeholder->execution = 'When the execution is empty, the document is created in the project library'; $lang->doc->summary = "Total files on this page: %s , total size: %s, %s."; $lang->doc->ge = ':'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index f8b94ada04..aadd86f0fc 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -63,6 +63,7 @@ $lang->doc->project = $lang->projectCommon; $lang->doc->execution = $lang->execution->common; $lang->doc->lib = 'Bibliothèque'; $lang->doc->module = 'Catégorie'; +$lang->doc->libAndModule = 'Library & Catalog'; $lang->doc->object = 'Object'; $lang->doc->title = 'Nom'; $lang->doc->digest = 'Résumé'; @@ -195,9 +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'] = 'Public'; -$lang->doc->aclList['custom'] = 'Person.'; -$lang->doc->aclList['private'] = 'Privé'; +$lang->doc->aclList['open'] = "Public (Access with library permissions)"; +$lang->doc->aclList['private'] = "Privé (Only creators and whitelist users can access)"; $lang->doc->typeList['html'] = 'Html'; $lang->doc->typeList['markdown'] = 'Markdown'; @@ -294,7 +294,8 @@ $lang->doc->noticeAcl['doc']['custom'] = 'Les utilisateurs de la Liste Blanche $lang->doc->noticeAcl['doc']['private'] = 'Seulement celui qui a ajouté le document peut y accéder.'; $lang->doc->placeholder = new stdclass(); -$lang->doc->placeholder->url = 'URL'; +$lang->doc->placeholder->url = 'URL'; +$lang->doc->placeholder->execution = 'When the execution is empty, the document is created in the project library'; $lang->doc->summary = "Total files on this page: %s , total size: %s, %s."; $lang->doc->ge = ':'; From 80c066b6aa7c5f2547056e32051f96288fec10d5 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 29 Mar 2023 11:13:06 +0800 Subject: [PATCH 2/4] * Add locate param. --- module/api/config.php | 2 +- module/api/control.php | 6 ++++-- module/api/view/create.html.php | 5 ++++- module/api/view/createlib.html.php | 4 ++-- module/api/view/index.html.php | 4 ++-- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/module/api/config.php b/module/api/config.php index 9349615aa8..c023e190d6 100644 --- a/module/api/config.php +++ b/module/api/config.php @@ -11,7 +11,7 @@ $config->api->struct = new stdClass(); $config->api->struct->requiredFields = 'name,params'; $config->api->create = new stdclass(); -$config->api->create->requiredFields = 'lib,title,path'; +$config->api->create->requiredFields = 'title,path'; $config->api->edit = new stdclass(); $config->api->edit->requiredFields = 'lib,title,path'; diff --git a/module/api/control.php b/module/api/control.php index 0543334b08..75a42e3bfa 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -373,11 +373,12 @@ class api extends control /** * Create a api doc library. * - * @param string normal|demo + * @param string $type project|product + * @param int $objectID * @access public * @return void */ - public function createLib($type = 'product') + public function createLib($type = 'product', $objectID = 0) { if(empty($type)) $type = 'product'; @@ -401,6 +402,7 @@ class api extends control $this->lang->api->aclList['default'] = sprintf($this->lang->api->aclList['default'], $this->lang->{$type}->common); $this->view->type = $type; + $this->view->objectID = $objectID; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('nocode|noclosed'); $this->view->projects = $this->loadModel('project')->getPairsByModel(); diff --git a/module/api/view/create.html.php b/module/api/view/create.html.php index 4a99759fdb..f0fca8b83b 100644 --- a/module/api/view/create.html.php +++ b/module/api/view/create.html.php @@ -62,7 +62,10 @@ js::set('struct_paramsType', $lang->struct->paramsType); api->lib;?> - + + + + diff --git a/module/api/view/createlib.html.php b/module/api/view/createlib.html.php index 41d2fb0409..bba6bf97c8 100644 --- a/module/api/view/createlib.html.php +++ b/module/api/view/createlib.html.php @@ -31,13 +31,13 @@ api->product;?> - + api->project;?> - + diff --git a/module/api/view/index.html.php b/module/api/view/index.html.php index 5b9185352d..9a925f3171 100644 --- a/module/api/view/index.html.php +++ b/module/api/view/index.html.php @@ -24,9 +24,9 @@ createLink('api', 'struct', "libID=$libID"), " " . $lang->api->struct, '', "class='btn btn-link'"); if(common::hasPriv('api', 'releases')) echo html::a($this->createLink('api', 'releases', "libID=$libID", 'html', true), " " . $lang->api->releases, '', "class='btn btn-link iframe' data-width='800px'"); - if(common::hasPriv('api', 'createRelease')) echo html::a($this->createLink('api', 'createRelease', "libID=$libID", 'html', true), " " . $lang->api->createRelease, '', "class='btn btn-link iframe' data-width='800px'"); + if(common::hasPriv('api', 'createRelease')) echo html::a($this->createLink('api', 'createRelease', "libID=$libID"), " " . $lang->api->createRelease, '', "class='btn btn-link iframe' data-width='800px'"); //if(common::hasPriv('api', 'export')) echo html::a($this->createLink('api', 'export', "libID=$libID", 'html', true), " " . $lang->export, '', "class='btn btn-link export' id='export'"); - if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType == 'project' ? 'project' : 'product')), ' ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"'); + if(common::hasPriv('api', 'createLib')) echo html::a($this->createLink('api', 'createLib', "type=" . ($objectType == 'project' ? 'project' : 'product') . "&objectID=$objectID"), ' ' . $lang->api->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"'); if(common::hasPriv('api', 'create')) echo html::a($this->createLink('api', 'create', "libID=$libID&moduleID=$moduleID"), ' ' . $lang->api->createApi, '', 'class="btn btn-primary"'); ?> From 7d1e4e131648874e2394c4c084a87bc7803e702f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Wed, 29 Mar 2023 11:20:52 +0800 Subject: [PATCH 3/4] * code for task #89156. --- module/doc/js/create.js | 1 - module/doc/model.php | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/module/doc/js/create.js b/module/doc/js/create.js index 6691676916..4b45f5610c 100644 --- a/module/doc/js/create.js +++ b/module/doc/js/create.js @@ -15,7 +15,6 @@ $(function() $('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); if(typeof(window.editor) != 'undefined') { diff --git a/module/doc/model.php b/module/doc/model.php index 2086f9917d..7f796ed8b1 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -749,6 +749,7 @@ class docModel extends model ->get(); $doc->contentMarkdown = $this->post->contentMarkdown; + if($doc->acl == 'open') $doc->users = $doc->groups = ''; if(empty($doc->lib) and strpos($doc->module, '_') !== false) list($doc->lib, $doc->module) = explode('_', $doc->module); if(empty($doc->lib)) return dao::$errors['lib'] = sprintf($this->lang->error->notempty, $this->lang->doc->lib); From 3634bedb576b976ee48fe6009e621e73b58e8b91 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 29 Mar 2023 11:28:24 +0800 Subject: [PATCH 4/4] * Modify api create locate. --- module/api/control.php | 4 ++-- module/api/view/create.html.php | 2 +- module/api/view/index.html.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/module/api/control.php b/module/api/control.php index 75a42e3bfa..48cacbbc6d 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -96,7 +96,7 @@ class api extends control $this->view->moduleID = $moduleID; $this->view->libTree = $this->api->getLibTree($libID, $libs, $objectID); $this->view->users = $this->user->getPairs('noclosed,noletter'); - $this->view->objectDropdown = $this->generateLibsDropMenu($libs[$libID], $release); + $this->view->objectDropdown = isset($libs[$libID]) ? $this->generateLibsDropMenu($libs[$libID], $release) : ''; $this->display(); } @@ -546,7 +546,7 @@ class api extends control $libName = isset($lib->name) ? $lib->name . $this->lang->colon : ''; $this->getTypeOptions($libID); - $this->view->gobackLink = $this->createLink('api', 'index', "libID=$libID&moduleID=$moduleID"); + $this->view->gobackLink = ''; $this->view->user = $this->app->user->account; $this->view->allUsers = $this->loadModel('user')->getPairs('devfirst|noclosed'); $this->view->libID = $libID; diff --git a/module/api/view/create.html.php b/module/api/view/create.html.php index f0fca8b83b..382d3154a2 100644 --- a/module/api/view/create.html.php +++ b/module/api/view/create.html.php @@ -226,7 +226,7 @@ js::set('struct_paramsType', $lang->struct->paramsType); - goback, "data-app='{$app->tab}'");?> + goback, "data-app='{$app->tab}' class='btn btn-back btn-wide'");?> goback, '', "class='btn btn-back btn-wide'");?> diff --git a/module/api/view/index.html.php b/module/api/view/index.html.php index 9a925f3171..1af000547b 100644 --- a/module/api/view/index.html.php +++ b/module/api/view/index.html.php @@ -57,10 +57,10 @@
  • doc->libDropdown['addModule'];?>
  • - -
  • ' data-toggle='modal' data-type='iframe'>doc->libDropdown['editLib'];?>
  • + +
  • ' data-toggle='modal' data-type='iframe'>api->libDropdown['editLib'];?>
  • - +
  • ' target='hiddenwin'>doc->libDropdown['deleteLib'];?>