* [task#145540,done,0.2h,0h] Fix execution template create doclib error.

This commit is contained in:
wangyuting
2025-06-18 16:57:45 +08:00
parent c961dc441e
commit 8dcbee1754
2 changed files with 3 additions and 1 deletions
+2
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))
{
@@ -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')
+1 -1
View File
@@ -26,7 +26,7 @@ if($type === 'project')
* Define the privs of doc app.
*/
$hasCustomSpace = $type == 'mine' || $type == 'custom';
$projectTemplate = $type === 'project' && !empty($project->isTpl);
$projectTemplate = ($type === 'project' && !empty($project->isTpl)) || ($type == 'execution' && !empty($execution->isTpl));
$privs = array();
$privs['create'] = hasPriv('doc', 'create') && !$projectTemplate;
$privs['edit'] = hasPriv('doc', 'edit') && !$projectTemplate;