Merge branch dev/task-145540 of zentao/zentaopms (#9665)

This commit is contained in:
刘刚
2025-06-19 09:43:13 +08:00
committed by Gitfox
3 changed files with 17 additions and 12 deletions
+6 -3
View File
@@ -289,6 +289,7 @@ class doc extends control
public function createLib(string $type = '', int $objectID = 0, int $libID = 0)
{
$this->app->loadLang('api');
$this->doc->setMenuByType($type, (int)$objectID, (int)$libID);
if(!empty($_POST))
{
@@ -308,10 +309,10 @@ class doc extends control
}
$objects = array();
if($type == 'project' && $this->app->tab == 'doc')
if($type == 'project')
{
$this->view->executionPairs = $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
$this->view->project = $this->project->getById($objectID);
$this->view->project = $this->project->getById($objectID);
if($this->app->tab == 'doc') $this->view->executionPairs = $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix');
}
if($type == 'execution')
@@ -319,6 +320,7 @@ class doc extends control
$objects = $this->execution->getPairs(0, 'all', 'multiple,leaf,noprefix,withobject');
$execution = $this->execution->getByID($objectID);
if($execution->type == 'stage') $this->lang->doc->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->doc->execution);
$this->view->execution = $this->doc->fetchByID($objectID, 'execution');
}
if($type == 'custom' || $type == 'mine' || $type == 'doctemplate')
@@ -1804,6 +1806,7 @@ class doc extends control
$this->doc->setMenuByType($type, $spaceID, $libID);
$objectKey = $type . 'ID';
$this->view->$objectKey = $spaceID;
$this->view->$type = $this->doc->fetchByID($spaceID, $type);
}
if($type == 'mine') $menuType = 'my';
+10 -9
View File
@@ -25,26 +25,27 @@ if($type === 'project')
* 定义文档界面上的权限。
* Define the privs of doc app.
*/
$hasCustomSpace = $type == 'mine' || $type == 'custom';
$hasCustomSpace = $type == 'mine' || $type == 'custom';
$projectTemplate = ($type === 'project' && !empty($project->isTpl)) || ($type == 'execution' && !empty($execution->isTpl));
$privs = array();
$privs['create'] = hasPriv('doc', 'create');
$privs['edit'] = hasPriv('doc', 'edit');
$privs['delete'] = hasPriv('doc', 'delete');
$privs['create'] = hasPriv('doc', 'create') && !$projectTemplate;
$privs['edit'] = hasPriv('doc', 'edit') && !$projectTemplate;
$privs['delete'] = hasPriv('doc', 'delete') && !$projectTemplate;
$privs['view'] = hasPriv('doc', 'view');
$privs['effort'] = $this->config->edition != 'open' && hasPriv('effort', 'createForObject');
$privs['exportDoc'] = $this->config->edition != 'open' && hasPriv('doc', $type . '2export');
$privs['exportDoc'] = $this->config->edition != 'open' && hasPriv('doc', $type . '2export') && !$projectTemplate;
$privs['exportApi'] = $this->config->edition != 'open' && hasPriv('api', 'export');
$privs['moveDoc'] = hasPriv('doc', 'moveDoc');
$privs['moveDoc'] = hasPriv('doc', 'moveDoc') && !$projectTemplate;
$privs['collect'] = hasPriv('doc', 'collect');
$privs['createLib'] = hasPriv('doc', 'createLib');
$privs['editLib'] = hasPriv('doc', 'editLib');
$privs['moveLib'] = hasPriv('doc', 'moveLib');
$privs['moveLib'] = hasPriv('doc', 'moveLib') && !$projectTemplate;
$privs['deleteLib'] = hasPriv('doc', 'deleteLib');
$privs['sortDocLib'] = hasPriv('doc', 'sortDocLib');
$privs['uploadFile'] = hasPriv('doc', 'create');
$privs['uploadFile'] = hasPriv('doc', 'create') && !$projectTemplate;
$privs['editFile'] = hasPriv('file', 'edit');
$privs['deleteFile'] = hasPriv('doc', 'deleteFile');
$privs['exportFiles'] = hasPriv('doc', 'exportFiles');
$privs['exportFiles'] = hasPriv('doc', 'exportFiles') && !$projectTemplate;
$privs['createSpace'] = $hasCustomSpace && hasPriv('doc', 'createSpace');
$privs['deleteSpace'] = $hasCustomSpace && hasPriv('doc', 'deleteSpace');
$privs['editSpace'] = $hasCustomSpace && hasPriv('doc', 'editSpace');
+1
View File
@@ -26,6 +26,7 @@ $renderObjectBox = function(string $type) use ($lang, $objects, $objectID)
return formRow(
setClass('objectBox'),
formGroup(
set::id('object'),
set::width('5/6'),
set::label($lang->doc->{$type}),
set::name($type),