diff --git a/config/filter.php b/config/filter.php index 627458094b..d37bcef5ec 100755 --- a/config/filter.php +++ b/config/filter.php @@ -224,24 +224,26 @@ $filter->doc->default->cookie['from'] = 'code'; $filter->doc->default->cookie['product'] = 'int'; $filter->doc->default->cookie['preProductID'] = 'int'; $filter->doc->default->cookie['lastProject'] = 'int'; +$filter->doc->default->cookie['docSpaceParam'] = 'string'; $filter->doc->showfiles->cookie['docFilesViewType'] = 'code'; $filter->doc->tablecontents->cookie['preProductID'] = 'int'; $filter->doc->tablecontents->cookie['preBranch'] = 'reg::word'; $filter->doc->productspace->cookie['pagerDocTablecontents'] = 'int'; $filter->doc->projectspace->cookie['pagerDocTablecontents'] = 'int'; -$filter->api->default->cookie['objectType'] = 'string'; -$filter->api->default->cookie['objectID'] = 'int'; -$filter->api->index->get['libID'] = 'int'; -$filter->api->index->get['module'] = 'int'; -$filter->api->index->get['apiID'] = 'int'; -$filter->api->index->get['version'] = 'int'; -$filter->api->create->get['libID'] = 'int'; -$filter->api->create->get['module'] = 'int'; -$filter->api->create->get['apiID'] = 'int'; -$filter->api->edit->get['libID'] = 'int'; -$filter->api->edit->get['module'] = 'int'; -$filter->api->edit->get['apiID'] = 'int'; +$filter->api->default->cookie['objectType'] = 'string'; +$filter->api->default->cookie['objectID'] = 'int'; +$filter->api->default->cookie['docSpaceParam'] = 'string'; +$filter->api->index->get['libID'] = 'int'; +$filter->api->index->get['module'] = 'int'; +$filter->api->index->get['apiID'] = 'int'; +$filter->api->index->get['version'] = 'int'; +$filter->api->create->get['libID'] = 'int'; +$filter->api->create->get['module'] = 'int'; +$filter->api->create->get['apiID'] = 'int'; +$filter->api->edit->get['libID'] = 'int'; +$filter->api->edit->get['module'] = 'int'; +$filter->api->edit->get['apiID'] = 'int'; $filter->file->download->cookie[$config->sessionVar] = 'code'; diff --git a/db/update18.3.sql b/db/update18.3.sql index f536fb036b..a99275c803 100644 --- a/db/update18.3.sql +++ b/db/update18.3.sql @@ -50,10 +50,10 @@ CREATE TABLE IF NOT EXISTS `zt_scene` ( `module` mediumint(8) unsigned NOT NULL DEFAULT 0, `title` varchar(255) NOT NULL, `sort` int(11) unsigned NOT NULL DEFAULT 0, - `openedBy` char(30) NOT NULL DEFAULT '''''', + `openedBy` char(30) NOT NULL DEFAULT '', `openedDate` datetime DEFAULT NULL, `lastEditedBy` char(30) NOT NULL DEFAULT '', - `lastEditedDate` datetime NOT NULL, + `lastEditedDate` datetime NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', `parent` int(11) DEFAULT NULL, `grade` tinyint(3) DEFAULT NULL, @@ -502,6 +502,7 @@ CHANGE `fromCaseID` `fromCaseID` mediumint unsigned NOT NULL DEFAULT '0', CHANGE `lastRunResult` `lastRunResult` char(30) NOT NULL DEFAULT ''; ALTER TABLE `zt_chart` +CHANGE `dataset` `dataset` varchar(30) NOT NULL DEFAULT '0', CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '', CHANGE `editedDate` `editedDate` datetime NULL; @@ -600,6 +601,25 @@ CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '', CHANGE `editedDate` `editedDate` datetime NULL; ALTER TABLE `zt_host` +CHANGE `mac` `mac` varchar(128) NOT NULL DEFAULT '', +CHANGE `desc` `desc` text NULL, +CHANGE `tokenTime` `tokenTime` datetime NULL, +CHANGE `heartbeat` `heartbeat` datetime NULL, +CHANGE `vnc` `vnc` int NOT NULL DEFAULT '0', +CHANGE `ztf` `ztf` int NOT NULL DEFAULT '0', +CHANGE `zd` `zd` int NOT NULL DEFAULT '0', +CHANGE `ssh` `ssh` int NOT NULL DEFAULT '0', +CHANGE `serverRoom` `serverRoom` mediumint unsigned NOT NULL DEFAULT '0', +CHANGE `serverModel` `serverModel` varchar(256) NOT NULL DEFAULT '', +CHANGE `hardwareType` `hardwareType` varchar(64) NOT NULL DEFAULT '', +CHANGE `cpuBrand` `cpuBrand` varchar(128) NOT NULL DEFAULT '', +CHANGE `cpuModel` `cpuModel` varchar(128) NOT NULL DEFAULT '', +CHANGE `cpuNumber` `cpuNumber` varchar(16) NOT NULL DEFAULT '', +CHANGE `cpuCores` `cpuCores` varchar(30) NOT NULL DEFAULT '', +CHANGE `intranet` `intranet` varchar(128) NOT NULL DEFAULT '', +CHANGE `extranet` `extranet` varchar(128) NOT NULL DEFAULT '', +CHANGE `osName` `osName` varchar(64) NOT NULL DEFAULT '', +CHANGE `osVersion` `osVersion` varchar(64) NOT NULL DEFAULT '', CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '', CHANGE `editedDate` `editedDate` datetime NULL; @@ -1017,6 +1037,9 @@ CHANGE `lastRunDate` `lastRunDate` datetime NULL, CHANGE `lastRunResult` `lastRunResult` char(30) NOT NULL DEFAULT ''; ALTER TABLE `zt_testsuite` +CHANGE `project` `project` mediumint unsigned NOT NULL DEFAULT '0', +CHANGE `product` `product` mediumint unsigned NOT NULL DEFAULT '0', +CHANGE `deleted` `deleted` enum('0','1') NOT NULL DEFAULT '0', CHANGE `lastEditedBy` `lastEditedBy` char(30) NOT NULL DEFAULT '', CHANGE `lastEditedDate` `lastEditedDate` datetime NULL; diff --git a/db/zentao.sql b/db/zentao.sql index 83b19cc647..b23f3d3dd2 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -440,7 +440,7 @@ CREATE TABLE IF NOT EXISTS `zt_chart` ( `dimension` mediumint(8) unsigned NOT NULL, `type` varchar(30) NOT NULL, `group` varchar(255) NOT NULL, - `dataset` varchar(30) NOT NULL, + `dataset` varchar(30) NOT NULL DEFAULT '0', `desc` text NOT NULL, `settings` mediumtext NOT NULL, `filters` mediumtext NOT NULL, @@ -1842,8 +1842,8 @@ CREATE UNIQUE INDEX `task` ON `zt_testrun`(`task`,`case`); -- DROP TABLE IF EXISTS `zt_testsuite`; CREATE TABLE IF NOT EXISTS `zt_testsuite` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, - `project` mediumint(8) unsigned NOT NULL, - `product` mediumint(8) unsigned NOT NULL, + `project` mediumint(8) unsigned NOT NULL DEFAULT '0', + `product` mediumint(8) unsigned NOT NULL DEFAULT '0', `name` varchar(255) NOT NULL, `desc` mediumtext NOT NULL, `type` varchar(20) NOT NULL, @@ -1852,7 +1852,7 @@ CREATE TABLE IF NOT EXISTS `zt_testsuite` ( `addedDate` datetime NOT NULL, `lastEditedBy` char(30) NOT NULL DEFAULT '', `lastEditedDate` datetime NULL, - `deleted` enum('0','1') NOT NULL, + `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `product` (`product`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; @@ -2601,37 +2601,37 @@ CREATE TABLE `zt_host` ( `name` varchar(255) NOT NULL DEFAULT '', `type` varchar(30) NOT NULL DEFAULT 'normal', `hostType` varchar(30) NOT NULL DEFAULT '', - `mac` varchar(128) NOT NULL, + `mac` varchar(128) NOT NULL DEFAULT '', `memory` varchar(30) NOT NULL, `diskSize` varchar(30) NOT NULL, `status` varchar(50) NOT NULL, `secret` varchar(50) NOT NULL DEFAULT '', - `desc` text NOT NULL, + `desc` text NULL, `tokenSN` varchar(50) NOT NULL DEFAULT '', - `tokenTime` datetime NOT NULL, + `tokenTime` datetime NULL, `oldTokenSN` varchar(50) NOT NULL DEFAULT '', `vsoft` varchar(30) NOT NULL DEFAULT '', - `heartbeat` datetime NOT NULL, + `heartbeat` datetime NULL, `zap` varchar(10) NOT NULL, `provider` varchar(255) NOT NULL DEFAULT '', - `vnc` int(11) NOT NULL, - `ztf` int(11) NOT NULL, - `zd` int(11) NOT NULL, - `ssh` int(11) NOT NULL, + `vnc` int(11) NOT NULL DEFAULT '0', + `ztf` int(11) NOT NULL DEFAULT '0', + `zd` int(11) NOT NULL DEFAULT '0', + `ssh` int(11) NOT NULL DEFAULT '0', `parent` int(11) unsigned NOT NULL DEFAULT '0', `image` int(11) unsigned NOT NULL DEFAULT '0', `admin` smallint(5) unsigned NOT NULL DEFAULT '0', - `serverRoom` mediumint(8) unsigned NOT NULL, - `serverModel` varchar(256) NOT NULL, - `hardwareType` varchar(64) NOT NULL, - `cpuBrand` varchar(128) NOT NULL, - `cpuModel` varchar(128) NOT NULL, - `cpuNumber` varchar(16) NOT NULL, - `cpuCores` varchar(30) NOT NULL, - `intranet` varchar(128) NOT NULL, - `extranet` varchar(128) NOT NULL, - `osName` varchar(64) NOT NULL, - `osVersion` varchar(64) NOT NULL, + `serverRoom` mediumint(8) unsigned NOT NULL DEFAULT '0', + `serverModel` varchar(256) NOT NULL DEFAULT '', + `hardwareType` varchar(64) NOT NULL DEFAULT '', + `cpuBrand` varchar(128) NOT NULL DEFAULT '', + `cpuModel` varchar(128) NOT NULL DEFAULT '', + `cpuNumber` varchar(16) NOT NULL DEFAULT '', + `cpuCores` varchar(30) NOT NULL DEFAULT '', + `intranet` varchar(128) NOT NULL DEFAULT '', + `extranet` varchar(128) NOT NULL DEFAULT '', + `osName` varchar(64) NOT NULL DEFAULT '', + `osVersion` varchar(64) NOT NULL DEFAULT '', `group` varchar(128) NOT NULL DEFAULT '', `createdBy` varchar(30) NOT NULL, `createdDate` datetime NOT NULL, @@ -13353,10 +13353,10 @@ CREATE TABLE `zt_scene` ( `module` mediumint(8) unsigned NOT NULL DEFAULT 0, `title` varchar(255) NOT NULL, `sort` int(11) unsigned NOT NULL DEFAULT 0, - `openedBy` char(30) NOT NULL DEFAULT '''''', + `openedBy` char(30) NOT NULL DEFAULT '', `openedDate` datetime DEFAULT NULL, `lastEditedBy` char(30) NOT NULL DEFAULT '', - `lastEditedDate` datetime NOT NULL, + `lastEditedDate` datetime NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', `parent` int(11) DEFAULT NULL, `grade` tinyint(3) DEFAULT NULL, diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 0fbacca163..4ddd3fe327 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -769,7 +769,7 @@ $lang->action->label->risk = 'Risk|risk|view|riskID=%s'; $lang->action->label->issue = 'Issue|issue|view|issueID=%s'; $lang->action->label->design = 'Design|design|view|designID=%s'; $lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s'; -$lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s'; +$lang->action->label->api = 'Interface|api|view|libID=%s&apiID=%s&moduleID=%s'; $lang->action->label->kanbanspace = 'Kanban Space|kanban|space|browseType=%s'; $lang->action->label->kanbanregion = 'Kanban Region|kanban|view|kanbanID=%s'; $lang->action->label->kanban = 'Kanban|kanban|view|kanbanID=%s'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 1515919197..d20c814c5a 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -769,7 +769,7 @@ $lang->action->label->risk = 'Risk|risk|view|riskID=%s'; $lang->action->label->issue = 'Issue|issue|view|issueID=%s'; $lang->action->label->design = 'Design|design|view|designID=%s'; $lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s'; -$lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s'; +$lang->action->label->api = 'Interface|api|view|libID=%s&apiID=%s&moduleID=%s'; $lang->action->label->kanbanspace = 'Kanban Space|kanban|space|browseType=%s'; $lang->action->label->kanbanregion = 'Kanban Region|kanban|view|kanbanID=%s'; $lang->action->label->kanban = 'Kanban|kanban|view|kanbanID=%s'; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 861af6fad9..c4c5e25b08 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -769,7 +769,7 @@ $lang->action->label->risk = 'Risk|risk|view|riskID=%s'; $lang->action->label->issue = 'Issue|issue|view|issueID=%s'; $lang->action->label->design = 'Design|design|view|designID=%s'; $lang->action->label->stakeholder = 'Stakeholder|stakeholder|view|userID=%s'; -$lang->action->label->api = 'Interface|api|index|libID=%s&moduleID=%s&apiID=%s'; +$lang->action->label->api = 'Interface|api|view|libID=%s&apiID=%s&moduleID=%s'; $lang->action->label->kanbanspace = 'Kanban Space|kanban|space|browseType=%s'; $lang->action->label->kanbanregion = 'Kanban Region|kanban|view|kanbanID=%s'; $lang->action->label->kanban = 'Kanban|kanban|view|kanbanID=%s'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 579caa807f..54a285e643 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -770,7 +770,7 @@ $lang->action->label->risk = '风险|risk|view|riskID=%s'; $lang->action->label->issue = '问题|issue|view|issueID=%s'; $lang->action->label->design = '设计|design|view|designID=%s'; $lang->action->label->stakeholder = '干系人|stakeholder|view|userID=%s'; -$lang->action->label->api = '接口|api|index|libID=%s&moduleID=%s&apiID=%s'; +$lang->action->label->api = '接口|api|view|libID=%s&apiID=%s&moduleID=%s'; $lang->action->label->kanbanspace = '看板空间|kanban|space|browseType=%s'; $lang->action->label->kanbanregion = '看板区域|kanban|view|kanbanID=%s'; $lang->action->label->kanban = '看板|kanban|view|kanbanID=%s'; diff --git a/module/action/model.php b/module/action/model.php index 7509112254..28d84cc5d4 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1621,7 +1621,7 @@ class actionModel extends model elseif($action->objectType == 'api') { $api = $this->dao->select('id,lib,module')->from(TABLE_API)->where('id')->eq($action->objectID)->fetch(); - $params = sprintf($vars, $api->lib, $api->module, $api->id); + $params = sprintf($vars, $api->lib, $api->id, $api->module); } elseif($action->objectType == 'branch') { diff --git a/module/api/config.php b/module/api/config.php index c023e190d6..ca85343f71 100644 --- a/module/api/config.php +++ b/module/api/config.php @@ -24,6 +24,7 @@ $config->api->editor->createlib = array('id' => 'desc', 'tools' => 'simpleTo $config->api->editor->editlib = array('id' => 'desc', 'tools' => 'simpleTools'); $config->api->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); $config->api->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools'); +$config->api->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simple'); $config->api->editor->createRelease = array('id' => 'desc', 'tools' => 'simpleTools'); $config->api->editor->createstruct = array('id' => 'desc', 'tools' => 'simpleTools'); $config->api->editor->editstruct = array('id' => 'desc', 'tools' => 'simpleTools'); diff --git a/module/api/control.php b/module/api/control.php index 94a621c832..3563dfd41a 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -41,8 +41,12 @@ class api extends control */ public function index($libID = 0, $moduleID = 0, $apiID = 0, $version = 0, $release = 0, $appendLib = 0, $browseType = '', $param = 0) { - $this->session->set('spaceType', 'api', 'doc'); - $this->session->set('structList', $this->app->getURI(true), 'doc'); + if(!$apiID) + { + $this->session->set('spaceType', 'api', 'doc'); + $this->session->set('structList', inLink('index', "libID=$libID&moduleID=$moduleID"), 'doc'); + setCookie("docSpaceParam", '', $this->config->cookieLife, $this->config->webRoot, '', false, true); + } $this->setMenu($libID); $objectType = $this->objectType; @@ -144,14 +148,14 @@ class api extends control * @param int $libID * @param int $apiID * @param int $moduleID - * @param int $release * @param int $version + * @param int $release * @access public * @return void */ - public function view($libID, $apiID, $moduleID = 0, $release = 0, $version = 0) + public function view($libID, $apiID, $moduleID = 0, $version = 0, $release = 0) { - $this->setMenu($libID); + if(!strpos($this->server->http_referer, 'space') and !strpos($this->server->http_referer, 'api')) setCookie("docSpaceParam", '', $this->config->cookieLife, $this->config->webRoot, '', false, true); /* Get all api doc libraries. */ $libs = $this->doc->getApiLibs($libID); @@ -180,24 +184,39 @@ class api extends control $linkParams = "libID=$lib->id"; if($methodName != 'index') $linkParams = "objectID=$linkObject&$linkParams"; - $crumbs[] = html::a(inLink($methodName, $linkParams), html::image("static/svg/interface.svg") . $lib->name); - $moduleList = $this->loadModel('tree')->getParents($api->module); - foreach($moduleList as $module) + $objectID = $this->objectID; + if($this->cookie->docSpaceParam) { - $linkParams .= "&moduleID=$module->id"; - $crumbs[] = html::a(inLink($methodName, $linkParams), $module->name); - } + $docParam = json_decode($this->cookie->docSpaceParam); + $type = $docParam->type; + $objectID = $docParam->objectID; + $libID = $docParam->libID; + $moduleID = $docParam->moduleID; + $browseType = $docParam->browseType; + $param = $docParam->param; + list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType($type, $objectID, $libID); + $libTree = $this->doc->getLibTree($libID, $libs, $type, $moduleID, $objectID, $browseType, $param); + } + else + { + $objectDropdown = $this->generateLibsDropMenu($libs[$libID], $release); + $libTree = $this->doc->getLibTree($libID, $libs, 'api', $moduleID); + } $this->view->title = $this->lang->api->pageTitle; $this->view->libs = $libs; $this->view->isRelease = $release > 0; $this->view->release = $release; + $this->view->version = $version; $this->view->libID = $libID; $this->view->apiID = $apiID; - $this->view->crumbs = $crumbs; + $this->view->moduleID = $moduleID; + $this->view->objectType = $type; + $this->view->type = $type; + $this->view->objectID = $objectID; $this->view->users = $this->user->getPairs('noclosed,noletter'); - $this->view->moduleTree = $this->doc->getApiModuleTree($libID, $apiID, $release, $moduleID); - $this->view->objectDropdown = $this->generateLibsDropMenu($libs[$libID], $release); + $this->view->libTree = $libTree; + $this->view->objectDropdown = $objectDropdown; $this->display(); } @@ -653,7 +672,7 @@ class api extends control } else { - return print(js::locate(inlink('index', "libID=$api->lib&module=$api->module"), 'parent')); + return print(js::locate($this->session->structList ? $this->session->structList : inlink('index', "libID=$api->lib&module=$api->module"), 'parent')); } } } @@ -752,7 +771,10 @@ class api extends control $this->lang->doc->menu->api['exclude'] = 'api-' . $this->app->rawMethod; $this->lang->doc->menu->{$this->session->spaceType}['subModule'] = 'api'; } - + else + { + $this->lang->doc->menu->{$this->session->spaceType}['alias'] .= ',' . $this->app->rawMethod; + } } /** diff --git a/module/api/css/common.css b/module/api/css/common.css index d72371dec4..64b62e6825 100644 --- a/module/api/css/common.css +++ b/module/api/css/common.css @@ -163,3 +163,23 @@ form .table-data, #content .table-data {border: 1px solid #e2e2e3;} .info .version, .info .crumbs {float: left;} .info .crumbs {font-size: 13px; margin-top: 5px; font-weight: normal;} .info .crumbs img {margin-right: 3px;} + +.lib {width: unset; margin-bottom: unset;} +.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;} diff --git a/module/api/css/index.css b/module/api/css/index.css index d1a2d2eb31..9c0cc48254 100644 --- a/module/api/css/index.css +++ b/module/api/css/index.css @@ -1,24 +1,4 @@ -.lib {width: unset; margin-bottom: unset;} -.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;} .cell {padding: 0;} -#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;} diff --git a/module/api/css/view.css b/module/api/css/view.css new file mode 100644 index 0000000000..784cd1beb0 --- /dev/null +++ b/module/api/css/view.css @@ -0,0 +1,12 @@ +.flex-content #content {flex: auto; overflow-y: auto; height: calc(100vh - 125px);} +.flex-content #history {flex: 0 0 302px; position: relative; overflow: auto;} +.flex-content #history > #closeBtn {position: absolute; right: 10px; top: 10px;} + +#content .detail-content.article-content::-webkit-scrollbar, +#outlineMenu::-webkit-scrollbar, +#history::-webkit-scrollbar {height: 0px; width: 0px; background: transparent;} +#content .detail-content.article-content::-moz-scrollbar, +#outlineMenu::-moz-scrollbar, +#hostory::-moz-scrollbar {height: 0px; width: 0px; background: transparent;} +.main-col iframe {min-height: unset;} +.bottom-btn-tree {display: none;} diff --git a/module/api/js/view.js b/module/api/js/view.js index f32c457b49..b446307d5d 100644 --- a/module/api/js/view.js +++ b/module/api/js/view.js @@ -104,7 +104,7 @@ $(function() $('.menu-actions > a').blur(function() {$(this).css('background', 'none');}) /* Update doc content silently on switch doc version, story #40503 */ - $(document).on('click', '.api-version-menu a, #mainActions .container a', function(event) + $('body').on('click', '.api-version-menu a, #mainActions .container a', function(event) { var $tmpDiv = $('
'); $tmpDiv.load($(this).data('url') + ' #mainContent', function() @@ -117,5 +117,43 @@ $(function() $('#outline li.has-list').addClass('open in'); $('#outline li.has-list>i+ul').prev('i').remove(); }); + }).on('click', '.comment-edit-form .btn-hide-form', function() + { + $('.comment-edit-form #submit').attr('disabled', false); + }).on('click', '#docVersionMenu.diff > .drop-body > li', function(e) + { + e.stopPropagation(); + }).on('click', '#docVersionMenu #changeBtn', function(e) + { + $('#docVersionMenu').addClass('diff'); + e.stopPropagation(); + }).on('click', '#hisTrigger', function() + { + var $history = $('#history'); + var $icon = $(this); + if($history.hasClass('hidden')) + { + $history.removeClass('hidden'); + $icon.addClass('text-primary'); + } + else + { + $history.addClass('hidden'); + $icon.removeClass('text-primary'); + } + }).on('click', '#closeBtn', function() + { + $('#history').addClass('hidden'); + $('#hisTrigger').removeClass('text-primary'); }); + + $('#history').append(''); + + $('#history').find('.btn.pull-right').removeClass('pull-right'); + + $('.comment-edit-form').ajaxForm({ + success: function(data) { + location.reload(); + } + }) }); diff --git a/module/api/view/content.html.php b/module/api/view/content.html.php index 3c2742337c..d7330c62ce 100644 --- a/module/api/view/content.html.php +++ b/module/api/view/content.html.php @@ -1,5 +1,5 @@
-
+
@@ -20,7 +20,6 @@
-
', $crumbs);?>
', '', "title='{$lang->fullscreen}' class='btn btn-link fullscreen-btn'");?> @@ -31,6 +30,7 @@ if(common::hasPriv('api', 'delete')) echo html::a($this->createLink('api', 'delete', "apiID=$api->id"), '', '', "title='{$lang->api->delete}' class='btn btn-link' target='hiddenwin'"); } ?> + history?>>
@@ -146,53 +146,12 @@
- -
- createLink('action', 'comment', "objectType=api&objectID=$api->id");?> - -
- diff --git a/module/api/view/index.html.php b/module/api/view/index.html.php index 233b24e1dc..b05dfa4227 100644 --- a/module/api/view/index.html.php +++ b/module/api/view/index.html.php @@ -48,7 +48,7 @@
- +
diff --git a/module/api/view/view.html.php b/module/api/view/view.html.php index bba2365fc8..5705ec8baa 100644 --- a/module/api/view/view.html.php +++ b/module/api/view/view.html.php @@ -11,48 +11,37 @@ */ ?> + api->confirmDelete);?> -
>
-
- - -
-
-
- - "; - echo html::a('javascript:;', "", '', "data-toggle='dropdown' class='btn btn-link'"); - echo "
'; - } - ?> -
- -
- -
api->noModule;?>
- - - -
+ + + + +
+ + +
+
+
- -
diff --git a/module/block/view/docmycollectionblock.html.php b/module/block/view/docmycollectionblock.html.php index fd173b5d3e..0e16ba3a51 100644 --- a/module/block/view/docmycollectionblock.html.php +++ b/module/block/view/docmycollectionblock.html.php @@ -20,7 +20,7 @@ .block-docmycollection .doc-list > .doc-box > .btn.no-priv p {pointer-events: none;} .block-docmycollection .doc-list > .doc-box .date-interval {float: right; padding: 8px 0 8px 12px;} .block-docmycollection .doc-list > .doc-box > .btn > h4 {padding-right: 5px;} -.block-docmycollection .doc-list > .doc-box .file-icon {margin-right: 2px; width: 14px;} +.block-docmycollection .doc-list > .doc-box .file-icon {margin-right: 2px; margin-bottom: 2px;} .block-docmycollection .doc-list > .doc-box .plug-title {height: 16px; overflow: hidden;} .block-docmycollection.block-sm .doc-list > .doc-box {flex: 0 1 100%;} diff --git a/module/block/view/docrecentupdateblock.html.php b/module/block/view/docrecentupdateblock.html.php index eebe3fb794..71e931d673 100644 --- a/module/block/view/docrecentupdateblock.html.php +++ b/module/block/view/docrecentupdateblock.html.php @@ -20,7 +20,7 @@ .block-docrecentupdate .doc-list > .doc-box > .btn.no-priv p {pointer-events: none;} .block-docrecentupdate .doc-list > .doc-box .date-interval {float: right; padding: 8px 0 8px 12px;} .block-docrecentupdate .doc-list > .doc-box > .btn > h4 {padding-right: 5px;} -.block-docrecentupdate .doc-list > .doc-box .file-icon {margin-right: 2px; width: 14px;} +.block-docrecentupdate .doc-list > .doc-box .file-icon {margin-right: 2px; margin-bottom: 2px;} .block-docrecentupdate .doc-list > .doc-box .plug-title {height: 16px; overflow: hidden;} .block-docrecentupdate.block-sm .doc-list > .doc-box {flex: 0 1 100%;} diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index e9bc561287..66fec42df9 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -502,7 +502,7 @@ $lang->doc->menu->dashboard = array('link' => "{$lang->dashboard}|doc|index"); $lang->doc->menu->my = array('link' => "{$lang->doc->mySpace}|doc|mySpace|type=mine", 'alias' => 'myspace'); $lang->doc->menu->product = array('link' => "{$lang->doc->productSpace}|doc|productSpace|", 'alias' => 'productspace'); $lang->doc->menu->project = array('link' => "{$lang->doc->projectSpace}|doc|projectSpace|", 'alias' => 'projectspace'); -$lang->doc->menu->api = array('link' => "{$lang->doc->apiSpace}|api|index", 'alias' => 'api'); +$lang->doc->menu->api = array('link' => "{$lang->doc->apiSpace}|api|index", 'alias' => '', 'exclude' => 'index'); $lang->doc->menu->custom = array('link' => "{$lang->doc->teamSpace}|doc|teamSpace|", 'alias' => 'teamspace'); $lang->doc->dividerMenu = ',product,'; diff --git a/module/common/model.php b/module/common/model.php index 6633796d01..eade044bb6 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1182,7 +1182,7 @@ class commonModel extends model if(isset($menuItem->link['module'])) $module = $menuItem->link['module']; if(isset($menuItem->link['method'])) $method = $menuItem->link['method']; } - if($module == $currentModule and ($method == $currentMethod or strpos(",$alias,", ",$currentMethod,") !== false) and strpos(",$exclude,", ",$currentMethod,") === false) + if($module == $currentModule and ($method == $currentMethod or strpos(",$alias,", ",$currentMethod,") !== false) and strpos(",$exclude,", ",$currentModule-$currentMethod,") === false) { $activeMenu = $menuItem->name; $active = 'active'; diff --git a/module/doc/control.php b/module/doc/control.php index 79ae86ad32..08c3060c94 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1273,6 +1273,15 @@ class doc extends control $this->session->set('spaceType', $type, 'doc'); $this->session->set('docList', $uri, 'doc'); + $docSpaceParam = new stdclass(); + $docSpaceParam->type = $type; + $docSpaceParam->objectID = $objectID; + $docSpaceParam->libID = $libID; + $docSpaceParam->moduleID = $moduleID; + $docSpaceParam->browseType = $browseType; + $docSpaceParam->param = $param; + setCookie("docSpaceParam", json_encode($docSpaceParam), $this->config->cookieLife, $this->config->webRoot, '', false, true); + if($moduleID) $libID = $this->tree->getById($moduleID)->root; $isFirstLoad = $libID == 0 ? true : false; if(empty($browseType)) $browseType = 'all'; diff --git a/module/doc/css/view.css b/module/doc/css/view.css index c25c1d1c60..92e52416b0 100644 --- a/module/doc/css/view.css +++ b/module/doc/css/view.css @@ -9,6 +9,7 @@ .main-col .doc-title .actions a + a {margin-left: 0px;} .main-col .doc-title .actions i {font-size: 15px; color: #8c8c8c;} #content .title {max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;} +.main-col .doc-title .actions a > span {color: #9EA3B0;} #mainContent .scrollbar-hover {max-height: 2000px; overflow: scroll;} #content .editor-preview {background: #fff} #content .CodeMirror{border: none} diff --git a/module/doc/model.php b/module/doc/model.php index 9d0ace0159..b883982350 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2391,6 +2391,11 @@ class docModel extends model $currentModule = $this->app->rawModule; $currentMethod = $this->app->rawMethod; + if($currentModule == 'api' and $currentMethod == 'index') + { + $currentModule = 'doc'; + $currentMethod = $type . 'Space'; + } $dropMenuLink = helper::createLink('doc', 'ajaxGetDropMenu', "objectType=$type&objectID=$objectID&module=$currentModule&method=$currentMethod"); $output = "