diff --git a/config/filter.php b/config/filter.php index 48a7117eef..91f3e7d0ae 100755 --- a/config/filter.php +++ b/config/filter.php @@ -87,8 +87,7 @@ $filter->bug->export = new stdclass(); $filter->caselib->create = new stdclass(); $filter->doc->create = new stdclass(); $filter->doc->browse = new stdclass(); -$filter->doc->alllibs = new stdclass(); -$filter->doc->objectlibs = new stdclass(); +$filter->doc->view = new stdclass(); $filter->doc->tablecontents = new stdclass(); $filter->doc->productspace = new stdclass(); $filter->doc->projectspace = new stdclass(); @@ -219,12 +218,12 @@ $filter->caselib->create->cookie['lastLibCaseModule'] = 'int'; $filter->doc->create->cookie['lastDocModule'] = 'int'; $filter->doc->browse->cookie['browseType'] = 'reg::browseType'; -$filter->doc->alllibs->cookie['browseType'] = 'reg::browseType'; -$filter->doc->objectlibs->cookie['browseType'] = 'reg::browseType'; -$filter->doc->objectlibs->cookie['preProductID'] = 'int'; -$filter->doc->objectlibs->cookie['preBranch'] = 'reg::word'; +$filter->doc->view->cookie['browseType'] = 'reg::browseType'; +$filter->doc->view->cookie['preBranch'] = 'reg::word'; $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->showfiles->cookie['docFilesViewType'] = 'code'; $filter->doc->tablecontents->cookie['preProductID'] = 'int'; $filter->doc->tablecontents->cookie['preBranch'] = 'reg::word'; diff --git a/db/update18.3.sql b/db/update18.3.sql index 3cc86a4335..45bdce1a7a 100644 --- a/db/update18.3.sql +++ b/db/update18.3.sql @@ -142,6 +142,9 @@ SELECT t1.`group`, t1.`module`, 'productSpace' FROM `zt_grouppriv` AS t1 WHERE t INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT t1.`group`, t1.`module`, 'projectSpace' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'tableContents'; +INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`) +SELECT t1.`group`, t1.`module`, 'teamSpace' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'tableContents'; + INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT t1.`group`, t1.`module`, 'addCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'catalog'; diff --git a/db/zentao.sql b/db/zentao.sql index 188030fdb5..9748f37bc4 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -2232,7 +2232,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1,'doc','showFiles'), (1,'doc','productSpace'), (1,'doc','projectSpace'), -(1,'doc','tableContents'), +(1,'doc','teamSpace'), (1,'execution','activate'), (1,'execution','addWhitelist'), (1,'execution','all'), @@ -2832,7 +2832,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (2,'doc','showFiles'), (2,'doc','productSpace'), (2,'doc','projectSpace'), -(2,'doc','tableContents'), +(2,'doc','teamSpace'), (2,'execution','all'), (2,'execution','browse'), (2,'execution','bug'), @@ -3140,7 +3140,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (3,'doc','showFiles'), (3,'doc','productSpace'), (3,'doc','projectSpace'), -(3,'doc','tableContents'), +(3,'doc','teamSpace'), (3,'execution','all'), (3,'execution','browse'), (3,'execution','bug'), @@ -3486,7 +3486,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (4,'doc','showFiles'), (4,'doc','productSpace'), (4,'doc','projectSpace'), -(4,'doc','tableContents'), +(4,'doc','teamSpace'), (4,'execution','activate'), (4,'execution','addWhitelist'), (4,'execution','all'), @@ -4007,7 +4007,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (5,'doc','showFiles'), (5,'doc','productSpace'), (5,'doc','projectSpace'), -(5,'doc','tableContents'), +(5,'doc','teamSpace'), (5,'doc','view'), (5,'execution','activate'), (5,'execution','addWhitelist'), @@ -4483,7 +4483,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (6,'doc','showFiles'), (6,'doc','productSpace'), (6,'doc','projectSpace'), -(6,'doc','tableContents'), +(6,'doc','teamSpace'), (6,'execution','activate'), (6,'execution','addWhitelist'), (6,'execution','all'), @@ -4880,7 +4880,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (7,'doc','showFiles'), (7,'doc','productSpace'), (7,'doc','projectSpace'), -(7,'doc','tableContents'), +(7,'doc','teamSpace'), (7,'execution','all'), (7,'execution','browse'), (7,'execution','bug'), @@ -5306,7 +5306,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (8,'doc','showFiles'), (8,'doc','productSpace'), (8,'doc','projectSpace'), -(8,'doc','tableContents'), +(8,'doc','teamSpace'), (8,'execution','all'), (8,'execution','browse'), (8,'execution','bug'), @@ -5693,7 +5693,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (9,'doc','showFiles'), (9,'doc','productSpace'), (9,'doc','projectSpace'), -(9,'doc','tableContents'), +(9,'doc','teamSpace'), (9,'execution','all'), (9,'execution','browse'), (9,'execution','bug'), @@ -6025,7 +6025,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (10,'doc','showFiles'), (10,'doc','productSpace'), (10,'doc','projectSpace'), -(10,'doc','tableContents'), +(10,'doc','teamSpace'), (10,'execution','all'), (10,'execution','browse'), (10,'execution','bug'), @@ -6270,7 +6270,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (11,'doc','showFiles'), (11,'doc','productSpace'), (11,'doc','projectSpace'), -(11,'doc','tableContents'), +(11,'doc','teamSpace'), (11,'execution','all'), (11,'execution','browse'), (11,'execution','bug'), diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 61a8cc5224..9f4eb485b1 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -754,7 +754,7 @@ $lang->action->label->testtask = 'Testaufgaben|testtask|view|caseID=%s'; $lang->action->label->testsuite = 'Test Suite|testsuite|view|suiteID=%s'; $lang->action->label->caselib = 'Fallbibliothek|testsuite|libview|libID=%s'; $lang->action->label->todo = 'Todo|todo|view|todoID=%s'; -$lang->action->label->doclib = 'Dok Bibliothek|doc|browse|libID=%s'; +$lang->action->label->doclib = 'Dok Bibliothek|doc|teamspace|objectID=%s&libID=%s'; $lang->action->label->doc = 'Dok|doc|view|docID=%s'; $lang->action->label->user = 'Benutzer|user|view|account=%s'; $lang->action->label->testreport = 'Berichte|testreport|view|report=%s'; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index d874c37d33..0eec3a619f 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -754,7 +754,7 @@ $lang->action->label->testtask = 'Request|testtask|view|caseID=%s'; $lang->action->label->testsuite = 'Test Suite|testsuite|view|suiteID=%s'; $lang->action->label->caselib = 'Case Library|caselib|view|libID=%s'; $lang->action->label->todo = 'Todo|todo|view|todoID=%s'; -$lang->action->label->doclib = 'Doc Library|doc|objectLibs|type=%s&objectID=%s&libID=%s'; +$lang->action->label->doclib = 'Doc Library|doc|teamspace|objectID=%s&libID=%s'; $lang->action->label->doc = 'Doc|doc|view|docID=%s'; $lang->action->label->user = 'User|user|view|account=%s'; $lang->action->label->testreport = 'Report|testreport|view|report=%s'; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 039c6e8c98..c2633376fd 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -754,7 +754,7 @@ $lang->action->label->testtask = 'Recette|testtask|view|caseID=%s'; $lang->action->label->testsuite = 'Cahier Recette|testsuite|view|suiteID=%s'; $lang->action->label->caselib = 'Library Recette|testsuite|libview|libID=%s'; $lang->action->label->todo = 'Agenda|todo|view|todoID=%s'; -$lang->action->label->doclib = 'Bibliothèque|doc|browse|libID=%s'; +$lang->action->label->doclib = 'Bibliothèque|doc|teamspace|objectID=%s&libID=%s'; $lang->action->label->doc = 'Document|doc|view|docID=%s'; $lang->action->label->user = 'Utilisateur|user|view|account=%s'; $lang->action->label->testreport = 'Rapport|testreport|view|report=%s'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index e51737090a..6ef78d3f80 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -754,7 +754,7 @@ $lang->action->label->testtask = '测试单|testtask|view|caseID=%s'; $lang->action->label->testsuite = '测试套件|testsuite|view|suiteID=%s'; $lang->action->label->caselib = '用例库|caselib|view|libID=%s'; $lang->action->label->todo = '待办|todo|view|todoID=%s'; -$lang->action->label->doclib = '文档库|doc|tablecontents|type=%s&objectID=%s&libID=%s'; +$lang->action->label->doclib = '文档库|doc|teamspace|objectID=%s&libID=%s'; $lang->action->label->doc = '文档|doc|view|docID=%s'; $lang->action->label->user = '用户|user|view|account=%s'; $lang->action->label->testreport = '报告|testreport|view|report=%s'; diff --git a/module/action/model.php b/module/action/model.php index 3ee0489b12..c830f1032a 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -1694,7 +1694,6 @@ class actionModel extends model $method = 'tablecontents'; if(isset($this->config->doc->spaceMethod[$docLib->type])) $method = $this->config->doc->spaceMethod[$docLib->type]; if($method == 'myspace') $params = "type=mine&libID={$action->objectID}"; - if($method == 'tablecontents') $params = sprintf($vars, $docLib->type, $docLib->objectID, $action->objectID, $appendLib); if(!in_array($method, array('myspace', 'tablecontents'))) $params = "objectID={$docLib->objectID}&libID={$action->objectID}"; $action->objectLink = helper::createLink('doc', $method, $params); } diff --git a/module/api/lang/de.php b/module/api/lang/de.php index 8843f01349..7ef91caa48 100644 --- a/module/api/lang/de.php +++ b/module/api/lang/de.php @@ -12,6 +12,7 @@ $lang->api->common = 'API'; $lang->api->getModel = 'Super Model API'; $lang->api->sql = 'SQL Query API'; +$lang->api->manage = 'API management'; $lang->api->index = 'API Space'; $lang->api->editLib = 'Edit'; diff --git a/module/api/lang/en.php b/module/api/lang/en.php index d635929153..730ff6cb04 100644 --- a/module/api/lang/en.php +++ b/module/api/lang/en.php @@ -12,6 +12,7 @@ $lang->api->common = 'API'; $lang->api->getModel = 'Super Model API'; $lang->api->sql = 'SQL Query API'; +$lang->api->manage = 'API management'; $lang->api->index = 'API Space'; $lang->api->editLib = 'Edit'; diff --git a/module/api/lang/fr.php b/module/api/lang/fr.php index 2ef819831d..394a00af55 100644 --- a/module/api/lang/fr.php +++ b/module/api/lang/fr.php @@ -12,6 +12,7 @@ $lang->api->common = 'API'; $lang->api->getModel = 'Super Model API'; $lang->api->sql = 'SQL Query API'; +$lang->api->manage = 'API management'; $lang->api->index = 'API Space'; $lang->api->editLib = 'Edit'; diff --git a/module/api/lang/zh-cn.php b/module/api/lang/zh-cn.php index bea818e109..dec5f9077a 100755 --- a/module/api/lang/zh-cn.php +++ b/module/api/lang/zh-cn.php @@ -12,6 +12,7 @@ $lang->api->common = 'API接口'; $lang->api->getModel = '超级model调用接口'; $lang->api->sql = 'SQL查询接口'; +$lang->api->manage = '接口管理'; $lang->api->index = '接口空间'; $lang->api->editLib = '编辑库'; diff --git a/module/api/model.php b/module/api/model.php index 4efcb994e1..6ff29d950e 100644 --- a/module/api/model.php +++ b/module/api/model.php @@ -986,13 +986,13 @@ class apiModel extends model $normalObjects = $closedObjects = array(); $libs = $this->loadModel('doc')->getApiLibs(); - $products = $this->dao->select('t1.id, t1.name, t1.status')->from(TABLE_PRODUCT)->alias('t1') + $products = $this->dao->select('t1.id, t1.order, t1.name, t1.status')->from(TABLE_PRODUCT)->alias('t1') ->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.product=t1.id') ->where('t2.id')->gt(0) ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t1.deleted')->eq(0) ->andWhere('t2.id')->in(array_keys($libs)) - ->orderBy('id_desc') + ->orderBy('order_asc') ->fetchAll('id'); foreach($products as $id => $product) @@ -1007,14 +1007,14 @@ class apiModel extends model } } - $projects = $this->dao->select('t1.id, t1.name, t1.status')->from(TABLE_PROJECT)->alias('t1') + $projects = $this->dao->select('t1.id, t1.order, t1.name, t1.status')->from(TABLE_PROJECT)->alias('t1') ->leftjoin(TABLE_DOCLIB)->alias('t2')->on('t2.project=t1.id') ->where('t2.id')->gt(0) ->andWhere('t1.vision')->eq($this->config->vision) ->andWhere('t1.deleted')->eq(0) ->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->projects)->fi() ->andWhere('t2.id')->in(array_keys($libs)) - ->orderBy('t1.hasProduct_asc, id_desc') + ->orderBy('t1.hasProduct_asc, order_asc') ->fetchAll('id'); foreach($projects as $id => $project) diff --git a/module/block/lang/de.php b/module/block/lang/de.php index 66c9ac1d75..5ec93666e4 100644 --- a/module/block/lang/de.php +++ b/module/block/lang/de.php @@ -341,11 +341,11 @@ $lang->block->default['doc']['2']['title'] = 'Dynamic'; $lang->block->default['doc']['2']['block'] = 'docdynamic'; $lang->block->default['doc']['2']['grid'] = 4; -$lang->block->default['doc']['3']['title'] = 'My Collection'; +$lang->block->default['doc']['3']['title'] = 'My Collection Document'; $lang->block->default['doc']['3']['block'] = 'docmycollection'; $lang->block->default['doc']['3']['grid'] = 8; -$lang->block->default['doc']['4']['title'] = 'Recently update'; +$lang->block->default['doc']['4']['title'] = 'Recently Update Document'; $lang->block->default['doc']['4']['block'] = 'docrecentupdate'; $lang->block->default['doc']['4']['grid'] = 8; diff --git a/module/block/lang/en.php b/module/block/lang/en.php index 8142c5de78..305f2f3f90 100644 --- a/module/block/lang/en.php +++ b/module/block/lang/en.php @@ -341,11 +341,11 @@ $lang->block->default['doc']['2']['title'] = 'Dynamic'; $lang->block->default['doc']['2']['block'] = 'docdynamic'; $lang->block->default['doc']['2']['grid'] = 4; -$lang->block->default['doc']['3']['title'] = 'My Collection'; +$lang->block->default['doc']['3']['title'] = 'My Collection Document'; $lang->block->default['doc']['3']['block'] = 'docmycollection'; $lang->block->default['doc']['3']['grid'] = 8; -$lang->block->default['doc']['4']['title'] = 'Recently update'; +$lang->block->default['doc']['4']['title'] = 'Recently Update Document'; $lang->block->default['doc']['4']['block'] = 'docrecentupdate'; $lang->block->default['doc']['4']['grid'] = 8; diff --git a/module/block/lang/fr.php b/module/block/lang/fr.php index a2147e8d10..486cc2a7a1 100644 --- a/module/block/lang/fr.php +++ b/module/block/lang/fr.php @@ -341,11 +341,11 @@ $lang->block->default['doc']['2']['title'] = 'Dynamic'; $lang->block->default['doc']['2']['block'] = 'docdynamic'; $lang->block->default['doc']['2']['grid'] = 4; -$lang->block->default['doc']['3']['title'] = 'My Collection'; +$lang->block->default['doc']['3']['title'] = 'My Collection Document'; $lang->block->default['doc']['3']['block'] = 'docmycollection'; $lang->block->default['doc']['3']['grid'] = 8; -$lang->block->default['doc']['4']['title'] = 'Recently update'; +$lang->block->default['doc']['4']['title'] = 'Recently Update Document'; $lang->block->default['doc']['4']['block'] = 'docrecentupdate'; $lang->block->default['doc']['4']['grid'] = 8; diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index 00e89e5900..434c0fe58e 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -341,11 +341,11 @@ $lang->block->default['doc']['2']['title'] = '文档动态'; $lang->block->default['doc']['2']['block'] = 'docdynamic'; $lang->block->default['doc']['2']['grid'] = 4; -$lang->block->default['doc']['3']['title'] = '我的收藏'; +$lang->block->default['doc']['3']['title'] = '我收藏的文档'; $lang->block->default['doc']['3']['block'] = 'docmycollection'; $lang->block->default['doc']['3']['grid'] = 8; -$lang->block->default['doc']['4']['title'] = '最近更新'; +$lang->block->default['doc']['4']['title'] = '最近更新的文档'; $lang->block->default['doc']['4']['block'] = 'docrecentupdate'; $lang->block->default['doc']['4']['grid'] = 8; diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index e90cdd7e73..cc0322a7ac 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -340,7 +340,7 @@ $lang->execution->menu->storyGroup = array('link' => "{$lang->common->story}|exe $lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'storykanban,linkstory'); $lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|bug|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport'); $lang->execution->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); -$lang->execution->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=execution&objectID=%s", 'subModule' => 'doc'); +$lang->execution->menu->doc = array('link' => "{$lang->doc->common}|execution|doc|objectID=%s", 'subModule' => 'doc'); $lang->execution->menu->build = array('link' => "{$lang->build->common}|execution|build|executionID=%s", 'subModule' => 'build'); $lang->execution->menu->action = array('link' => "$lang->dynamic|execution|dynamic|executionID=%s"); $lang->execution->menu->settings = array('link' => "$lang->settings|execution|view|executionID=%s", 'subModule' => 'personnel', 'alias' => 'edit,manageproducts,team,whitelist,addwhitelist,managemembers', 'class' => 'dropdown dropdown-hover'); @@ -503,7 +503,7 @@ $lang->doc->menu->my = array('link' => "{$lang->doc->mySpace}|doc|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->custom = array('link' => "{$lang->doc->teamSpace}|doc|tableContents|type=custom", 'alias' => 'tablecontents'); +$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 836b67b452..6213c93030 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -605,7 +605,6 @@ class commonModel extends model if(strpos('|bug|execution|kanbanspace|', "|$objectType|") !== false) $needPrintDivider = true; $hasPriv = common::hasPriv($module, $createMethod); - if($hasPriv and $objectType == 'doc' and !common::hasPriv('doc', 'tableContents')) $hasPriv = false; if(!$hasPriv and $objectType == 'doc' and common::hasPriv('api', 'create')) $hasPriv = true; if(!$hasPriv) continue; diff --git a/module/doc/config.php b/module/doc/config.php index 21a2ed42f0..225c79c8d7 100644 --- a/module/doc/config.php +++ b/module/doc/config.php @@ -48,7 +48,7 @@ $config->doc->spaceMethod['mine'] = 'myspace'; $config->doc->spaceMethod['product'] = 'productspace'; $config->doc->spaceMethod['project'] = 'projectspace'; $config->doc->spaceMethod['execution'] = 'projectspace'; -$config->doc->spaceMethod['custom'] = 'tablecontents'; +$config->doc->spaceMethod['custom'] = 'teamspace'; $config->doc->search['module'] = 'doc'; $config->doc->search['fields']['title'] = $lang->doc->title; diff --git a/module/doc/control.php b/module/doc/control.php index e7a596b74c..6a10db5146 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -655,7 +655,7 @@ class doc extends control if($from == 'lib') { - $method = 'tableContents'; + $method = 'teamSpace'; $objectID = 0; if($objectType == 'product') { @@ -672,7 +672,6 @@ class doc extends control $objectID = $doc->execution; } $params = "objectID={$objectID}&libID={$doc->lib}"; - if($method == 'tableContents') $params = "type=$objectType&" . $params; $response['locate'] = $this->createLink('doc', $method, $params); } } @@ -1198,20 +1197,22 @@ class doc extends control $doc = $docID ? $doc : ''; /* Crumbs links array. */ - $methodName = in_array($type, array('product', 'project')) ? $objectType . 'Space' : 'tableContents'; + $moduleName = 'doc'; + $methodName = in_array($type, array('product', 'project')) ? $objectType . 'Space' : 'teamSpace'; $linkParams = "objectID={$objectID}&libID={$lib->id}"; - if($this->app->tab == 'execution' or $objectType == 'custom') + if($this->app->tab == 'execution') { - $linkParams = "objectType=$objectType&$linkParams"; - $methodName = 'tableContents'; + $moduleName = 'execution'; + $methodName = 'doc'; + $linkParams = "executionID=$objectID"; } - if($type == 'mine') + elseif($type == 'mine') { $linkParams = "type=mine&libID={$lib->id}"; $methodName = 'mySpace'; } - $crumbs[] = html::a(inLink($methodName, $linkParams), html::image("static/svg/wiki-file-lib.svg") . $lib->name, '', 'title =' . $lib -> name); + $crumbs[] = html::a($this->createLink($moduleName, $methodName, $linkParams), html::image("static/svg/wiki-file-lib.svg") . $lib->name, '', 'title =' . $lib -> name); $moduleList = $this->loadModel('tree')->getParents($doc->module); foreach($moduleList as $module) @@ -1282,7 +1283,7 @@ class doc extends control $queryID = $browseType == 'bySearch' ? (int)$param : 0; $params = "objectID=$objectID&libID=$libID&moduleID=0&browseType=bySearch&orderBy=$orderBy¶m=myQueryID"; if($this->app->rawMethod == 'tablecontents') $params = "type=$type&" . $params; - $actionURL = $this->createLink('doc', $this->app->rawMethod, $params); + $actionURL = $this->createLink($this->app->rawModule, $this->app->rawMethod, $params); if($libType == 'api') { $this->loadModel('api')->buildSearchForm($lib, $queryID, $actionURL, $libs, $type); @@ -1361,6 +1362,9 @@ class doc extends control */ public function productSpace($objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { + $products = $this->product->getPairs('nocode', 0, '', 'all'); + $objectID = $this->product->saveState($objectID, $products); + echo $this->fetch('doc', 'tableContents', "type=product&objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$browseType&orderBy=$orderBy¶m=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); } @@ -1381,9 +1385,32 @@ class doc extends control */ public function projectSpace($objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { + $projects = $this->project->getPairsByProgram(); + $objectID = $this->project->saveState($objectID, $projects); + echo $this->fetch('doc', 'tableContents', "type=project&objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$browseType&orderBy=$orderBy¶m=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); } + /** + * Show team space. + * + * @param int $objectID + * @param int $libID + * @param int $moduleID + * @param string $browseType all|draft|bysearch + * @param string $orderBy + * @param int $param + * @param int $recTotal + * @param int $recPerPage + * @param int $pageID + * @access public + * @return void + */ + public function teamSpace($objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) + { + echo $this->fetch('doc', 'tableContents', "type=custom&objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$browseType&orderBy=$orderBy¶m=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); + } + /** * Select lib type. * @@ -1412,13 +1439,13 @@ class doc extends control $spaceList = $this->lang->doc->spaceList; $typeList = $this->lang->doc->types; - if(!common::hasPriv('doc', 'create')) unset($spaceList['mine'], $spaceList['custom'], $typeList['doc']); - if(!common::hasPriv('doc', 'mySpace')) unset($spaceList['mine']); - if(!common::hasPriv('doc', 'productSpace')) unset($spaceList['product']); - if(!common::hasPriv('doc', 'projectSpace')) unset($spaceList['project']); - if(!common::hasPriv('doc', 'tableContents')) unset($spaceList['custom']); - if(!common::hasPriv('api', 'index')) unset($spaceList['api']); - if(!common::hasPriv('api', 'create')) unset($spaceList['api'], $typeList['api']); + if(!common::hasPriv('doc', 'create')) unset($spaceList['mine'], $spaceList['custom'], $typeList['doc']); + if(!common::hasPriv('doc', 'mySpace')) unset($spaceList['mine']); + if(!common::hasPriv('doc', 'productSpace')) unset($spaceList['product']); + if(!common::hasPriv('doc', 'projectSpace')) unset($spaceList['project']); + if(!common::hasPriv('doc', 'teamSpace')) unset($spaceList['custom']); + if(!common::hasPriv('api', 'index')) unset($spaceList['api']); + if(!common::hasPriv('api', 'create')) unset($spaceList['api'], $typeList['api']); $products = $this->loadModel('product')->getPairs(); $projects = $this->project->getPairsByProgram('', 'all', false, 'order_asc', 'kanban'); diff --git a/module/doc/css/tablecontents.css b/module/doc/css/tablecontents.css index b7196e25cc..f53186b0c9 100644 --- a/module/doc/css/tablecontents.css +++ b/module/doc/css/tablecontents.css @@ -49,7 +49,7 @@ li.drag-shadow ul {display: none!important;} .table .c-name > .doc-title {display: inline-block; max-width: calc(100% - 80px); overflow: hidden; background: transparent; padding-right:0px;} .table .c-name > span.doc-title {line-height: 0; vertical-align: inherit;} .table .c-name > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;} -.table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: 0px;} +.table .c-name > .ajaxCollect {float: right; position: relative; right: 10px; top: 0px; padding: 0 6px;} table.table > thead > tr {height: 32px;} #bysearchTab::before {display: none;} diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 8ad498664e..9258e21220 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -332,12 +332,11 @@ $(document).ready(function() */ function locateNewLib(type, objectID, libID) { - var method = 'tableContents'; - var params = 'type=' + type + '&objectID=' + objectID + '&libID=' + libID; + var method = 'teamSpace'; + var params = 'objectID=' + objectID + '&libID=' + libID; if(type == 'product' || type == 'project') { method = type + 'Space'; - params = 'objectID=' + objectID + '&libID=' + libID; } else if(type == 'mine') { diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index 6946d41980..bab46df315 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -125,6 +125,7 @@ $lang->doc->defaultSave = 'Default Save: '; $lang->doc->position = 'Position'; $lang->doc->person = 'Person'; $lang->doc->team = 'Team'; +$lang->doc->manage = 'Document Management'; $lang->doc->moduleDoc = 'Nach Modulen'; $lang->doc->searchDoc = 'Suche'; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 7dbcaaf756..b00d1dd17f 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -125,6 +125,7 @@ $lang->doc->defaultSave = 'Default Save: '; $lang->doc->position = 'Position'; $lang->doc->person = 'Person'; $lang->doc->team = 'Team'; +$lang->doc->manage = 'Document Management'; $lang->doc->moduleDoc = 'By Module'; $lang->doc->searchDoc = 'Search'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index 631df9e298..eafc223046 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -125,6 +125,7 @@ $lang->doc->defaultSave = 'Default Save: '; $lang->doc->position = 'Position'; $lang->doc->person = 'Person'; $lang->doc->team = 'Team'; +$lang->doc->manage = 'Document Management'; $lang->doc->moduleDoc = 'Par Module'; $lang->doc->searchDoc = 'Rechercher'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index f7e12c729e..cdb5dfc124 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -125,6 +125,7 @@ $lang->doc->defaultSave = '默认存入:'; $lang->doc->position = '所在位置'; $lang->doc->person = '个人'; $lang->doc->team = '团队'; +$lang->doc->manage = '文档管理'; $lang->doc->moduleDoc = '按模块浏览'; $lang->doc->searchDoc = '搜索'; diff --git a/module/doc/model.php b/module/doc/model.php index dcaaee2a2d..d4e41ee15c 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -386,11 +386,6 @@ class docModel extends model $allLibIDList = array_keys($allLibs); $hasPrivDocIdList = $this->getPrivDocs(0, $moduleID); - $files = $this->dao->select('*')->from(TABLE_FILE) - ->where('objectType')->eq('doc') - ->andWhere('objectID')->in($hasPrivDocIdList) - ->fetchGroup('objectID'); - if($browseType == "all") { $docs = $this->getDocs(0, 0, $browseType, $sort, $pager); @@ -422,13 +417,14 @@ class docModel extends model ->andWhere('actor')->eq($this->app->user->account) ->andWhere('action')->eq('edited') ->fetchAll('objectID'); - $docs = $this->dao->select('*')->from(TABLE_DOC) - ->where('deleted')->eq(0) + $docs = $this->dao->select('t1.*, t2.name as libName, t2.type as objectType')->from(TABLE_DOC)->alias('t1') + ->leftJoin(TABLE_DOCLIB)->alias('t2')->on("t1.lib=t2.id") + ->where('t1.deleted')->eq(0) ->andWhere($query) - ->andWhere('lib')->in($allLibIDList) - ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() - ->andWhere('addedBy', 1)->eq($this->app->user->account) - ->orWhere('id')->in(array_keys($docIDList)) + ->andWhere('t1.lib')->in($allLibIDList) + ->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi() + ->andWhere('t1.addedBy', 1)->eq($this->app->user->account) + ->orWhere('t1.id')->in(array_keys($docIDList)) ->markRight(1) ->orderBy($sort) ->page($pager) @@ -436,12 +432,13 @@ class docModel extends model } elseif($browseType == "openedbyme") { - $docs = $this->dao->select('*')->from(TABLE_DOC) - ->where('deleted')->eq(0) - ->andWhere('lib')->in($allLibIDList) - ->andWhere('id')->in($hasPrivDocIdList) - ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() - ->andWhere('addedBy')->eq($this->app->user->account) + $docs = $this->dao->select('t1.*, t2.name as libName, t2.type as objectType')->from(TABLE_DOC)->alias('t1') + ->leftJoin(TABLE_DOCLIB)->alias('t2')->on("t1.lib=t2.id") + ->where('t1.deleted')->eq(0) + ->andWhere('t1.lib')->in($allLibIDList) + ->andWhere('t1.id')->in($hasPrivDocIdList) + ->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi() + ->andWhere('t1.addedBy')->eq($this->app->user->account) ->orderBy($sort) ->page($pager) ->fetchAll('id'); @@ -454,11 +451,13 @@ class docModel extends model ->andWhere('objectID')->in($hasPrivDocIdList) ->andWhere('action')->eq('edited') ->fetchAll('objectID'); - $docs = $this->dao->select('*')->from(TABLE_DOC) - ->where('deleted')->eq(0) - ->andWhere('id')->in(array_keys($docIDList)) - ->andWhere('lib')->in($allLibIDList) - ->beginIF($this->config->doc->notArticleType)->andWhere('type')->notIN($this->config->doc->notArticleType)->fi() + + $docs = $this->dao->select('t1.*, t2.name as libName, t2.type as objectType')->from(TABLE_DOC)->alias('t1') + ->leftJoin(TABLE_DOCLIB)->alias('t2')->on("t1.lib=t2.id") + ->where('t1.deleted')->eq(0) + ->andWhere('t1.id')->in(array_keys($docIDList)) + ->andWhere('t1.lib')->in($allLibIDList) + ->beginIF($this->config->doc->notArticleType)->andWhere('t1.type')->notIN($this->config->doc->notArticleType)->fi() ->orderBy($sort) ->page($pager) ->fetchAll('id'); @@ -490,44 +489,27 @@ class docModel extends model if(empty($docs)) return array(); - /* Get projects, executions and products by docIdList. */ - $docContents = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->in(array_keys($docs))->orderBy('version,doc')->fetchAll('doc'); - foreach($docs as $index => $doc) + if(in_array($browseType, array('bySearch', 'openedbyme', 'editedbyme'))) { - $docs[$index]->fileSize = 0; - if(isset($files[$index])) + $objects = array(); + list($objects['project'], $objects['execution'], $objects['product']) = $this->getObjectsByDoc(array_keys($docs)); + foreach($docs as $docID => $doc) { - $docContent = $docContents[$index]; - $fileSize = 0; - foreach($files[$index] as $file) + $doc->objectID = zget($doc, $doc->objectType, 0); + $doc->objectName = ''; + if(isset($objects[$doc->objectType])) { - if(strpos(",{$docContent->files},", ",{$file->id},") === false) continue; - $fileSize += $file->size; - } - - if($fileSize < 1024) - { - $fileSize .= 'B'; - } - elseif($fileSize < 1024 * 1024) - { - $fileSize = round($fileSize / 1024, 2) . 'KB'; - } - elseif($fileSize < 1024 * 1024 * 1024) - { - $fileSize = round($fileSize / 1024 / 1024, 2) . 'MB'; + $doc->objectName = $objects[$doc->objectType][$doc->objectID]; } else { - $fileSize = round($fileSize / 1024 / 1024 / 1024, 2) . 'G'; + if($doc->objectType == 'mine') $doc->objectName = $this->lang->doc->person; + if($doc->objectType == 'custom') $doc->objectName = $this->lang->doc->team; } - - $docs[$index]->fileSize = $fileSize; } } - $docs = $this->processCollector($docs); - return $docs; + return $this->processCollector($docs); } /** @@ -666,7 +648,7 @@ class docModel extends model ->andWhere('t2.actor')->eq($this->app->user->account) ->beginIF(!common::hasPriv('doc', 'productSpace'))->andWhere('t3.type')->ne('product')->fi() ->beginIF(!common::hasPriv('doc', 'projectSpace'))->andWhere('t3.type')->notIN('project,execution')->fi() - ->beginIF(!common::hasPriv('doc', 'tableContents'))->andWhere('t3.type')->ne('custom')->fi() + ->beginIF(!common::hasPriv('doc', 'teamSpace'))->andWhere('t3.type')->ne('custom')->fi() ->beginIF($browseType == 'all' or $browseType == 'bysearch')->andWhere("(t1.status = 'normal' or (t1.status = 'draft' and t1.addedBy='{$this->app->user->account}'))")->fi() ->beginIF($browseType == 'draft')->andWhere('t1.status')->eq('draft')->andWhere('t1.addedBy')->eq($this->app->user->account)->fi() ->beginIF($browseType == 'bysearch')->andWhere($query)->fi() @@ -686,7 +668,7 @@ class docModel extends model ->andWhere('t1.addedBy')->eq($this->app->user->account) ->beginIF(!common::hasPriv('doc', 'productSpace'))->andWhere('t2.type')->ne('product')->fi() ->beginIF(!common::hasPriv('doc', 'projectSpace'))->andWhere('t2.type')->notIN('project,execution')->fi() - ->beginIF(!common::hasPriv('doc', 'tableContents'))->andWhere('t2.type')->ne('custom')->fi() + ->beginIF(!common::hasPriv('doc', 'teamSpace'))->andWhere('t2.type')->ne('custom')->fi() ->beginIF($browseType == 'draft')->andWhere('t1.status')->eq('draft')->andWhere('t1.addedBy')->eq($this->app->user->account)->fi() ->beginIF($browseType == 'bysearch')->andWhere($query)->fi() ->orderBy($orderBy) @@ -1093,7 +1075,7 @@ class docModel extends model $products = $this->product->getPairs(); $this->config->doc->search['params']['project']['values'] = array('' => '') + $this->loadModel('project')->getPairsByProgram('', 'all', false, 'order_asc', 'kanban') + array('all' => $this->lang->doc->allProjects); - $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix') + array('all' => $this->lang->doc->allExecutions); + $this->config->doc->search['params']['execution']['values'] = array('' => '') + $this->loadModel('execution')->getPairs(0, 'sprint,stage', 'multiple,leaf,noprefix,withobject') + array('all' => $this->lang->doc->allExecutions); $this->config->doc->search['params']['lib']['values'] = array('' => '') + $this->loadModel('doc')->getLibs('all', 'withObject') + array('all' => $this->lang->doclib->all); $this->config->doc->search['params']['product']['values'] = array('' => '') + $products + array('all' => $this->lang->doc->allProduct); @@ -2519,12 +2501,12 @@ class docModel extends model foreach($moduleDocs[0] as $doc) { - if(!$docID and $currentMethod != 'tablecontents') $docID = $doc->id; + if(!$docID and $currentMethod != 'teamspace') $docID = $doc->id; $class = common::hasPriv('doc', 'updateOrder') ? ' sortDoc' : ''; $treeMenu[0] .= 'id>"; - if($currentMethod == 'tablecontents') + if($currentMethod == 'teamspace') { $treeMenu[0] .= '
' . zget($users, $doc->editedBy) . '  ' . $doc->editedDate . ''; } @@ -2596,11 +2578,11 @@ class docModel extends model } else { - if(!$docID and $currentMethod != 'tablecontents') $docID = $doc->id; + if(!$docID and $currentMethod != 'teamspace') $docID = $doc->id; $class = common::hasPriv('doc', 'updateOrder') ? ' sortDoc' : ''; $treeMenu[$module->id] .= 'id>"; - if($currentMethod == 'tablecontents') + if($currentMethod == 'teamspace') { $treeMenu[$module->id] .= '
' . zget($users, $doc->editedBy) . '  ' . $doc->editedDate . ''; } @@ -2618,7 +2600,7 @@ class docModel extends model } $treeMenu[$module->id] .= '
'; } - elseif($currentMethod == 'tablecontents') + elseif($currentMethod == 'teamspace') { $class = common::hasPriv('doc', 'updateOrder') ? 'sortDoc' : ''; $treeMenu[$module->id] .= html::a(inlink('view', "docID={$doc->id}"), "  " . $doc->title, '', "data-app='{$this->app->tab}' class='doc-title $class' title='{$doc->title}'"); @@ -2642,7 +2624,7 @@ class docModel extends model { $moduleClass = common::hasPriv('tree', 'updateOrder') ? 'sort-module' : ''; $li = "
" . $module->name . ''; - if($currentMethod != 'tablecontents') + if($currentMethod != 'teamspace') { if(common::hasPriv('tree', 'edit') or common::hasPriv('tree', 'browse') or common::hasPriv('tree', 'browse') or common::hasPriv('tree', 'updateOrder')) { diff --git a/module/doc/view/doclist.html.php b/module/doc/view/doclist.html.php index f6bc1c6b85..e20f81e770 100644 --- a/module/doc/view/doclist.html.php +++ b/module/doc/view/doclist.html.php @@ -20,7 +20,7 @@ body {margin-bottom: 25px;} #docListForm .checkbox-primary > label {height: 16px; line-height: 16px; padding-left: 16px;} #docListForm .checkbox-primary > label:before {left: -1px; font-size: 10px;} #docListForm .checkbox-primary > label:after {width: 12px; height: 12px;} -.table-files .btn {padding: 0 2px;} +.table-files .btn {padding: 2px;}