mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-07 05:50:13 +01:00
* Mail: allow to select (multiple) mail addresses from addressbook directly in compose window
This commit is contained in:
parent
02da5f8c2c
commit
87ce283610
@ -1132,20 +1132,27 @@ class AddressbookApp extends EgwApp
|
||||
}
|
||||
|
||||
/**
|
||||
* Onclick of "addressbook.select" template for [To], [Cc] or [Bcc] button
|
||||
* Onclick of "addressbook.select" template for [To], [Cc] or [Bcc] button or et2-description for email(_home)
|
||||
*
|
||||
* @param _event
|
||||
* @param _widget
|
||||
*/
|
||||
addEmailToCompose(_event, _widget)
|
||||
{
|
||||
// if email is clicked, we need to let the event bubble first, so NM selects the row
|
||||
if (_widget.nodeName === 'ET2-DESCRIPTION' && _event)
|
||||
{
|
||||
window.setTimeout(() => this.addEmailToCompose(null, _widget), 0);
|
||||
return false;
|
||||
}
|
||||
const et2 = etemplate2.getByTemplate('addressbook.select')[0]?.widgetContainer;
|
||||
const nm = et2?.getWidgetById('nm');
|
||||
const what_to_use = et2?.getWidgetById('what_to_use')?.value;
|
||||
const selection = nm?.getSelection();
|
||||
this.addEmail({ id: _widget.id}, selection.ids.map((uid) => {
|
||||
this.addEmail({ id: _widget.nodeName === 'ET2-DESCRIPTION' ? 'add_to_to' : _widget.id}, selection.ids.map((uid) => {
|
||||
return {id: uid};
|
||||
}), nm, what_to_use || "business-or-home", window.app.mail.setCompose.bind(window.app.mail));
|
||||
}), nm, _widget.nodeName === 'ET2-DESCRIPTION' ? (_widget.id.endsWith('[email]') ? 'business' : 'home') :
|
||||
what_to_use || "business-or-home", window.app.mail.setCompose.bind(window.app.mail));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -79,11 +79,13 @@ browser location addressbook de Browser-Standort
|
||||
business common de Geschäftlich
|
||||
business address addressbook de Geschäftsadresse
|
||||
business address line 2 addressbook de Straße Zeile 2 geschäftlich
|
||||
business and home email addressbook de Geschäfts- und Privat-Email
|
||||
business city addressbook de Stadt geschäftlich
|
||||
business country addressbook de Land geschäftlich
|
||||
business country code addressbook de Ländervorwahl geschäftlich
|
||||
business email addressbook de E-Mail geschäftlich
|
||||
business fax addressbook de Fax geschäftlich
|
||||
business or home email addressbook de Geschäfts- oder Privat-Email
|
||||
business phone addressbook de Tel. geschäftlich
|
||||
business state addressbook de Bundesland geschäftlich
|
||||
business street addressbook de Straße geschäftlich
|
||||
|
@ -79,11 +79,13 @@ browser location addressbook en Browser location
|
||||
business common en Business
|
||||
business address addressbook en Business address
|
||||
business address line 2 addressbook en Business address line 2
|
||||
business and home email addressbook en Business and home email
|
||||
business city addressbook en Business city
|
||||
business country addressbook en Business country
|
||||
business country code addressbook en Business country code
|
||||
business email addressbook en Business email
|
||||
business fax addressbook en Business fax
|
||||
business or home email addressbook en Business or home email
|
||||
business phone addressbook en Business phone
|
||||
business state addressbook en Business state
|
||||
business street addressbook en Business street
|
||||
|
@ -81,8 +81,10 @@
|
||||
</et2-vbox>
|
||||
|
||||
<et2-vbox>
|
||||
<et2-url-email id="${row}[email]" readonly="true" class="fixedHeight" emailDisplay="email"></et2-url-email>
|
||||
<et2-url-email id="${row}[email_home]" readonly="true" class="fixedHeight" emailDisplay="email"></et2-url-email>
|
||||
<et2-description id="${row}[email]" readonly="true" class="fixedHeight" emailDisplay="email"
|
||||
onclick="app.addressbook.addEmailToCompose"></et2-description>
|
||||
<et2-description id="${row}[email_home]" readonly="true" class="fixedHeight" emailDisplay="email"
|
||||
onclick="app.addressbook.addEmailToCompose"></et2-description>
|
||||
</et2-vbox>
|
||||
</row>
|
||||
</rows>
|
||||
@ -95,17 +97,18 @@
|
||||
<option value="">Business or home email</option>
|
||||
<option value="email">Business email</option>
|
||||
<option value="email_home">Home email</option>
|
||||
<option value="both">Business and home email</option>
|
||||
</et2-select>
|
||||
<et2-button label="To" id="add_to_to" onclick="app.addressbook.addEmailToCompose" image="forward-fill"></et2-button>
|
||||
<et2-button label="Cc" id="add_to_cc" onclick="app.addressbook.addEmailToCompose" image="forward-fill"></et2-button>
|
||||
<et2-button label="Bcc" id="add_to_bcc" onclick="app.addressbook.addEmailToCompose" image="forward-fill"></et2-button>
|
||||
<et2-button label="Close" id="close" onclick="alert('ToDo ;)'); return false;"></et2-button>
|
||||
<et2-button label="Close" id="close" onclick="document.querySelector('et2-dialog').close(); return false;"></et2-button>
|
||||
</et2-hbox>
|
||||
<styles>
|
||||
#addressbook-select > et2-template::part(base) { display: flex; flex-direction: column;}
|
||||
div.dialog_content img.dialog_icon[src=""] { display: none; }
|
||||
et2-dialog#dialog-addressbook-select et2-button { max-width: 125px !important; }
|
||||
et2-dialog#dialog-addressbook-select::part(panel) { width: 90vh; height: 75vh; position: absolute; bottom: 1vh; }
|
||||
et2-dialog#dialog-addressbook-select::part(panel) { width: 90vh; height: 70vh; position: absolute; bottom: 1vh; }
|
||||
et2-hbox.footer { border-top: 2px solid #696969; padding-top: 10px; }
|
||||
</styles>
|
||||
</template>
|
||||
|
@ -682,7 +682,6 @@ export class et2_toolbar extends et2_DOMWidget implements et2_IInput
|
||||
|
||||
if (action.caption)
|
||||
{
|
||||
if (!egwIsMobile()) widget.statustext = action.caption;
|
||||
if ((this.countActions <= parseInt(this.view_range) ||
|
||||
this.preference[action.id] || !action.iconUrl) &&
|
||||
!(isCheckbox && isToggleSwitch)) // no caption for slideswitch checkboxes
|
||||
@ -690,6 +689,7 @@ export class et2_toolbar extends et2_DOMWidget implements et2_IInput
|
||||
widget.classList.add(action.iconUrl ? 'et2_toolbar_hasCaption' : 'et2_toolbar_onlyCaption');
|
||||
}
|
||||
}
|
||||
if ((action.hint || action.caption) && !egwIsMobile()) widget.statustext = action.hint || action.caption;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -189,6 +189,14 @@ class mail_compose
|
||||
'hint' => 'check to save as calendar event on send',
|
||||
'onExecute' => 'javaScript:app.mail.compose_setToggle'
|
||||
),
|
||||
'addressbook' => array(
|
||||
'caption' => 'Addressbook',
|
||||
'icon' => 'addressbook/navbar',
|
||||
'group' => $group,
|
||||
'hint' => 'Select mail addresses from addressbook',
|
||||
'onExecute' => 'javaScript:app.mail.addressbookSelect',
|
||||
'toolbarDefault' => false,
|
||||
),
|
||||
'disposition' => array(
|
||||
'caption' => 'Notification',
|
||||
'icon' => 'notification',
|
||||
|
@ -6444,19 +6444,24 @@ app.classes.mail = AppJS.extend(
|
||||
}
|
||||
},
|
||||
|
||||
addAttachmentPlaceholder: function ()
|
||||
addAttachmentPlaceholder: function ()
|
||||
{
|
||||
if (this.et2.getArrayMgr("content").getEntry("is_html"))
|
||||
{
|
||||
if (this.et2.getArrayMgr("content").getEntry("is_html"))
|
||||
{
|
||||
// Add link placeholder box
|
||||
const email = this.et2.getWidgetById("mail_htmltext");
|
||||
const attach_type = this.et2.getWidgetById("filemode");
|
||||
const placeholder = '<fieldset class="attachments mceNonEditable"><legend>Download attachments</legend>' + this.egw.lang('Attachments') + '</fieldset>';
|
||||
// Add link placeholder box
|
||||
const email = this.et2.getWidgetById("mail_htmltext");
|
||||
const attach_type = this.et2.getWidgetById("filemode");
|
||||
const placeholder = '<fieldset class="attachments mceNonEditable"><legend>Download attachments</legend>' + this.egw.lang('Attachments') + '</fieldset>';
|
||||
|
||||
if (email && !email.getValue().includes(placeholder) && attach_type.getValue() !== "attach")
|
||||
{
|
||||
email.editor.execCommand('mceInsertContent', false, placeholder);
|
||||
}
|
||||
if (email && !email.getValue().includes(placeholder) && attach_type.getValue() !== "attach")
|
||||
{
|
||||
email.editor.execCommand('mceInsertContent', false, placeholder);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addressbookSelect: function()
|
||||
{
|
||||
this.openDialog('addressbook.addressbook_ui.index&template=addressbook.select');
|
||||
}
|
||||
});
|
@ -1,4 +1,5 @@
|
||||
%1 attachments mail de %1 Anhänge
|
||||
%1 for all users mail de %1 für alle Benutzer
|
||||
%1 has been added to blacklisted email addresses mail de %1 wurde als E-Mail-Adresse zur Blacklist hinzugefügt
|
||||
%1 has been added to whiltelisted email addresses mail de %1 wurde als E-Mail-Adresse zur Whitelist hinzugefügt
|
||||
%1 has been removed from blacklisted email addresses mail de %1 wurde als E-Mail-Adresse von der Blacklist entfernt
|
||||
@ -544,6 +545,7 @@ select file to attach to message mail de Wählen Sie die Dateien aus, die Sie an
|
||||
select file to import into folder mail de Wählen Sie ein E-Mail als Datei aus, damit Sie in ein Ordner importiert werden kann.
|
||||
select file(s) from vfs mail de Dateien aus dem EGroupware Dateimanager anhängen.
|
||||
select files to upload mail de Dateien anhängen
|
||||
select mail addresses from addressbook mail de Email Adressen aus dem Adressbuch auswählen
|
||||
select multiple mail de Mehrfachauswahl
|
||||
select or insert email address mail de Wählen oder fügen Sie eine E-Mail-Adresse ein
|
||||
selected mail de ausgewählt
|
||||
|
@ -545,6 +545,7 @@ select file to attach to message mail en Select file to attach to message
|
||||
select file to import into folder mail en Select file to import into folder
|
||||
select file(s) from vfs mail en Select file(s) from VFS
|
||||
select files to upload mail en Select files to upload
|
||||
select mail addresses from addressbook mail en Select mail addresses from addressbook
|
||||
select multiple mail en Select multiple
|
||||
select or insert email address mail en Select or insert email address
|
||||
selected mail en selected
|
||||
|
@ -69,11 +69,7 @@
|
||||
</et2-dropdown>
|
||||
<et2-email id="to" width="100%" onclick="app.mail.address_click" autofocus="true"
|
||||
onchange="app.mail.recipients_onchange"
|
||||
placeholder="select or insert email address" includeLists="true" allowPlaceholder="true">
|
||||
<et2-button-icon image="addressbook/navbar" statustext="click to select in addressbook"
|
||||
onclick="app.mail.openDialog('addressbook.addressbook_ui.index&template=addressbook.select')"
|
||||
slot="suffix"></et2-button-icon>
|
||||
</et2-email>
|
||||
placeholder="select or insert email address" includeLists="true" allowPlaceholder="true"></et2-email>
|
||||
</row>
|
||||
<row class="mailComposeHeaders mailComposeJQueryCc">
|
||||
<et2-description value="Cc"></et2-description>
|
||||
|
Loading…
Reference in New Issue
Block a user