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..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(); } @@ -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(); @@ -544,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 4a99759fdb..382d3154a2 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;?> - + + + + @@ -223,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/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..1af000547b 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"'); ?> @@ -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'];?>
  • 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/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 = ':'; diff --git a/module/doc/model.php b/module/doc/model.php index 7655ef55fd..dde8bef4c4 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);