From 8dcbee1754b058d3c20586a3aa65a0d222ed8beb Mon Sep 17 00:00:00 2001 From: wangyuting Date: Wed, 18 Jun 2025 16:57:45 +0800 Subject: [PATCH] * [task#145540,done,0.2h,0h] Fix execution template create doclib error. --- module/doc/control.php | 2 ++ module/doc/ui/app.html.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/module/doc/control.php b/module/doc/control.php index 0b68457f6f..63e5c7b261 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -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') diff --git a/module/doc/ui/app.html.php b/module/doc/ui/app.html.php index 432bf06f47..0c3744883f 100644 --- a/module/doc/ui/app.html.php +++ b/module/doc/ui/app.html.php @@ -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;