From febf901e8c3d7e4e510f30bf50e3f703fbdde950 Mon Sep 17 00:00:00 2001 From: sunguangming Date: Tue, 6 Aug 2024 02:52:10 +0000 Subject: [PATCH] * [task#124815,doing,1h] add field for create lib. --- module/doc/config/form.php | 2 ++ module/doc/control.php | 6 +++++- module/doc/zen.php | 2 -- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/doc/config/form.php b/module/doc/config/form.php index 6cb7229289..4c32424297 100644 --- a/module/doc/config/form.php +++ b/module/doc/config/form.php @@ -6,6 +6,8 @@ global $app, $config; $config->doc->form = new stdclass(); $config->doc->form->createlib['name'] = array('type' => 'string', 'required' => true, 'default' => '', 'filter' => 'trim'); +$config->doc->form->createlib['spaceName'] = array('type' => 'string', 'required' => false, 'default' => '', 'filter' => 'trim'); +$config->doc->form->createlib['parent'] = array('type' => 'int', 'required' => false, 'default' => 0); $config->doc->form->createlib['baseUrl'] = array('type' => 'string', 'required' => false, 'default' => ''); $config->doc->form->createlib['acl'] = array('type' => 'string', 'required' => false, 'default' => ''); $config->doc->form->createlib['type'] = array('type' => 'string', 'required' => false, 'default' => ''); diff --git a/module/doc/control.php b/module/doc/control.php index cd2a192528..ee18e23b40 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -138,6 +138,8 @@ class doc extends control if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); $libID = $this->doc->createLib($lib, (string)$this->post->type, (string)$this->post->libType); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + return $this->docZen->responseAfterCreateLib($type, $objectID, $libID); } @@ -147,7 +149,7 @@ class doc extends control if($type == 'product') $objects = $this->product->getPairs(); if($type == 'project') { - $objects = $this->project->getPairsByProgram(0, 'all', false, 'order_asc'); + $objects = $this->project->getPairsByProgram(0, 'all', false, 'order_asc'); if($this->app->tab == 'doc') { $this->view->executionPairs = $this->execution->getPairs($objectID, 'all', 'multiple,leaf,noprefix'); @@ -162,6 +164,8 @@ class doc extends control if($execution->type == 'stage') $this->lang->doc->execution = str_replace($this->lang->executionCommon, $this->lang->project->stage, $this->lang->doc->execution); } + if($type == 'custom') $this->view->spaces = $this->doc->getTeamSpaces(); + $this->docZen->setAclForCreateLib($type); $this->view->groups = $this->loadModel('group')->getPairs(); diff --git a/module/doc/zen.php b/module/doc/zen.php index ccb0924cb3..178737344b 100644 --- a/module/doc/zen.php +++ b/module/doc/zen.php @@ -292,8 +292,6 @@ class docZen extends doc */ protected function responseAfterCreateLib(string $type = '', int $objectID = 0, int $libID = 0): bool|int { - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - if($type == 'project' && $this->post->project) $objectID = $this->post->project; if($type == 'product' && $this->post->product) $objectID = $this->post->product; if($type == 'execution' && $this->post->execution) $objectID = $this->post->execution;