diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index aff9afd69d..444a9b3bef 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2638,8 +2638,10 @@ $filter['before']= date("d-M-Y", $cutoffdate2); if (empty($attachmentHTML[$key]['mime_data'])) { $attachmentHTML[$key]['mime_url'] = Egw::link('/index.php',$linkData); - // always check invoices too and then add mime_data unconditionally - if (Link::get_mime_info($attachmentHTML[$key]['type'], 'invoices')) + + // always check invoices (or it's EPL viewer) too and then add mime_data unconditionally + if (Link::get_mime_info($attachmentHTML[$key]['type'], + !empty($GLOBALS['egw_info']['user']['apps']['invoices']) ? 'invoices' : 'stylite')) { $attachmentHTML[$key]['mime_data'] = Link::set_data($value['mimeType'], 'EGroupware\\Api\\Mail::getAttachmentAccount', [$acc_id, $mailbox, $uid, $value['partID'], $value['is_winmail'] ?? false, true], true); diff --git a/mail/js/app.js b/mail/js/app.js index 337b09dded..a2dc8a052a 100755 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -1265,14 +1265,15 @@ app.classes.mail = AppJS.extend( sel_options.attachmentsBlock[_item.attachment_number + "[actions]"] = [collabora, ...actions]; } } - // if mime-type is supported by invoices, add it at the end - if (egw.get_mime_info(_item.type, 'invoices')) + // if mime-type is supported by invoices (or the EPL viewer), add it at the end + const invoices_app = this.egw.user('apps')['invoices'] ? 'invoices' : 'stylite'; + if (egw.get_mime_info(_item.type, invoices_app)) { sel_options.attachmentsBlock[_item.attachment_number + "[actions]"] = [...actions, { - id: 'invoices', + id: invoices_app, label: 'invoices', icon: 'invoices/navbar', - value: 'invoices' + value: invoices_app }]; } });