diff --git a/config/filter.php b/config/filter.php index bc4d3af91e..48a7117eef 100755 --- a/config/filter.php +++ b/config/filter.php @@ -90,6 +90,8 @@ $filter->doc->browse = new stdclass(); $filter->doc->alllibs = new stdclass(); $filter->doc->objectlibs = new stdclass(); $filter->doc->tablecontents = new stdclass(); +$filter->doc->productspace = new stdclass(); +$filter->doc->projectspace = new stdclass(); $filter->doc->showfiles = new stdclass(); $filter->doc->default = new stdclass(); $filter->api->default = new stdClass(); @@ -215,17 +217,19 @@ $filter->bug->export->cookie['checkedItem'] = 'reg::checked'; $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->default->cookie['from'] = 'code'; -$filter->doc->default->cookie['product'] = 'int'; -$filter->doc->showfiles->cookie['docFilesViewType'] = 'code'; -$filter->doc->tablecontents->cookie['preProductID'] = 'int'; -$filter->doc->tablecontents->cookie['preBranch'] = 'reg::word'; +$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->default->cookie['from'] = 'code'; +$filter->doc->default->cookie['product'] = 'int'; +$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'; diff --git a/db/update18.3.sql b/db/update18.3.sql index 93160086ac..4d43480c67 100644 --- a/db/update18.3.sql +++ b/db/update18.3.sql @@ -85,10 +85,7 @@ UPDATE `zt_doc` SET `type` = 'text' WHERE `type` = 'url'; UPDATE `zt_doc` SET `acl` = 'private' WHERE `acl` = 'custom'; UPDATE `zt_doc` SET `status` = 'normal' WHERE `status` = ''; -UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'custom' and `acl` = 'custom'; -UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'product' AND `acl` = 'custom'; -UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'execution' AND `acl` = 'custom'; -UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'project' AND `acl` = 'custom'; +UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` IN ('custom', 'book', 'product', 'project, ''execution') AND `acl` = 'custom'; UPDATE `zt_doclib` SET `acl` = 'default' WHERE `type` = 'project' AND `acl` IN ('open', 'private'); UPDATE `zt_doclib` SET `acl` = 'private' WHERE `type` = 'api' and `acl` = 'custom'; UPDATE `zt_doclib` SET `acl` = 'default' WHERE `type` = 'api' and `acl` = 'open'; diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 8e5aefcb74..10b8661ee9 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -168,7 +168,7 @@ $lang->product->menu->release = array('link' => "{$lang->release->common}|re $lang->product->menu->roadmap = array('link' => "{$lang->roadmap}|product|roadmap|productID=%s"); $lang->product->menu->requirement = array('link' => "{$lang->URCommon}|product|browse|productID=%s&branch=&browseType=unclosed¶m=0&storyType=requirement", 'alias' => 'batchedit', 'subModule' => 'story'); $lang->product->menu->track = array('link' => "{$lang->track}|product|track|productID=%s"); -$lang->product->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=product&objectID=%s", 'subModule' => 'doc'); +$lang->product->menu->doc = array('link' => "{$lang->doc->common}|doc|productSpace|objectID=%s", 'subModule' => 'doc'); $lang->product->menu->dynamic = array('link' => "{$lang->dynamic}|product|dynamic|productID=%s"); $lang->product->menu->settings = array('link' => "{$lang->settings}|product|view|productID=%s", 'subModule' => 'tree,branch', 'alias' => 'edit,whitelist,addwhitelist'); @@ -207,7 +207,7 @@ $lang->scrum->menu->execution = array('link' => "$lang->executionCommon|projec $lang->scrum->menu->storyGroup = array('link' => "{$lang->common->story}|projectstory|story|projectID=%s&product=%s",'class' => 'dropdown dropdown-hover', 'exclude' => 'tree-browse'); $lang->scrum->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story,track'); $lang->scrum->menu->projectplan = array('link' => "{$lang->productplan->shortCommon}|projectplan|browse|productID=%s", 'subModule' => 'productplan'); -$lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=project&objectID=%s", 'subModule' => 'doc'); +$lang->scrum->menu->doc = array('link' => "{$lang->doc->common}|doc|projectSpace|objectID=%s", 'subModule' => 'doc'); $lang->scrum->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport', 'exclude' => 'execution-create,execution-batchedit'); $lang->scrum->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); $lang->scrum->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s", 'subModule' => 'projectbuild'); @@ -260,7 +260,7 @@ $lang->waterfall->menu->storyGroup = array('link' => "{$lang->common->story}|pro $lang->waterfall->menu->story = array('link' => "$lang->SRCommon|projectstory|story|projectID=%s", 'subModule' => 'projectstory,tree', 'alias' => 'story', 'exclude' => 'projectstory-track'); $lang->waterfall->menu->design = array('link' => "{$lang->design->common}|design|browse|project=%s"); $lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|bug|projectID=%s", 'subModule' => 'testcase,testtask,bug,testreport', 'alias' => 'bug,testtask,testcase,testreport'); -$lang->waterfall->menu->doc = array('link' => "{$lang->doc->common}|doc|tableContents|type=project&objectID=%s"); +$lang->waterfall->menu->doc = array('link' => "{$lang->doc->common}|doc|projectSpace|objectID=%s"); $lang->waterfall->menu->devops = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&branchID=&objectID=%s", 'subModule' => 'repo'); $lang->waterfall->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s", 'subModule' => 'projectbuild'); $lang->waterfall->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse|project=%s", 'subModule' => 'projectrelease'); @@ -500,10 +500,10 @@ $lang->kanban->menu = new stdclass(); $lang->doc->menu = new stdclass(); $lang->doc->menu->dashboard = array('link' => "{$lang->dashboard}|doc|index"); $lang->doc->menu->my = array('link' => "{$lang->doc->mySpace}|doc|browse|browseTyp=openedbyme", 'alias' => 'my'); -$lang->doc->menu->product = array('link' => "{$lang->doc->productSpace}|doc|tableContents|type=product", 'alias' => 'showfiles,product'); -$lang->doc->menu->project = array('link' => "{$lang->doc->projectSpace}|doc|tableContents|type=project", 'alias' => 'showfiles,project'); +$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' => 'custom'); +$lang->doc->menu->custom = array('link' => "{$lang->doc->teamSpace}|doc|tableContents|type=custom", 'alias' => 'tablecontents'); $lang->doc->dividerMenu = ',product,'; diff --git a/module/doc/control.php b/module/doc/control.php index 5b6bd3ab42..f750ff202b 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1274,9 +1274,9 @@ class doc extends control } /** - * Show the catalog of the doc library. + * Show team Space. * - * @param string $type + * @param string $type custom|product|project|execution * @param int $objectID * @param int $libID * @param int $moduleID @@ -1289,7 +1289,7 @@ class doc extends control * @access public * @return void */ - public function tableContents($type, $objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function tableContents($type = 'custom', $objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1) { $this->session->set('createProjectLocate', $this->app->getURI(true), 'doc'); @@ -1301,13 +1301,15 @@ class doc extends control $libTree = $this->doc->getLibTree($libID, $libs, $type, $moduleID, $objectID, $browseType); - $title = ($type == 'book' or $type == 'custom') ? $this->lang->doc->tableContents : $object->name . $this->lang->colon . $this->lang->doc->tableContents; + $title = $type == 'custom' ? $this->lang->doc->tableContents : $object->name . $this->lang->colon . $this->lang->doc->tableContents; $lib = $this->doc->getLibById($libID); $libType = isset($lib->type) && $lib->type == 'api' ? 'api' : 'lib'; /* Build the search form. */ $queryID = $browseType == 'bySearch' ? (int)$param : 0; - $actionURL = $this->createLink('doc', 'tableContents', "type=$type&objectID=$objectID&libID=$libID&moduleID=0&browseType=bySearch&orderBy=$orderBy¶m=myQueryID"); + $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); if($libType == 'api') { $this->loadModel('api')->buildSearchForm($lib, $queryID, $actionURL, $libs, $type); @@ -1318,11 +1320,8 @@ class doc extends control } /* Load pager. */ - $rawMethod = $this->app->rawMethod; - $this->app->rawMethod = 'tableContents'; $this->app->loadClass('pager', $static = true); $pager = new pager($recTotal, $recPerPage, $pageID); - $this->app->rawMethod = $rawMethod; if($libType == 'api') { @@ -1367,6 +1366,46 @@ class doc extends control $this->display(); } + /** + * Show product 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 productSpace($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=product&objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$browseType&orderBy=$orderBy¶m=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); + } + + /** + * Show project 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 projectSpace($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=project&objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$browseType&orderBy=$orderBy¶m=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID"); + } + /** * Select lib type. * diff --git a/module/doc/model.php b/module/doc/model.php index 75f0f47109..0a0e4705c7 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -2273,8 +2273,8 @@ class docModel extends model { if(!in_array($type, array('product', 'project'))) return ''; - $currentModule = $this->app->getModuleName(); - $currentMethod = $this->app->getMethodName(); + $currentModule = $this->app->rawModule; + $currentMethod = $this->app->rawMethod; $dropMenuLink = helper::createLink('doc', 'ajaxGetDropMenu', "objectType=$type&objectID=$objectID&module=$currentModule&method=$currentMethod"); $output = "