From 9cc499deb095123ca2b66bec8e5bc824d3ff5cbe Mon Sep 17 00:00:00 2001 From: daitingting Date: Thu, 13 Mar 2025 01:44:16 +0000 Subject: [PATCH] * [task#139262,done,2h] Adjust delete module. --- lib/zin/wg/docapp/js/v1.js | 9 ++-- module/doc/control.php | 16 +++++++- module/doc/lang/de.php | 82 +++++++++++++++++++------------------ module/doc/lang/en.php | 84 ++++++++++++++++++++------------------ module/doc/lang/fr.php | 82 +++++++++++++++++++------------------ module/doc/lang/zh-cn.php | 82 +++++++++++++++++++------------------ module/doc/model.php | 23 +++++++++-- 7 files changed, 213 insertions(+), 165 deletions(-) diff --git a/lib/zin/wg/docapp/js/v1.js b/lib/zin/wg/docapp/js/v1.js index 84b4089834..edd5c3c8fd 100644 --- a/lib/zin/wg/docapp/js/v1.js +++ b/lib/zin/wg/docapp/js/v1.js @@ -1317,12 +1317,13 @@ const commands = }, deleteModule: function(_, args) { - const docApp = getDocApp(); - const moduleID = args[0] || docApp.moduleID; + const docApp = getDocApp(); + const moduleID = args[0] || docApp.moduleID; + const moduleInfo = docApp.treeMap.modules.get(+moduleID); $.ajaxSubmit( { - confirm: getLang('confirmDeleteModule'), + confirm: getLang(moduleInfo.data.isParent ? 'confirmDeleteModuleWithSub' : 'confirmDeleteModule'), url: $.createLink('doc', 'deleteCatalog', `moduleID=${moduleID}`), load: false, onSuccess: function(res) @@ -1463,7 +1464,7 @@ const commands = const isChapter = doc?.type === 'chapter'; $.ajaxSubmit( { - confirm: getLang(isChapter ? 'confirmDeleteChapter' : 'confirmDelete'), + confirm: getLang(isChapter ? 'confirmDeleteChapter' : (doc.isParent ? 'confirmDeleteWithSub' : 'confirmDelete')), url: $.createLink(isApi ? 'api' : 'doc', 'delete', `${isApi ? 'apiID' : 'docID'}=${isApi ? getApiID(docID) : docID}`), load: false, onSuccess: function() diff --git a/module/doc/control.php b/module/doc/control.php index 7998a2f48e..4c950bf0e2 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -579,6 +579,12 @@ class doc extends control ->setDefault('editedBy', $this->app->user->account) ->get(); + if($docData->parent && !$docData->module) + { + $parentDoc = $this->doc->getByID($docData->parent); + $docData->module = $parentDoc->module; + } + $docResult = $this->doc->create($docData, $this->post->labels); if(!$docResult || dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); return $this->docZen->responseAfterCreate($docResult); @@ -1937,7 +1943,15 @@ class doc extends control $this->view->chapterAndDocs = $chapterAndDocs; } - if($modalType == 'subDoc') $isCreate = true; + if($modalType == 'subDoc') + { + $isCreate = true; + if(!$moduleID && $docID) + { + $parentDoc = $this->doc->getByID($docID); + $moduleID = $parentDoc->module; + } + } if($isCreate) { diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index fbc1448d27..f1a32cc40b 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -404,45 +404,47 @@ $lang->doc->mail->edit = new stdclass(); $lang->doc->mail->releasedDoc->title = "%s released document #%s:%s"; $lang->doc->mail->edit->title = "%s edited document #%s:%s"; -$lang->doc->confirmDelete = "Möchten Sie dieses Dokument löschen?"; -$lang->doc->confirmDeleteLib = "Möchten Sie diese Bibliothek löschen?"; -$lang->doc->confirmDeleteSpace = "Möchten Sie diesen Bereich löschen?"; -$lang->doc->confirmDeleteBook = "Do you want to delete this book?"; -$lang->doc->confirmDeleteChapter = "Do you want to delete this chapter?"; -$lang->doc->confirmDeleteModule = "After deleting the module, the sub modules and documents will be deleted simultaneously. Are you sure you want to delete this module?"; -$lang->doc->confirmOtherEditing = "This document is currently editing. Continuing to edit will overwrite the content edited by others. Do you want to continue?"; -$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.'; -$lang->doc->noDoc = 'Keine Dokumente. '; -$lang->doc->noArticle = 'No articles.'; -$lang->doc->noLib = 'No libraries.'; -$lang->doc->noBook = 'The Wiki library has not created a manual, please create a new one :)'; -$lang->doc->cannotCreateOffice = 'Sorry, %s file can only be created in ZenTao Biz Series or above. Contact Philip@easysoft.ltd to know more about ZenTao Biz Series and ZenTao Max Series.'; -$lang->doc->notSetOffice = "

To create a %s document, you need to configure Collabora Online.

"; -$lang->doc->requestTypeError = "The current requestType configuration is not PATH_INFO, cannot use the online editing. Please contact the administrator to modify the requestType configuration."; -$lang->doc->notSetCollabora = "Collabora Online is not set up, unable to create %s document. Please configure Collabora Online."; -$lang->doc->noSearchedDoc = 'Nichts gesucht.'; -$lang->doc->noEditedDoc = 'Sie haben kein Dokument bearbeitet.'; -$lang->doc->noOpenedDoc = 'Sie haben kein Dokument erstellt.'; -$lang->doc->noCollectedDoc = 'Sie haben kein Dokument gesammelt.'; -$lang->doc->errorEmptyLib = 'No data in document library.'; -$lang->doc->confirmUpdateContent = 'You have a document that is not saved from last time. Do you want to continue editing it?'; -$lang->doc->selectLibType = 'Please select a type of doc library.'; -$lang->doc->noLibreOffice = 'You does not have access to office conversion settings!'; -$lang->doc->errorParentChapter = 'The parent chapter cannot be its own chapter or sub chapter!'; -$lang->doc->errorOthersCreated = 'There are documents created by others in this library. You cannot move it.'; -$lang->doc->confirmLeaveOnEdit = 'Wird nach ungespeicherten dokumenten gefragt, ob dies fortgesetzt wurde?'; -$lang->doc->errorOccurred = 'An error occurred. Please try again later.'; -$lang->doc->selectLibFirst = 'Please select a lib first.'; -$lang->doc->createLibFirst = 'Please create a lib first.'; -$lang->doc->nopriv = 'You do not have access permissions for %s and cannot view this document. If you need to adjust permissions, please contact relevant personnel.'; -$lang->doc->docConvertComment = "This document has been converted to the new editor format. Switch to version %s to view the document before conversion."; -$lang->doc->previewNotAvailable = 'Preview function is not available. Please visit the Kanban board to view the document %s.'; +$lang->doc->confirmDelete = "Möchten Sie dieses Dokument löschen?"; +$lang->doc->confirmDeleteWithSub = "After deleting the document, the sub contents will be deleted simultaneously. Are you sure you want to delete this document?"; +$lang->doc->confirmDeleteLib = "Möchten Sie diese Bibliothek löschen?"; +$lang->doc->confirmDeleteSpace = "Möchten Sie diesen Bereich löschen?"; +$lang->doc->confirmDeleteBook = "Do you want to delete this book?"; +$lang->doc->confirmDeleteChapter = "Do you want to delete this chapter?"; +$lang->doc->confirmDeleteModule = "Do you want to delete this module?"; +$lang->doc->confirmDeleteModuleWithSub = "After deleting the module, the sub modules and documents will be deleted simultaneously. Are you sure you want to delete this module?"; +$lang->doc->confirmOtherEditing = "This document is currently editing. Continuing to edit will overwrite the content edited by others. Do you want to continue?"; +$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.'; +$lang->doc->noDoc = 'Keine Dokumente. '; +$lang->doc->noArticle = 'No articles.'; +$lang->doc->noLib = 'No libraries.'; +$lang->doc->noBook = 'The Wiki library has not created a manual, please create a new one :)'; +$lang->doc->cannotCreateOffice = 'Sorry, %s file can only be created in ZenTao Biz Series or above. Contact Philip@easysoft.ltd to know more about ZenTao Biz Series and ZenTao Max Series.'; +$lang->doc->notSetOffice = "

To create a %s document, you need to configure Collabora Online.

"; +$lang->doc->requestTypeError = "The current requestType configuration is not PATH_INFO, cannot use the online editing. Please contact the administrator to modify the requestType configuration."; +$lang->doc->notSetCollabora = "Collabora Online is not set up, unable to create %s document. Please configure Collabora Online."; +$lang->doc->noSearchedDoc = 'Nichts gesucht.'; +$lang->doc->noEditedDoc = 'Sie haben kein Dokument bearbeitet.'; +$lang->doc->noOpenedDoc = 'Sie haben kein Dokument erstellt.'; +$lang->doc->noCollectedDoc = 'Sie haben kein Dokument gesammelt.'; +$lang->doc->errorEmptyLib = 'No data in document library.'; +$lang->doc->confirmUpdateContent = 'You have a document that is not saved from last time. Do you want to continue editing it?'; +$lang->doc->selectLibType = 'Please select a type of doc library.'; +$lang->doc->noLibreOffice = 'You does not have access to office conversion settings!'; +$lang->doc->errorParentChapter = 'The parent chapter cannot be its own chapter or sub chapter!'; +$lang->doc->errorOthersCreated = 'There are documents created by others in this library. You cannot move it.'; +$lang->doc->confirmLeaveOnEdit = 'Wird nach ungespeicherten dokumenten gefragt, ob dies fortgesetzt wurde?'; +$lang->doc->errorOccurred = 'An error occurred. Please try again later.'; +$lang->doc->selectLibFirst = 'Please select a lib first.'; +$lang->doc->createLibFirst = 'Please create a lib first.'; +$lang->doc->nopriv = 'You do not have access permissions for %s and cannot view this document. If you need to adjust permissions, please contact relevant personnel.'; +$lang->doc->docConvertComment = "This document has been converted to the new editor format. Switch to version %s to view the document before conversion."; +$lang->doc->previewNotAvailable = 'Preview function is not available. Please visit the Kanban board to view the document %s.'; $lang->doc->noticeAcl['lib']['product']['default'] = "Users who can access the selected {$lang->productCommon} can access it."; $lang->doc->noticeAcl['lib']['product']['custom'] = "Users who can access the selected {$lang->productCommon} or users in the whiltelist can access it."; @@ -539,9 +541,11 @@ $lang->doc->docLang->deleteDoc = $lang->doc->delete; $lang->doc->docLang->uploadDoc = $lang->doc->uploadDoc; $lang->doc->docLang->createList = $lang->doc->createList; $lang->doc->docLang->confirmDelete = $lang->doc->confirmDelete; +$lang->doc->docLang->confirmDeleteWithSub = $lang->doc->confirmDeleteWithSub; $lang->doc->docLang->confirmDeleteLib = $lang->doc->confirmDeleteLib; $lang->doc->docLang->confirmDeleteSpace = $lang->doc->confirmDeleteSpace; $lang->doc->docLang->confirmDeleteModule = $lang->doc->confirmDeleteModule; +$lang->doc->docLang->confirmDeleteModuleWithSub = $lang->doc->confirmDeleteModuleWithSub; $lang->doc->docLang->confirmDeleteChapter = $lang->doc->confirmDeleteChapter; $lang->doc->docLang->collect = $lang->doc->collect; $lang->doc->docLang->edit = $lang->doc->edit; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index c99d67d2c4..24da9af72c 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -404,45 +404,47 @@ $lang->doc->mail->edit = new stdclass(); $lang->doc->mail->releasedDoc->title = "%s released document #%s:%s"; $lang->doc->mail->edit->title = "%s edited document #%s:%s"; -$lang->doc->confirmDelete = "Do you want to delete this document?"; -$lang->doc->confirmDeleteLib = "Do you want to delete this document library?"; -$lang->doc->confirmDeleteSpace = "After deleting the space, the libraries, directories and documents in the space will be deleted simultaneously. Are you sure you want to delete this space?"; -$lang->doc->confirmDeleteBook = "Do you want to delete this book?"; -$lang->doc->confirmDeleteChapter = "Do you want to delete this chapter?"; -$lang->doc->confirmDeleteModule = "After deleting the module, the sub modules and documents will be deleted simultaneously. Are you sure you want to delete this module?"; -$lang->doc->confirmOtherEditing = "This document is currently editing. Continuing to edit will overwrite the content edited by others. Do you want to continue?"; -$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.'; -$lang->doc->noDoc = 'No documents. '; -$lang->doc->noArticle = 'No articles.'; -$lang->doc->noLib = 'No libraries.'; -$lang->doc->noBook = 'The Wiki library has not created a manual, please create a new one :)'; -$lang->doc->cannotCreateOffice = 'Sorry, %s file can only be created in ZenTao Biz Series or above. Contact Philip@easysoft.ltd to know more about ZenTao Biz Series and ZenTao Max Series.'; -$lang->doc->notSetOffice = "

To create a %s document, you need to configure Collabora Online.

"; -$lang->doc->requestTypeError = "The current requestType configuration is not PATH_INFO, cannot use the online editing. Please contact the administrator to modify the requestType configuration."; -$lang->doc->notSetCollabora = "Collabora Online is not set up, unable to create %s document. Please configure Collabora Online."; -$lang->doc->noSearchedDoc = 'No documents found.'; -$lang->doc->noEditedDoc = 'You have not edited any documents.'; -$lang->doc->noOpenedDoc = 'You have not created any documents.'; -$lang->doc->noCollectedDoc = 'You have not favorited any documents.'; -$lang->doc->errorEmptyLib = 'No data in document library.'; -$lang->doc->confirmUpdateContent = 'You have a document that is not saved from last time. Do you want to continue editing it?'; -$lang->doc->selectLibType = 'Please select a type of doc library.'; -$lang->doc->noLibreOffice = 'You does not have access to office conversion settings!'; -$lang->doc->errorParentChapter = 'The parent chapter cannot be its own chapter or sub chapter!'; -$lang->doc->errorOthersCreated = 'There are documents created by others in this library. You cannot move it.'; -$lang->doc->confirmLeaveOnEdit = 'Check that you have unsaved document content, do you want to continue?'; -$lang->doc->errorOccurred = 'An error occurred. Please try again later.'; -$lang->doc->selectLibFirst = 'Please select a lib first.'; -$lang->doc->createLibFirst = 'Please create a lib first.'; -$lang->doc->nopriv = 'You do not have access permissions for %s and cannot view this document. If you need to adjust permissions, please contact relevant personnel.'; -$lang->doc->docConvertComment = "This document has been converted to the new editor format. Switch to version %s to view the document before conversion."; -$lang->doc->previewNotAvailable = 'Preview function is not available. Please visit the Kanban board to view the document %s.'; +$lang->doc->confirmDelete = "Do you want to delete this document?"; +$lang->doc->confirmDeleteWithSub = "After deleting the document, the sub contents will be deleted simultaneously. Are you sure you want to delete this document?"; +$lang->doc->confirmDeleteLib = "Do you want to delete this document library?"; +$lang->doc->confirmDeleteSpace = "After deleting the space, the libraries, directories and documents in the space will be deleted simultaneously. Are you sure you want to delete this space?"; +$lang->doc->confirmDeleteBook = "Do you want to delete this book?"; +$lang->doc->confirmDeleteChapter = "Do you want to delete this chapter?"; +$lang->doc->confirmDeleteModule = "Do you want to delete this module?"; +$lang->doc->confirmDeleteModuleWithSub = "After deleting the module, the sub modules and documents will be deleted simultaneously. Are you sure you want to delete this module?"; +$lang->doc->confirmOtherEditing = "This document is currently editing. Continuing to edit will overwrite the content edited by others. Do you want to continue?"; +$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.'; +$lang->doc->noDoc = 'No documents. '; +$lang->doc->noArticle = 'No articles.'; +$lang->doc->noLib = 'No libraries.'; +$lang->doc->noBook = 'The Wiki library has not created a manual, please create a new one :)'; +$lang->doc->cannotCreateOffice = 'Sorry, %s file can only be created in ZenTao Biz Series or above. Contact Philip@easysoft.ltd to know more about ZenTao Biz Series and ZenTao Max Series.'; +$lang->doc->notSetOffice = "

To create a %s document, you need to configure Collabora Online.

"; +$lang->doc->requestTypeError = "The current requestType configuration is not PATH_INFO, cannot use the online editing. Please contact the administrator to modify the requestType configuration."; +$lang->doc->notSetCollabora = "Collabora Online is not set up, unable to create %s document. Please configure Collabora Online."; +$lang->doc->noSearchedDoc = 'No documents found.'; +$lang->doc->noEditedDoc = 'You have not edited any documents.'; +$lang->doc->noOpenedDoc = 'You have not created any documents.'; +$lang->doc->noCollectedDoc = 'You have not favorited any documents.'; +$lang->doc->errorEmptyLib = 'No data in document library.'; +$lang->doc->confirmUpdateContent = 'You have a document that is not saved from last time. Do you want to continue editing it?'; +$lang->doc->selectLibType = 'Please select a type of doc library.'; +$lang->doc->noLibreOffice = 'You does not have access to office conversion settings!'; +$lang->doc->errorParentChapter = 'The parent chapter cannot be its own chapter or sub chapter!'; +$lang->doc->errorOthersCreated = 'There are documents created by others in this library. You cannot move it.'; +$lang->doc->confirmLeaveOnEdit = 'Check that you have unsaved document content, do you want to continue?'; +$lang->doc->errorOccurred = 'An error occurred. Please try again later.'; +$lang->doc->selectLibFirst = 'Please select a lib first.'; +$lang->doc->createLibFirst = 'Please create a lib first.'; +$lang->doc->nopriv = 'You do not have access permissions for %s and cannot view this document. If you need to adjust permissions, please contact relevant personnel.'; +$lang->doc->docConvertComment = "This document has been converted to the new editor format. Switch to version %s to view the document before conversion."; +$lang->doc->previewNotAvailable = 'Preview function is not available. Please visit the Kanban board to view the document %s.'; $lang->doc->noticeAcl['lib']['product']['default'] = "Users who can access the selected {$lang->productCommon} can access it."; $lang->doc->noticeAcl['lib']['product']['custom'] = "Users who can access the selected {$lang->productCommon} or users in the whiltelist can access it."; @@ -539,10 +541,12 @@ $lang->doc->docLang->deleteDoc = $lang->doc->delete; $lang->doc->docLang->uploadDoc = $lang->doc->uploadDoc; $lang->doc->docLang->createList = $lang->doc->createList; $lang->doc->docLang->confirmDelete = $lang->doc->confirmDelete; +$lang->doc->docLang->confirmDeleteWithSub = $lang->doc->confirmDeleteWithSub; $lang->doc->docLang->confirmDeleteLib = $lang->doc->confirmDeleteLib; $lang->doc->docLang->confirmDeleteSpace = $lang->doc->confirmDeleteSpace; -$lang->doc->docLang->confirmDeleteChapter = $lang->doc->confirmDeleteChapter; $lang->doc->docLang->confirmDeleteModule = $lang->doc->confirmDeleteModule; +$lang->doc->docLang->confirmDeleteModuleWithSub = $lang->doc->confirmDeleteModuleWithSub; +$lang->doc->docLang->confirmDeleteChapter = $lang->doc->confirmDeleteChapter; $lang->doc->docLang->collect = $lang->doc->collect; $lang->doc->docLang->edit = $lang->doc->edit; $lang->doc->docLang->delete = $lang->doc->delete; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index 519e9f5baf..4c5b637f5c 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -404,45 +404,47 @@ $lang->doc->mail->edit = new stdclass(); $lang->doc->mail->releasedDoc->title = "%s released document #%s:%s"; $lang->doc->mail->edit->title = "%s edited document #%s:%s"; -$lang->doc->confirmDelete = "Voulez-vous supprimer ce document ?"; -$lang->doc->confirmDeleteLib = "Voulez-vous supprimer cette Bibliothèque ?"; -$lang->doc->confirmDeleteSpace = "Do you want to delete this space?"; -$lang->doc->confirmDeleteBook = "Do you want to delete this book?"; -$lang->doc->confirmDeleteChapter = "Do you want to delete this chapter?"; -$lang->doc->confirmDeleteModule = "After deleting the module, the sub modules and documents will be deleted simultaneously. Are you sure you want to delete this module?"; -$lang->doc->confirmOtherEditing = "This document is currently editing. Continuing to edit will overwrite the content edited by others. Do you want to continue?"; -$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."; -$lang->doc->noDoc = 'Aucun documents. '; -$lang->doc->noArticle = 'No articles.'; -$lang->doc->noLib = 'No libraries.'; -$lang->doc->noBook = 'The Wiki library has not created a manual, please create a new one :)'; -$lang->doc->cannotCreateOffice = 'Désolé, %s peut seulement être créé dans Série ZenTao Biz ou plus. Coordonnées Philip@easysoft.ltd En savoir plus sur les séries zentao biz et zentao Max.'; -$lang->doc->notSetOffice = "

To create a %s document, you need to configure Collabora Online.

"; -$lang->doc->requestTypeError = "The current requestType configuration is not PATH_INFO, cannot use the online editing. Please contact the administrator to modify the requestType configuration."; -$lang->doc->notSetCollabora = "Collabora Online is not set up, unable to create %s document. Please configure Collabora Online."; -$lang->doc->noSearchedDoc = 'Aucun documents trouvé.'; -$lang->doc->noEditedDoc = "Vous n'avez pas mis à jour de documents."; -$lang->doc->noOpenedDoc = "Vous n'avez pas ajouté de documents."; -$lang->doc->noCollectedDoc = "Vous avez aucun document dans vos favoris."; -$lang->doc->errorEmptyLib = 'No data in document library.'; -$lang->doc->confirmUpdateContent = 'You have a document that is not saved from last time. Do you want to continue editing it?'; -$lang->doc->selectLibType = 'Please select a type of doc library.'; -$lang->doc->noLibreOffice = 'You does not have access to office conversion settings!'; -$lang->doc->errorParentChapter = 'The parent chapter cannot be its own chapter or sub chapter!'; -$lang->doc->errorOthersCreated = 'There are documents created by others in this library. You cannot move it.'; -$lang->doc->confirmLeaveOnEdit = 'Vérifiez que vous avez du contenu de document non sauvegardé, voulez-vous continuer?'; -$lang->doc->errorOccurred = 'An error occurred. Please try again later.'; -$lang->doc->selectLibFirst = 'Please select a lib first.'; -$lang->doc->createLibFirst = 'Please create a lib first.'; -$lang->doc->nopriv = 'You do not have access permissions for %s and cannot view this document. If you need to adjust permissions, please contact relevant personnel.'; -$lang->doc->docConvertComment = "This document has been converted to the new editor format. Switch to version %s to view the document before conversion."; -$lang->doc->previewNotAvailable = 'Preview function is not available. Please visit the Kanban board to view the document %s.'; +$lang->doc->confirmDelete = "Voulez-vous supprimer ce document ?"; +$lang->doc->confirmDeleteWithSub = "After deleting the document, the sub contents will be deleted simultaneously. Are you sure you want to delete this document?"; +$lang->doc->confirmDeleteLib = "Voulez-vous supprimer cette Bibliothèque ?"; +$lang->doc->confirmDeleteSpace = "Do you want to delete this space?"; +$lang->doc->confirmDeleteBook = "Do you want to delete this book?"; +$lang->doc->confirmDeleteChapter = "Do you want to delete this chapter?"; +$lang->doc->confirmDeleteModule = "Do you want to delete this module?"; +$lang->doc->confirmDeleteModuleWithSub = "After deleting the module, the sub modules and documents will be deleted simultaneously. Are you sure you want to delete this module?"; +$lang->doc->confirmOtherEditing = "This document is currently editing. Continuing to edit will overwrite the content edited by others. Do you want to continue?"; +$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."; +$lang->doc->noDoc = 'Aucun documents. '; +$lang->doc->noArticle = 'No articles.'; +$lang->doc->noLib = 'No libraries.'; +$lang->doc->noBook = 'The Wiki library has not created a manual, please create a new one :)'; +$lang->doc->cannotCreateOffice = 'Désolé, %s peut seulement être créé dans Série ZenTao Biz ou plus. Coordonnées Philip@easysoft.ltd En savoir plus sur les séries zentao biz et zentao Max.'; +$lang->doc->notSetOffice = "

To create a %s document, you need to configure Collabora Online.

"; +$lang->doc->requestTypeError = "The current requestType configuration is not PATH_INFO, cannot use the online editing. Please contact the administrator to modify the requestType configuration."; +$lang->doc->notSetCollabora = "Collabora Online is not set up, unable to create %s document. Please configure Collabora Online."; +$lang->doc->noSearchedDoc = 'Aucun documents trouvé.'; +$lang->doc->noEditedDoc = "Vous n'avez pas mis à jour de documents."; +$lang->doc->noOpenedDoc = "Vous n'avez pas ajouté de documents."; +$lang->doc->noCollectedDoc = "Vous avez aucun document dans vos favoris."; +$lang->doc->errorEmptyLib = 'No data in document library.'; +$lang->doc->confirmUpdateContent = 'You have a document that is not saved from last time. Do you want to continue editing it?'; +$lang->doc->selectLibType = 'Please select a type of doc library.'; +$lang->doc->noLibreOffice = 'You does not have access to office conversion settings!'; +$lang->doc->errorParentChapter = 'The parent chapter cannot be its own chapter or sub chapter!'; +$lang->doc->errorOthersCreated = 'There are documents created by others in this library. You cannot move it.'; +$lang->doc->confirmLeaveOnEdit = 'Vérifiez que vous avez du contenu de document non sauvegardé, voulez-vous continuer?'; +$lang->doc->errorOccurred = 'An error occurred. Please try again later.'; +$lang->doc->selectLibFirst = 'Please select a lib first.'; +$lang->doc->createLibFirst = 'Please create a lib first.'; +$lang->doc->nopriv = 'You do not have access permissions for %s and cannot view this document. If you need to adjust permissions, please contact relevant personnel.'; +$lang->doc->docConvertComment = "This document has been converted to the new editor format. Switch to version %s to view the document before conversion."; +$lang->doc->previewNotAvailable = 'Preview function is not available. Please visit the Kanban board to view the document %s.'; $lang->doc->noticeAcl['lib']['product']['default'] = "Users who can access the selected {$lang->productCommon} can access it."; $lang->doc->noticeAcl['lib']['product']['custom'] = "Users who can access the selected {$lang->productCommon} or users in the whiltelist can access it."; @@ -539,9 +541,11 @@ $lang->doc->docLang->deleteDoc = $lang->doc->delete; $lang->doc->docLang->uploadDoc = $lang->doc->uploadDoc; $lang->doc->docLang->createList = $lang->doc->createList; $lang->doc->docLang->confirmDelete = $lang->doc->confirmDelete; +$lang->doc->docLang->confirmDeleteWithSub = $lang->doc->confirmDeleteWithSub; $lang->doc->docLang->confirmDeleteLib = $lang->doc->confirmDeleteLib; $lang->doc->docLang->confirmDeleteSpace = $lang->doc->confirmDeleteSpace; $lang->doc->docLang->confirmDeleteModule = $lang->doc->confirmDeleteModule; +$lang->doc->docLang->confirmDeleteModuleWithSub = $lang->doc->confirmDeleteModuleWithSub; $lang->doc->docLang->confirmDeleteChapter = $lang->doc->confirmDeleteChapter; $lang->doc->docLang->collect = $lang->doc->collect; $lang->doc->docLang->edit = $lang->doc->edit; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index c77dc97b8c..6b11e0ce2f 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -404,45 +404,47 @@ $lang->doc->mail->edit = new stdclass(); $lang->doc->mail->releasedDoc->title = "%s发布了文档 #%s:%s"; $lang->doc->mail->edit->title = "%s编辑了文档 #%s:%s"; -$lang->doc->confirmDelete = "您确定删除该文档吗?"; -$lang->doc->confirmDeleteLib = "您确定删除该文档库吗?"; -$lang->doc->confirmDeleteSpace = "删除空间后,同步删除空间下的库、目录和文档,确认要删除吗?"; -$lang->doc->confirmDeleteBook = "您确定删除该手册吗?"; -$lang->doc->confirmDeleteChapter = "您确定删除该章节吗?"; -$lang->doc->confirmDeleteModule = "删除目录后,同步删除目录下的子目录和文档,确认要删除吗?"; -$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 = '该版本文档不存在'; -$lang->doc->noDoc = '暂时没有文档。'; -$lang->doc->noArticle = '暂时没有文章。'; -$lang->doc->noLib = '暂时没有库。'; -$lang->doc->noBook = 'Wiki库还未创建手册,请新建 :)'; -$lang->doc->cannotCreateOffice = '

对不起,企业版才能创建%s文档。

试用企业版,请联系我们:4006-8899-23   0532-86893032。

'; -$lang->doc->notSetOffice = "创建 %s 文档,需要配置 Collabora Online。"; -$lang->doc->requestTypeError = "当前禅道 requestType 配置不是 PATH_INFO,无法使用 Collabora Online 在线编辑功能,请联系管理员修改 requestType 配置。"; -$lang->doc->notSetCollabora = "没有设置 Collabora Online,无法创建%s文档,请配置 Collabora Online。"; -$lang->doc->noSearchedDoc = '没有搜索到任何文档。'; -$lang->doc->noEditedDoc = '您还没有编辑任何文档。'; -$lang->doc->noOpenedDoc = '您还没有创建任何文档。'; -$lang->doc->noCollectedDoc = '您还没有收藏任何文档。'; -$lang->doc->errorEmptyLib = '文档库暂无数据。'; -$lang->doc->confirmUpdateContent = '检查到您有未保存的文档内容,是否继续编辑?'; -$lang->doc->selectLibType = '请选择文档库类型'; -$lang->doc->noLibreOffice = '您还没有office转换设置访问权限!'; -$lang->doc->errorParentChapter = '父章节不能是自身章节及子章节!'; -$lang->doc->errorOthersCreated = '该库下其他人创建的文档暂不支持移动,是否确认移动?'; -$lang->doc->confirmLeaveOnEdit = '检查到您有未保存的文档内容,是否继续跳转?'; -$lang->doc->errorOccurred = '操作失败,请稍后再试!'; -$lang->doc->selectLibFirst = '请先选择文档库。'; -$lang->doc->createLibFirst = '请先创建文档库。'; -$lang->doc->nopriv = '您暂无 %s 的访问权限,无法查看该文档,如需调整权限可联系相关人员处理。'; -$lang->doc->docConvertComment = "文档已经转换为新编辑器格式,切换版本 %s 来查看转换前的文档。"; -$lang->doc->previewNotAvailable = '预览功能暂不可用,请访问禅道查看文档 %s。'; +$lang->doc->confirmDelete = "您确定删除该文档吗?"; +$lang->doc->confirmDeleteWithSub = "删除文档后,将同步删除文档下的所有内容,确认要删除吗?"; +$lang->doc->confirmDeleteLib = "您确定删除该文档库吗?"; +$lang->doc->confirmDeleteSpace = "删除空间后,同步删除空间下的库、目录和文档,确认要删除吗?"; +$lang->doc->confirmDeleteBook = "您确定删除该手册吗?"; +$lang->doc->confirmDeleteChapter = "您确定删除该章节吗?"; +$lang->doc->confirmDeleteModule = "您确定删除该目录吗?"; +$lang->doc->confirmDeleteModuleWithSub = "删除目录后,同步删除目录下的子目录、章节和文档,确认要删除吗?"; +$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 = '该版本文档不存在'; +$lang->doc->noDoc = '暂时没有文档。'; +$lang->doc->noArticle = '暂时没有文章。'; +$lang->doc->noLib = '暂时没有库。'; +$lang->doc->noBook = 'Wiki库还未创建手册,请新建 :)'; +$lang->doc->cannotCreateOffice = '

