forked from extern/egroupware
Mail: Only add attachment action to open in Collabora for files that should be opened in Collabora
This commit is contained in:
parent
e397e43c1b
commit
933d13c8b2
@ -1125,24 +1125,27 @@ app.classes.mail = AppJS.extend(
|
||||
value: 'downloadAllToZip'
|
||||
}
|
||||
];
|
||||
if (typeof this.egw.user('apps')['collabora'] !== "undefined")
|
||||
{
|
||||
actions.push({
|
||||
id: 'collabora',
|
||||
label: 'Open',
|
||||
icon: 'collabora/navbar',
|
||||
value: 'collabora'
|
||||
});
|
||||
}
|
||||
const collabora = {
|
||||
id: 'collabora',
|
||||
label: 'Open',
|
||||
icon: 'collabora/navbar',
|
||||
value: 'collabora'
|
||||
};
|
||||
data.attachmentsBlockTitle = `${data.attachmentsBlock.length} attachments`;
|
||||
sel_options.attachmentsBlock = {};
|
||||
data.attachmentsBlock.forEach(_item =>
|
||||
{
|
||||
_item.actions = 'downloadOneAsFile';
|
||||
// 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))
|
||||
{
|
||||
sel_options.attachmentsBlock[_item.attachment_number + "[actions]"] = [...actions, collabora];
|
||||
}
|
||||
});
|
||||
|
||||
sel_options.attachmentsBlock = {actions: actions};
|
||||
sel_options.attachmentsBlock.actions = actions;
|
||||
}
|
||||
|
||||
mailPreview.set_value({content:data, sel_options:sel_options});
|
||||
|
Loading…
Reference in New Issue
Block a user