diff --git a/db/update18.3.sql b/db/update18.3.sql index 9746aa383d..7fcdc51318 100644 --- a/db/update18.3.sql +++ b/db/update18.3.sql @@ -151,6 +151,8 @@ SELECT t1.`group`, t1.`module`, 'editCatalog' FROM `zt_grouppriv` AS t1 WHERE t1 INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT t1.`group`, t1.`module`, 'deleteCatalog' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'catalog'; +UPDATE `zt_grouppriv` SET `method` = 'mySpace' WHERE `module` = 'doc' AND `method` = 'browse'; + ALTER TABLE `zt_account` CHANGE `editedBy` `editedBy` varchar(30) NOT NULL DEFAULT '', CHANGE `editedDate` `editedDate` datetime NULL; diff --git a/db/zentao.sql b/db/zentao.sql index d782dcc634..68ac057e7a 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -2203,7 +2203,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1,'dev','editor'), (1,'dev','translate'), (1,'doc','allLibs'), -(1,'doc','browse'), +(1,'doc','mySpace'), (1,'doc','myView'), (1,'doc','myCollection'), (1,'doc','myCreation'), @@ -2794,7 +2794,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (2,'dev','api'), (2,'dev','db'), (2,'dev','editor'), -(2,'doc','browse'), +(2,'doc','mySpace'), (2,'doc','myView'), (2,'doc','myCollection'), (2,'doc','myCreation'), @@ -3104,7 +3104,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (3,'company','index'), (3,'company','view'), (3,'datatable','setGlobal'), -(3,'doc','browse'), +(3,'doc','mySpace'), (3,'doc','myView'), (3,'doc','myCollection'), (3,'doc','myCreation'), @@ -3442,7 +3442,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (4,'compile','browse'), (4,'compile','logs'), (4,'datatable','setGlobal'), -(4,'doc','browse'), +(4,'doc','mySpace'), (4,'doc','myView'), (4,'doc','myCollection'), (4,'doc','myCreation'), @@ -3961,7 +3961,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (5,'compile','browse'), (5,'compile','logs'), (5,'datatable','setGlobal'), -(5,'doc','browse'), +(5,'doc','mySpace'), (5,'doc','myView'), (5,'doc','myCollection'), (5,'doc','myCreation'), @@ -4433,7 +4433,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (6,'company','index'), (6,'company','view'), (6,'datatable','setGlobal'), -(6,'doc','browse'), +(6,'doc','mySpace'), (6,'doc','myView'), (6,'doc','myCollection'), (6,'doc','myCreation'), @@ -4827,7 +4827,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (7,'company','index'), (7,'company','view'), (7,'datatable','setGlobal'), -(7,'doc','browse'), +(7,'doc','mySpace'), (7,'doc','myView'), (7,'doc','myCollection'), (7,'doc','myCreation'), @@ -5250,7 +5250,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (8,'compile','logs'), (8,'custom','index'), (8,'datatable','setGlobal'), -(8,'doc','browse'), +(8,'doc','mySpace'), (8,'doc','myView'), (8,'doc','myCollection'), (8,'doc','myCreation'), @@ -5634,7 +5634,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (9,'dept','delete'), (9,'dept','manageChild'), (9,'dept','updateOrder'), -(9,'doc','browse'), +(9,'doc','mySpace'), (9,'doc','myView'), (9,'doc','myCollection'), (9,'doc','myCreation'), @@ -5967,7 +5967,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (10,'company','dynamic'), (10,'company','index'), (10,'company','view'), -(10,'doc','browse'), +(10,'doc','mySpace'), (10,'doc','myView'), (10,'doc','myCollection'), (10,'doc','myCreation'), @@ -6211,7 +6211,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (11,'company','dynamic'), (11,'company','index'), (11,'company','view'), -(11,'doc','browse'), +(11,'doc','mySpace'), (11,'doc','myView'), (11,'doc','myCollection'), (11,'doc','myCreation'), diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index 0b0c9e94f2..87598c28d5 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -499,7 +499,7 @@ $lang->kanban->menu = new stdclass(); /* Doc menu. */ $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=mine", 'alias' => 'my'); +$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'); diff --git a/module/doc/control.php b/module/doc/control.php index 687974e296..603d4fee04 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -53,7 +53,7 @@ class doc extends control } /** - * Browse docs. + * My space. * * @param string $type mine * @param int $libID @@ -67,7 +67,7 @@ class doc extends control * @access public * @return void */ - public function browse($type = 'mine', $libID = 0, $moduleID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function mySpace($type = 'mine', $libID = 0, $moduleID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session, load module. */ $uri = $this->app->getURI(true); @@ -77,9 +77,16 @@ class doc extends control $this->session->set('projectList', $uri, 'project'); $this->loadModel('search'); - /* Set browseType.*/ + list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType('mine', 0, $libID); + + /* Build the search form. */ $browseType = strtolower($browseType); $queryID = $browseType == 'bysearch' ? (int)$param : 0; + $params = "libID=$libID&moduleID=$moduleID&browseType=bySearch¶m=myQueryID&orderBy=$orderBy"; + if($this->app->rawMethod == 'mySpace') $param = "type=$type&" . $params; + $actionURL = $this->createLink('doc', $this->app->rawMethod, $params); + + $this->doc->buildSearchForm($libID, $libs, $queryID, $actionURL, $type); /* Set header and position. */ $this->view->title = $this->lang->doc->common; @@ -91,8 +98,6 @@ class doc extends control /* Append id for secend sort. */ $sort = common::appendOrder($orderBy); - list($libs, $libID, $object, $objectID, $objectDropdown) = $this->doc->setMenuByType('mine', 0, $libID); - $this->view->moduleID = $moduleID; $this->view->docs = $this->doc->getDocsByBrowseType($browseType, $queryID, $moduleID, $sort, $pager); $this->view->users = $this->user->getPairs('noletter'); @@ -103,7 +108,7 @@ class doc extends control $this->view->lib = $this->doc->getLibById($libID); $this->view->libTree = $this->doc->getLibTree($libID, $libs, 'mine', 0); $this->view->pager = $pager; - $this->view->type = 'mine'; + $this->view->type = $type; $this->view->objectID = 0; $this->view->canExport = 0; $this->view->libType = 'lib'; @@ -587,10 +592,7 @@ class doc extends control $this->config->showMainMenu = strpos(',html,markdown,text,', ",{$doc->type},") === false; - $this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->edit; - $this->view->position[] = html::a($this->createLink('doc', 'browse', "libID=$libID"), $lib->name); - $this->view->position[] = $this->lang->doc->edit; - + $this->view->title = $lib->name . $this->lang->colon . $this->lang->doc->edit; $this->view->doc = $doc; $this->view->moduleOptionMenu = $moduleOptionMenu; $this->view->type = $objectType; @@ -1200,9 +1202,10 @@ class doc extends control } } - $doc = $docID ? $doc : ''; + $doc = $docID ? $doc : ''; + $spaceType = $objectType . 'Space'; - $this->view->title = $type == 'custom' ? $this->lang->doc->customAB : $object->name; + $this->view->title = isset($this->lang->doc->{$spaceType}) ? $this->lang->doc->{$spaceType} : $this->lang->doc->common; $this->view->docID = $docID; $this->view->doc = $doc; $this->view->version = $version; diff --git a/module/doc/css/browse.css b/module/doc/css/myspace.css similarity index 100% rename from module/doc/css/browse.css rename to module/doc/css/myspace.css diff --git a/module/doc/js/common.js b/module/doc/js/common.js index 5fe7b0964b..6ccf395459 100644 --- a/module/doc/js/common.js +++ b/module/doc/js/common.js @@ -327,7 +327,7 @@ function locateNewLib(type, objectID, libID) } else if(type == 'mine') { - method = 'browse'; + method = 'mySpace'; params = 'type=mine&libID=' + libID; } diff --git a/module/doc/js/browse.js b/module/doc/js/myspace.js similarity index 100% rename from module/doc/js/browse.js rename to module/doc/js/myspace.js diff --git a/module/doc/model.php b/module/doc/model.php index e234373984..a414b800a1 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -994,7 +994,7 @@ class docModel extends model unset($this->config->doc->search['fields']['module']); } - elseif(in_array($type, array('product', 'project', 'execution', 'custom', 'book'))) + elseif(in_array($type, array('product', 'project', 'execution', 'custom', 'mine'))) { if(!isset($libs[$libID])) $libs[$libID] = $this->getLibById($libID); @@ -1034,8 +1034,7 @@ class docModel extends model $this->config->doc->search['queryID'] = $queryID; /* Get the modules. */ - $moduleOptionMenu = $this->loadModel('tree')->getOptionMenu($libID, 'doc', $startModuleID = 0); - $this->config->doc->search['params']['module']['values'] = $moduleOptionMenu; + $this->config->doc->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($libID, 'doc', $startModuleID = 0); if($type == 'index' || $type == 'view' || ($this->app->rawMethod != 'contribute' and $libID == 0)) { @@ -2666,7 +2665,8 @@ class docModel extends model $object->id = 0; } - $tab = strpos(',doc,product,project,execution,', ",{$this->app->tab},") !== false ? $this->app->tab : 'doc'; + $tab = strpos(',doc,product,project,execution,', ",{$this->app->tab},") !== false ? $this->app->tab : 'doc'; + $type = $type == 'mine' ? 'my' : $type; if($tab != 'doc' and method_exists($type . 'Model', 'setMenu')) { $this->loadModel($type)->setMenu($objectID); diff --git a/module/doc/view/lefttree.html.php b/module/doc/view/lefttree.html.php index 3c6b196d2e..1bf643ff8b 100644 --- a/module/doc/view/lefttree.html.php +++ b/module/doc/view/lefttree.html.php @@ -421,7 +421,7 @@ $(function() } else if(objectType == 'mine') { - methodName = 'browse'; + methodName = 'mySpace'; linkParams = 'type=mine&libID=' + libID; } else if(['text', 'word', 'ppt', 'excel'].indexOf(type) !== -1) diff --git a/module/doc/view/browse.html.php b/module/doc/view/myspace.html.php similarity index 94% rename from module/doc/view/browse.html.php rename to module/doc/view/myspace.html.php index c64ea4d32b..402d114905 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/myspace.html.php @@ -53,7 +53,6 @@