From 04a8604aa62b9de8324ec11ef13d50cbf244f65f Mon Sep 17 00:00:00 2001 From: tianshujie Date: Tue, 18 Apr 2023 08:22:38 +0800 Subject: [PATCH] * Fix bug #34295. --- db/update18.3.sql | 3 +++ db/zentao.sql | 11 ++++++++++ module/doc/config.php | 1 + module/doc/model.php | 18 +++++++++------- module/group/lang/resource.php | 38 ++++++++++++++++++---------------- 5 files changed, 45 insertions(+), 26 deletions(-) diff --git a/db/update18.3.sql b/db/update18.3.sql index 726ab1762c..cf9c51a501 100644 --- a/db/update18.3.sql +++ b/db/update18.3.sql @@ -274,6 +274,9 @@ SELECT t1.`group`, t1.`module`, 'myCollection' FROM `zt_grouppriv` AS t1 WHERE t INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT t1.`group`, t1.`module`, 'myCreation' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'browse'; +INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`) +SELECT t1.`group`, t1.`module`, 'myEdited' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'browse'; + INSERT IGNORE INTO `zt_grouppriv` (`group`, `module`, `method`) SELECT t1.`group`, t1.`module`, 'productSpace' FROM `zt_grouppriv` AS t1 WHERE t1.`module` = 'doc' AND t1.`method` = 'tableContents'; diff --git a/db/zentao.sql b/db/zentao.sql index 53894ee901..597de86cd7 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -3426,6 +3426,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (1, 'doc', 'manageBook'), (1, 'doc', 'myCollection'), (1, 'doc', 'myCreation'), +(1, 'doc', 'myEdited'), (1, 'doc', 'mySpace'), (1, 'doc', 'myView'), (1, 'doc', 'productSpace'), @@ -4780,6 +4781,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (2, 'doc', 'index'), (2, 'doc', 'myCollection'), (2, 'doc', 'myCreation'), +(2, 'doc', 'myEdited'), (2, 'doc', 'mySpace'), (2, 'doc', 'myView'), (2, 'doc', 'productSpace'), @@ -5508,6 +5510,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (3, 'doc', 'index'), (3, 'doc', 'myCollection'), (3, 'doc', 'myCreation'), +(3, 'doc', 'myEdited'), (3, 'doc', 'mySpace'), (3, 'doc', 'myView'), (3, 'doc', 'productSpace'), @@ -6188,6 +6191,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (4, 'doc', 'manageBook'), (4, 'doc', 'myCollection'), (4, 'doc', 'myCreation'), +(4, 'doc', 'myEdited'), (4, 'doc', 'mySpace'), (4, 'doc', 'myView'), (4, 'doc', 'productSpace'), @@ -7223,6 +7227,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (5, 'doc', 'index'), (5, 'doc', 'myCollection'), (5, 'doc', 'myCreation'), +(5, 'doc', 'myEdited'), (5, 'doc', 'mySpace'), (5, 'doc', 'myView'), (5, 'doc', 'productSpace'), @@ -8142,6 +8147,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (6, 'doc', 'index'), (6, 'doc', 'myCollection'), (6, 'doc', 'myCreation'), +(6, 'doc', 'myEdited'), (6, 'doc', 'mySpace'), (6, 'doc', 'myView'), (6, 'doc', 'productSpace'), @@ -8939,6 +8945,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (7, 'doc', 'index'), (7, 'doc', 'myCollection'), (7, 'doc', 'myCreation'), +(7, 'doc', 'myEdited'), (7, 'doc', 'mySpace'), (7, 'doc', 'myView'), (7, 'doc', 'productSpace'), @@ -9751,6 +9758,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (8, 'doc', 'index'), (8, 'doc', 'myCollection'), (8, 'doc', 'myCreation'), +(8, 'doc', 'myEdited'), (8, 'doc', 'mySpace'), (8, 'doc', 'myView'), (8, 'doc', 'productSpace'), @@ -10592,6 +10600,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (9, 'doc', 'index'), (9, 'doc', 'myCollection'), (9, 'doc', 'myCreation'), +(9, 'doc', 'myEdited'), (9, 'doc', 'mySpace'), (9, 'doc', 'myView'), (9, 'doc', 'productSpace'), @@ -11259,6 +11268,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (10, 'doc', 'index'), (10, 'doc', 'myCollection'), (10, 'doc', 'myCreation'), +(10, 'doc', 'myEdited'), (10, 'doc', 'mySpace'), (10, 'doc', 'myView'), (10, 'doc', 'productSpace'), @@ -11762,6 +11772,7 @@ REPLACE INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES (11, 'doc', 'index'), (11, 'doc', 'myCollection'), (11, 'doc', 'myCreation'), +(11, 'doc', 'myEdited'), (11, 'doc', 'mySpace'), (11, 'doc', 'myView'), (11, 'doc', 'productSpace'), diff --git a/module/doc/config.php b/module/doc/config.php index 509dfaa28c..7b2f96b2ec 100644 --- a/module/doc/config.php +++ b/module/doc/config.php @@ -50,6 +50,7 @@ $config->doc->spaceMethod['mine'] = 'myspace'; $config->doc->spaceMethod['view'] = 'myspace'; $config->doc->spaceMethod['collect'] = 'myspace'; $config->doc->spaceMethod['createdby'] = 'myspace'; +$config->doc->spaceMethod['editedby'] = 'myspace'; $config->doc->spaceMethod['product'] = 'productspace'; $config->doc->spaceMethod['project'] = 'projectspace'; $config->doc->spaceMethod['execution'] = 'projectspace'; diff --git a/module/doc/model.php b/module/doc/model.php index e5fdfcfa9a..54c79f6ff3 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -3148,21 +3148,23 @@ class docModel extends model $myCreation->hasAction = false; $myCreation->active = $libType == 'createdby' ? 1 : 0; - $myCreation = new stdclass(); - $myCreation->id = 0; - $myCreation->name = $this->lang->doc->myEdited; - $myCreation->type = 'editedBy'; - $myCreation->objectType = 'doc'; - $myCreation->objectID = 0; - $myCreation->hasAction = false; - $myCreation->active = $libType == 'editedby' ? 1 : 0; + $myEdited = new stdclass(); + $myEdited->id = 0; + $myEdited->name = $this->lang->doc->myEdited; + $myEdited->type = 'editedBy'; + $myEdited->objectType = 'doc'; + $myEdited->objectID = 0; + $myEdited->hasAction = false; + $myEdited->active = $libType == 'editedby' ? 1 : 0; $libTree = array(); $libTree[] = $myLib; if(common::hasPriv('doc', 'myView')) $libTree[] = $myView; if(common::hasPriv('doc', 'myCollection')) $libTree[] = $myCollection; if(common::hasPriv('doc', 'myCreation')) $libTree[] = $myCreation; + if(common::hasPriv('doc', 'myEdited')) $libTree[] = $myEdited; } + return $libTree; } diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 4c948337ec..54c7b77d5f 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -1401,6 +1401,7 @@ $lang->resource->doc->mySpace = 'mySpace'; $lang->resource->doc->myView = 'myView'; $lang->resource->doc->myCollection = 'myCollection'; $lang->resource->doc->myCreation = 'myCreation'; +$lang->resource->doc->myEdited = 'myEdited'; $lang->resource->doc->createLib = 'createLib'; $lang->resource->doc->editLib = 'editLib'; $lang->resource->doc->deleteLib = 'deleteLib'; @@ -1425,24 +1426,25 @@ $lang->doc->methodOrder[10] = 'mySpace'; $lang->doc->methodOrder[15] = 'myView'; $lang->doc->methodOrder[20] = 'myCollection'; $lang->doc->methodOrder[25] = 'myCreation'; -$lang->doc->methodOrder[30] = 'createLib'; -$lang->doc->methodOrder[35] = 'editLib'; -$lang->doc->methodOrder[40] = 'deleteLib'; -$lang->doc->methodOrder[45] = 'create'; -$lang->doc->methodOrder[50] = 'edit'; -$lang->doc->methodOrder[55] = 'view'; -$lang->doc->methodOrder[60] = 'delete'; -$lang->doc->methodOrder[65] = 'deleteFile'; -$lang->doc->methodOrder[70] = 'collect'; -$lang->doc->methodOrder[75] = 'productSpace'; -$lang->doc->methodOrder[80] = 'projectSpace'; -$lang->doc->methodOrder[85] = 'teamSpace'; -$lang->doc->methodOrder[90] = 'showFiles'; -$lang->doc->methodOrder[95] = 'addCatalog'; -$lang->doc->methodOrder[100] = 'editCatalog'; -$lang->doc->methodOrder[105] = 'sortCatalog'; -$lang->doc->methodOrder[110] = 'deleteCatalog'; -$lang->doc->methodOrder[115] = 'displaySetting'; +$lang->doc->methodOrder[30] = 'myEdited'; +$lang->doc->methodOrder[35] = 'createLib'; +$lang->doc->methodOrder[40] = 'editLib'; +$lang->doc->methodOrder[45] = 'deleteLib'; +$lang->doc->methodOrder[50] = 'create'; +$lang->doc->methodOrder[55] = 'edit'; +$lang->doc->methodOrder[60] = 'view'; +$lang->doc->methodOrder[65] = 'delete'; +$lang->doc->methodOrder[70] = 'deleteFile'; +$lang->doc->methodOrder[75] = 'collect'; +$lang->doc->methodOrder[80] = 'productSpace'; +$lang->doc->methodOrder[85] = 'projectSpace'; +$lang->doc->methodOrder[90] = 'teamSpace'; +$lang->doc->methodOrder[95] = 'showFiles'; +$lang->doc->methodOrder[100] = 'addCatalog'; +$lang->doc->methodOrder[105] = 'editCatalog'; +$lang->doc->methodOrder[110] = 'sortCatalog'; +$lang->doc->methodOrder[115] = 'deleteCatalog'; +$lang->doc->methodOrder[120] = 'displaySetting'; /* Mail. */ $lang->resource->mail = new stdclass();