diff --git a/module/doc/control.php b/module/doc/control.php index 12fdbcb4bb..0873adb510 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -380,7 +380,9 @@ class doc extends control $this->docZen->assignVarsForCreate($objectType, $objectID, $libID, $moduleID, $docType); - $lib = $this->view->lib; + $lib = $this->view->lib; + if(empty($lib)) return $this->send(array('result' => 'fail', 'message' => $this->lang->doc->errorEmptySpaceLib)); + $objectID = $this->view->objectID; $libData = $this->doc->setMenuByType($lib->type, (int)$objectID, (int)$lib->id, (int)$appendLib); if(is_string($libData)) return $this->locate($libData); diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index 2a4005b437..388f4c20c9 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -339,6 +339,7 @@ $lang->doc->confirmOtherEditing = "This document is currently editing. Continui $lang->doc->errorEditSystemDoc = "System Dokumentenbibliothek darf nicht geändert werden."; $lang->doc->errorEmptyProduct = "Kein {$lang->productCommon}. Kann nicht erstellt werden."; $lang->doc->errorEmptyProject = "Kein {$lang->executionCommon}. Kann nicht erstellt werden."; +$lang->doc->errorEmptySpaceLib = "There is no document library in this space. It cannot be created. Please create a document library first"; $lang->doc->errorMainSysLib = "Diese Bibliothek kann nicht gelöscht werden."; $lang->doc->accessDenied = "Zugriff verweigert!"; $lang->doc->versionNotFount = 'Existiert nicht in diesem Build.'; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 80d29e404d..1e67eff6b2 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -339,6 +339,7 @@ $lang->doc->confirmOtherEditing = "This document is currently editing. Continui $lang->doc->errorEditSystemDoc = "You don't have to change system document library."; $lang->doc->errorEmptyProduct = "No {$lang->productCommon}. It cannot be created."; $lang->doc->errorEmptyProject = "No {$lang->executionCommon}. It cannot be created."; +$lang->doc->errorEmptySpaceLib = "There is no document library in this space. It cannot be created. Please create a document library first"; $lang->doc->errorMainSysLib = "This library cannot be deleted."; $lang->doc->accessDenied = "Access is denied!"; $lang->doc->versionNotFount = 'It does not exist in this build.'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index 677b105c1b..c1aa00dc85 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -339,6 +339,7 @@ $lang->doc->confirmOtherEditing = "This document is currently editing. Continui $lang->doc->errorEditSystemDoc = "Vous n'avez pas besoin de changer de système de Bibliothèque."; $lang->doc->errorEmptyProduct = "Aucun {$lang->productCommon}. Il ne peut pas être créé."; $lang->doc->errorEmptyProject = "Aucun {$lang->executionCommon}. Il ne peut pas être créé."; +$lang->doc->errorEmptySpaceLib = "There is no document library in this space. It cannot be created. Please create a document library first"; $lang->doc->errorMainSysLib = "Cette Bibliothèque ne peut pas être supprimée."; $lang->doc->accessDenied = "Access is denied !"; $lang->doc->versionNotFount = "N'existe pas dans ce build."; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index d0e69f7670..83fd645d79 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -339,6 +339,7 @@ $lang->doc->confirmOtherEditing = "该文档正在编辑中,如果继续编 $lang->doc->errorEditSystemDoc = "系统文档库无需修改。"; $lang->doc->errorEmptyProduct = "没有{$lang->productCommon},无法创建文档"; $lang->doc->errorEmptyProject = "没有{$lang->executionCommon},无法创建文档"; +$lang->doc->errorEmptySpaceLib = "该空间下没有文档库,无法创建文档,请先创建文档库"; $lang->doc->errorMainSysLib = "该系统文档库不能删除!"; $lang->doc->accessDenied = "您没有权限访问!"; $lang->doc->versionNotFount = '该版本文档不存在'; diff --git a/module/doc/zen.php b/module/doc/zen.php index 2b71a9ae35..ad87da7b99 100644 --- a/module/doc/zen.php +++ b/module/doc/zen.php @@ -389,6 +389,7 @@ class docZen extends doc * * @param string $space * @param int $libID + * @param string $locateLink * @access protected * @return bool|int */ @@ -520,7 +521,7 @@ class docZen extends doc if(!$libID && !empty($libPairs)) $libID = key($libPairs); if(empty($lib) && $libID) $lib = $this->doc->getLibByID($libID); - $this->setObjectsForCreate($lib->type, $lib, $unclosed, $objectID); + $this->setObjectsForCreate(empty($lib->type) ? '' : $lib->type, $lib, $unclosed, $objectID); $this->view->objectType = $objectType; $this->view->spaceType = $objectType; @@ -529,11 +530,11 @@ class docZen extends doc $this->view->objectID = $objectID; $this->view->libs = $libPairs; $this->view->libName = zget($lib, 'name', ''); - $this->view->optionMenu = $this->loadModel('tree')->getOptionMenu($libID, 'doc', $startModuleID = 0); $this->view->moduleID = $moduleID; $this->view->docType = $docType; $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->users = $this->user->getPairs('nocode|noclosed|nodeleted'); + $this->view->optionMenu = empty($libID) ? array() : $this->loadModel('tree')->getOptionMenu($libID, 'doc', $startModuleID = 0); } /**