From 7cb329d01533f2a6a3ef7de0cbfedb4d350b922d Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 7 Jan 2025 18:09:43 +0800 Subject: [PATCH] * [bug #58920] add doc exporting button to doc detail in quick view. --- module/doc/js/quick.ui.js | 14 ++++++++++++++ module/doc/ui/quick.html.php | 2 ++ 2 files changed, 16 insertions(+) diff --git a/module/doc/js/quick.ui.js b/module/doc/js/quick.ui.js index a0fb822727..247e4101d3 100644 --- a/module/doc/js/quick.ui.js +++ b/module/doc/js/quick.ui.js @@ -77,3 +77,17 @@ window.docAppActions.doc = function(info) } return actions; }; + +window.docAppCommands.exportWord = function(_, args) +{ + const docApp = getDocApp(); + const docID = args[2] || docApp.docID; + const doc = docID ? docApp.getDoc(docID) : null; + if(!doc || !doc.objectType) return; + + const moduleID = args[1] || docApp.moduleID; + const libID = doc.libInfo ? doc.libInfo.id : (args[0] || docApp.libID); + const type = doc.objectType || doc.object.type; + const url = $.createLink('doc', `${type}2export`, `libID=${libID}&moduleID=${moduleID}&docID=${docID}`); + window.open(url, '_self'); +}; diff --git a/module/doc/ui/quick.html.php b/module/doc/ui/quick.html.php index 39eb373942..d59f69d93f 100644 --- a/module/doc/ui/quick.html.php +++ b/module/doc/ui/quick.html.php @@ -17,6 +17,8 @@ $privs['moveDoc'] = hasPriv('doc', 'moveDoc'); $privs['collect'] = hasPriv('doc', 'collect'); $privs['batchMoveDoc'] = hasPriv('doc', 'batchMoveDoc'); $privs['view'] = hasPriv('doc', 'view'); +$privs['exportDoc'] = $this->config->edition != 'open' && hasPriv('doc', $type . '2export'); +$privs['exportApi'] = $this->config->edition != 'open' && hasPriv('api', 'export'); $spaceID = 1; $libID = $menu['id'];