From 9d5ddc84e2ebb8ae868bd08cdbeb970774f9ec05 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Thu, 8 Feb 2018 14:24:05 +0100 Subject: [PATCH] * Filemanager: Add an user preference for being able to chose whether opening a merge print document should download it or open it with collabora editor --- api/src/Storage/Merge.php | 3 ++- filemanager/inc/class.filemanager_hooks.inc.php | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/api/src/Storage/Merge.php b/api/src/Storage/Merge.php index 6e9df572c7..85d41edfdf 100644 --- a/api/src/Storage/Merge.php +++ b/api/src/Storage/Merge.php @@ -1874,7 +1874,8 @@ abstract class Merge try { if (class_exists('EGroupware\\collabora\\Bo') && $GLOBALS['egw_info']['user']['apps']['collabora'] && - $discovery = \EGroupware\collabora\Bo::discover() + ($discovery = \EGroupware\collabora\Bo::discover()) && + $GLOBALS['egw_info']['user']['preferences']['filemanager']['merge_open_handler'] != 'download' ) { $editable_mimes = $discovery; diff --git a/filemanager/inc/class.filemanager_hooks.inc.php b/filemanager/inc/class.filemanager_hooks.inc.php index 8654654552..83cd922f26 100644 --- a/filemanager/inc/class.filemanager_hooks.inc.php +++ b/filemanager/inc/class.filemanager_hooks.inc.php @@ -261,6 +261,14 @@ class filemanager_hooks 'values' => array_combine(array_keys($editorLink['mime']), array_keys($editorLink['mime'])), 'default' => '', ), + 'merge_open_handler' => array( + 'type' => 'select', + 'label' => lang('Merge print open handler'), + 'help' => lang('Defines how to open a merge print documents'), + 'name' => 'merge_open_handler', + 'values' => array ('download' => lang('download'), 'collabora' => 'Collabora'), + 'default' => 'collabora', + ) ); return $settings;