* [bug #58920] add doc exporting button to doc detail in quick view.

This commit is contained in:
sunhao
2025-01-08 08:33:56 +08:00
committed by 丁永亮
parent 6b127065c2
commit 7cb329d015
2 changed files with 16 additions and 0 deletions
+14
View File
@@ -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');
};
+2
View File
@@ -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'];