对不起,企业版才能创建%s文档。

试用企业版,请联系我们:4006-8899-23   0532-86893032。

'; +$lang->doc->notSetOffice = "创建 %s 文档,需要配置 Collabora Online。"; +$lang->doc->requestTypeError = "当前禅道 requestType 配置不是 PATH_INFO,无法使用 Collabora Online 在线编辑功能,请联系管理员修改 requestType 配置。"; +$lang->doc->notSetCollabora = "没有设置 Collabora Online,无法创建%s文档,请配置 Collabora Online。"; +$lang->doc->noSearchedDoc = '没有搜索到任何文档。'; +$lang->doc->noEditedDoc = '您还没有编辑任何文档。'; +$lang->doc->noOpenedDoc = '您还没有创建任何文档。'; +$lang->doc->noCollectedDoc = '您还没有收藏任何文档。'; +$lang->doc->errorEmptyLib = '文档库暂无数据。'; +$lang->doc->confirmUpdateContent = '检查到您有未保存的文档内容,是否继续编辑?'; +$lang->doc->selectLibType = '请选择文档库类型'; +$lang->doc->noLibreOffice = '您还没有office转换设置访问权限!'; +$lang->doc->errorParentChapter = '父章节不能是自身章节及子章节!'; +$lang->doc->errorOthersCreated = '该库下其他人创建的文档暂不支持移动,是否确认移动?'; +$lang->doc->confirmLeaveOnEdit = '检查到您有未保存的文档内容,是否继续跳转?'; +$lang->doc->errorOccurred = '操作失败,请稍后再试!'; +$lang->doc->selectLibFirst = '请先选择文档库。'; +$lang->doc->createLibFirst = '请先创建文档库。'; +$lang->doc->nopriv = '您暂无 %s 的访问权限,无法查看该文档,如需调整权限可联系相关人员处理。'; +$lang->doc->docConvertComment = "文档已经转换为新编辑器格式,切换版本 %s 来查看转换前的文档。"; +$lang->doc->previewNotAvailable = '预览功能暂不可用,请访问禅道查看文档 %s。'; $lang->doc->noticeAcl['lib']['product']['default'] = "有所选{$lang->productCommon}访问权限的用户可以访问。"; $lang->doc->noticeAcl['lib']['product']['custom'] = "有所选{$lang->productCommon}访问权限或白名单里的用户可以访问。"; @@ -539,9 +541,11 @@ $lang->doc->docLang->deleteDoc = $lang->doc->delete; $lang->doc->docLang->uploadDoc = $lang->doc->uploadDoc; $lang->doc->docLang->createList = $lang->doc->createList; $lang->doc->docLang->confirmDelete = $lang->doc->confirmDelete; +$lang->doc->docLang->confirmDeleteWithSub = $lang->doc->confirmDeleteWithSub; $lang->doc->docLang->confirmDeleteLib = $lang->doc->confirmDeleteLib; $lang->doc->docLang->confirmDeleteSpace = $lang->doc->confirmDeleteSpace; $lang->doc->docLang->confirmDeleteModule = $lang->doc->confirmDeleteModule; +$lang->doc->docLang->confirmDeleteModuleWithSub = $lang->doc->confirmDeleteModuleWithSub; $lang->doc->docLang->confirmDeleteChapter = $lang->doc->confirmDeleteChapter; $lang->doc->docLang->collect = $lang->doc->collect; $lang->doc->docLang->edit = $lang->doc->edit; diff --git a/module/doc/model.php b/module/doc/model.php index 3a4548b3af..91f1b6045d 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -757,10 +757,15 @@ class docModel extends model $docs = arrayUnion($docs, $rootDocs); + $parentDocs = array(); $deletedDocs = array(); foreach($docs as $docID => $doc) { - if($doc->deleted == '0') continue; + if($doc->deleted == '0') + { + if($doc->parent) $parentDocs[$doc->parent] = $doc->parent; + continue; + } unset($docs[$docID]); $deletedDocs[$doc->id] = $doc->path; @@ -784,6 +789,7 @@ class docModel extends model $doc->deleted = boolval($doc->deleted); $doc->isCollector = strpos($doc->collector, ',' . $this->app->user->account . ',') !== false; $doc->title = htmlspecialchars_decode($doc->title); + $doc->isParent = isset($parentDocs[$doc->id]) ? true : false; if(!empty($doc->keywords) && is_string($doc->keywords)) $doc->keywords = htmlspecialchars_decode($doc->keywords); unset($doc->content); unset($doc->draft); @@ -2948,13 +2954,24 @@ class docModel extends model public function getModulesOfLibs(array $libs, $type = 'doc,api') { $types = explode(',', $type); - return $this->dao->select('*')->from(TABLE_MODULE) + $modules = $this->dao->select('*')->from(TABLE_MODULE) ->where('root')->in($libs) ->beginIF(count($types) > 1)->andWhere('type')->in($types)->fi() ->beginIF(count($types) == 1)->andWhere('type')->eq($type)->fi() - ->andWhere('deleted')->eq(0) + ->andWhere('deleted')->eq('0') ->orderBy('grade desc, `order`') ->fetchAll('id', false); + + $parentModules = $this->dao->select('module')->from(TABLE_DOC)->where('module')->in(array_keys($modules))->fetchPairs(); + foreach($modules as $module) + { + if(!$module->parent) continue; + $parentModules[$module->parent] = $module->parent; + } + + foreach($modules as $module) $module->isParent = isset($parentModules[$module->id]) ? true : false; + + return $modules; } /**