diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php
index c7a0632969..86b52ae1e6 100644
--- a/mail/inc/class.mail_hooks.inc.php
+++ b/mail/inc/class.mail_hooks.inc.php
@@ -792,19 +792,13 @@ class mail_hooks
*/
public static function attachmentsBlockActions()
{
- return [
+ $actions = [
'downloadOneAsFile' => [
'id' => 'downloadOneAsFile',
'label' => 'Download',
'icon' => 'fileexport',
'value' => 'downloadOneAsFile'
],
- 'collabora' => [
- 'id' => 'collabora',
- 'label' => 'Open with Collabora',
- 'icon' => 'open',
- 'value' => 'collabora'
- ],
'saveOneToVfs' => [
'id' => 'saveOneToVfs',
'label' => 'Save in Filemanager',
@@ -824,5 +818,15 @@ class mail_hooks
'value' => 'downloadAllToZip'
]
];
+ if (file_exists(EGW_SERVER_ROOT.'/collabora'))
+ {
+ $actions['collabora'] = [
+ 'id' => 'collabora',
+ 'label' => 'Open with Collabora',
+ 'icon' => 'open',
+ 'value' => 'collabora'
+ ];
+ }
+ return $actions;
}
}
diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php
index 89f15be64c..ea9c9fe0f5 100644
--- a/mail/inc/class.mail_ui.inc.php
+++ b/mail/inc/class.mail_ui.inc.php
@@ -2525,7 +2525,8 @@ $filter['before']= date("d-M-Y", $cutoffdate2);
$attachmentHTML[$key]['mail_id'] = $rowID;
$attachmentHTML[$key]['winmailFlag']=$value['is_winmail'];
$attachmentHTML[$key]['smime_type'] = $value['smime_type'];
- $attachmentHTML[$key]['actions'] = 'downloadOneAsFile';
+ $attachmentHTML[$key]['actions'] = $GLOBALS['egw_info']['user']['preferences']['filemanager']['document_doubleclick_action'] === 'collabora' ?
+ 'collabora' : 'downloadOneAsFile';
$attachmentHTML[$key]['actionsDefaultLabel'] = 'Download';
// reset mode array as it should be considered differently for
diff --git a/mail/js/app.js b/mail/js/app.js
index 03e58466d7..163a5673e9 100644
--- a/mail/js/app.js
+++ b/mail/js/app.js
@@ -1141,6 +1141,11 @@ app.classes.mail = AppJS.extend(
if (typeof this.egw.user('apps')['collabora'] !== "undefined" && this.egw.isEditable(_item.type))
{
+ if (egw.preference('document_doubleclick_action', 'filemanager') === 'collabora')
+ {
+ _item.actions = 'downloadOneAsFile';
+ _item.actionsDefaultLabel = 'Collabora';
+ }
sel_options.attachmentsBlock[_item.attachment_number + "[actions]"] = [...actions, collabora];
}
});
diff --git a/mail/templates/default/index.xet b/mail/templates/default/index.xet
index f59015cd5b..cab1ab1868 100644
--- a/mail/templates/default/index.xet
+++ b/mail/templates/default/index.xet
@@ -60,7 +60,7 @@
-
+
@@ -70,7 +70,8 @@
-
+
+