Mail: Multiple attachments changes

- Offer to open in Collabora any file, not just editable (PDF)
- Put collabora option first in the option list if user prefers to open in collabora
- Change label to "Open with Collabora Office" with translation from Birgit
This commit is contained in:
nathan 2023-02-09 10:39:12 -07:00
parent 1387988eff
commit bf764df720
4 changed files with 27 additions and 3 deletions

View File

@ -545,6 +545,24 @@ egw.extend('links', egw.MODULE_GLOBAL, function()
return false;
}
return ['edit'].indexOf(fe.mime[mime].name) !== -1;
},
/**
* Check if a mimetype is openable in Collabora
* (without needing to have Collabora JS loaded)
*
* @param mime
*
* @return string|false
*/
isCollaborable: function (mime)
{
// Additional check to see if Collabora can open the file at all, not just edit it
let fe = this.file_editor_prefered_mimes(mime);
if (fe && fe.mime && fe.mime[mime] && fe.mime[mime].name || this.isEditable(mime))
{
return fe.mime[mime].name;
}
}
}
});

View File

@ -1127,7 +1127,7 @@ app.classes.mail = AppJS.extend(
];
const collabora = {
id: 'collabora',
label: 'Open',
label: 'Open with Collabora Office',
icon: 'collabora/navbar',
value: 'collabora'
};
@ -1139,14 +1139,18 @@ app.classes.mail = AppJS.extend(
// for some reason label needs to be set explicitly for the dropdown button. It needs more investigation.
_item.actionsDefaultLabel = 'Download';
if (typeof this.egw.user('apps')['collabora'] !== "undefined" && this.egw.isEditable(_item.type))
if (typeof this.egw.user('apps')['collabora'] !== "undefined" && this.egw.isCollaborable(_item.type))
{
// Start with download on top, Collabora on bottom
sel_options.attachmentsBlock[_item.attachment_number + "[actions]"] = [...actions, collabora];
if (egw.preference('document_doubleclick_action', 'filemanager') === 'collabora')
{
_item.actions = 'collabora';
_item.actionsDefaultLabel = 'Collabora';
// Put Collabora on top
sel_options.attachmentsBlock[_item.attachment_number + "[actions]"] = [collabora, ...actions];
}
sel_options.attachmentsBlock[_item.attachment_number + "[actions]"] = [...actions, collabora];
}
});

View File

@ -414,6 +414,7 @@ only one window mail de nur ein einziges Fenster
only send message, do not copy a version of the message to the configured sent folder mail de Versende Nachricht, kopiere sie nicht in den konfigurierten Gesendet Ordner
open in html mode mail de In HTML-Modus öffnen
open in text mode mail de In Text-Modus öffnen
open with collabora office mail de Mit Collabora Online öffnen
organisation admin de Organisation
organization mail de Organisation
original message mail de ursprüngliche Nachricht

View File

@ -414,6 +414,7 @@ only one window mail en only one window
only send message, do not copy a version of the message to the configured sent folder mail en only send message, do not copy a version of the message to the configured sent folder
open in html mode mail en Open in HTML mode
open in text mode mail en Open in Text mode
open with collabora office mail en Open with Collabora Office
organisation admin en organisation
organization mail en organization
original message mail en original message