diff --git a/module/doc/js/app.ui.js b/module/doc/js/app.ui.js index 46d2beb757..779646086d 100644 --- a/module/doc/js/app.ui.js +++ b/module/doc/js/app.ui.js @@ -52,7 +52,6 @@ function processDocAppAction(action, docApp) if(typeof action === 'string') { - action = {call: action}; } if(Array.isArray(action)) @@ -607,6 +606,14 @@ function getActions(type, info) */ const commands = { + /* 创建文档。 Create doc. */ + startCreateDoc: function() + { + const docApp = getDocApp(); + if(!docApp.libList.length) return zui.Modal.alert(getLang('createLibFirst')); + if(!docApp.libID) return zui.Modal.alert(getLang('selectLibFirst')); + docApp.startCreateDoc(); + }, /** 上传文档。Upload Doc. */ uploadDoc: function() { diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index 63534a6829..79c61a2099 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -367,6 +367,8 @@ $lang->doc->errorParentChapter = 'The parent chapter cannot be its own 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->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."; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index bcd7b8bcf4..f93a961232 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -367,6 +367,8 @@ $lang->doc->errorParentChapter = '父章节不能是自身章节及子章节 $lang->doc->errorOthersCreated = '该库下其他人创建的文档暂不支持移动,是否确认移动?'; $lang->doc->confirmLeaveOnEdit = '检查到您有未保存的文档内容,是否继续跳转?'; $lang->doc->errorOccurred = '操作失败,请稍后再试!'; +$lang->doc->selectLibFirst = '请先选择文档库。'; +$lang->doc->createLibFirst = '请先创建文档库。'; $lang->doc->noticeAcl['lib']['product']['default'] = "有所选{$lang->productCommon}访问权限的用户可以访问。"; $lang->doc->noticeAcl['lib']['product']['custom'] = "有所选{$lang->productCommon}访问权限或白名单里的用户可以访问。"; diff --git a/module/doc/ui/app.html.php b/module/doc/ui/app.html.php index 221756ee4e..51027f2ab7 100644 --- a/module/doc/ui/app.html.php +++ b/module/doc/ui/app.html.php @@ -115,6 +115,8 @@ $langData->sortCatalog = $lang->doc->sortCatalog; $langData->sortDoclib = $lang->doc->sortDoclib; $langData->sortDoc = $lang->doc->sortDoc; $langData->errorOccurred = $lang->doc->errorOccurred; +$langData->selectLibFirst = $lang->doc->selectLibFirst; +$langData->createLibFirst = $lang->doc->createLibFirst; /** * 通过语言项定义文档表格列显示名称。