Skip to content

Commit

Permalink
Change email to entity reference
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Apr 1, 2020
1 parent 7102ef5 commit 4e08a5f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions CRM/Contact/Form/Task/EmailTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public function buildQuickForm() {
];
$to = $this->add('text', 'to', ts('To'), $emailAttributes, TRUE);
$cc = $this->add('text', 'cc_id', ts('CC'), $emailAttributes);
$bcc = $this->add('text', 'bcc_id', ts('BCC'), $emailAttributes);

// $bcc = $this->add('text', 'bcc_id', ts('BCC'), $emailAttributes);

This comment has been minimized.

Copy link
@eileenmcnaughton

eileenmcnaughton Apr 1, 2020

Author Contributor

@mepps I just commented this out because so far it's experimental - per the comment on the main thread I wasn't 100% happy with the entity ref results as yet

$this->addEntityRef('bcc_id', ts('BCC'), ['entity' => 'Contact', 'multiple' => TRUE, 'api'=> ['params' => ['on_hold' => 0, 'do_not_email' => 0, 'email' => ['LIKE' => '%']]]]);
$setDefaults = TRUE;
if (property_exists($this, '_context') && $this->_context === 'standalone') {
$setDefaults = FALSE;
Expand All @@ -183,13 +183,6 @@ public function buildQuickForm() {
}
}

if ($bcc->getValue()) {
foreach ($this->getEmails($bcc) as $value) {
if (!empty($value['contact_id'])) {
$this->_bccContactIds[] = $value['contact_id'];
}
}
}
$this->_allContactIds = array_unique(array_merge($this->_contactIds, $this->_ccContactIds, $this->_bccContactIds));
$setDefaults = empty($this->_allContactIds) ? $setDefaults: TRUE;

Expand Down
2 changes: 1 addition & 1 deletion templates/CRM/Contact/Form/Task/Email.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ CRM.$(function($) {
{literal}
emailSelect('#to', toContact);
emailSelect('#cc_id', ccContact);
emailSelect('#bcc_id', bccContact);
//emailSelect('#bcc_id', bccContact);
});
Expand Down

0 comments on commit 4e08a5f

Please sign in to comment.