if (header.cc) {
$('cc').setValue(header.cc);
}
- if (DIMP.conf_compose.cc) {
+ if (DIMP.conf_compose.cc || header.cc) {
this.toggleCC('cc', true);
}
this.setPopdownLabel('sm', identity.id.smf_name, identity.id.smf_display);
}
$('bcc').setValue(bcc_add + identity.id.bcc);
}
- if (DIMP.conf_compose.bcc) {
+ if (DIMP.conf_compose.bcc || header.bcc) {
this.toggleCC('bcc', true);
}
$('subject').setValue(header.subject);
// Add date
[ $('msgHeadersColl').select('.date'), $('msgHeaderDate').select('.date') ].flatten().invoke('update', r.localdate);
- // Add from/to/cc headers
- [ 'from', 'to', 'cc' ].each(function(a) {
+ // Add from/to/cc/bcc headers
+ [ 'from', 'to', 'cc', 'bcc' ].each(function(a) {
if (r[a]) {
(a == 'from' ? pm.select('.' + a) : [ t.down('.' + a) ]).each(function(elt) {
elt.replace(DimpCore.buildAddressLinks(r[a], elt.clone(false)));
*/
protected function _dimpComposeSetup()
{
+ global $injector, $notification, $prefs;
+
$result = new stdClass;
$result->action = $this->_action;
$result->success = 1;
/* Set up identity. */
- $identity = $GLOBALS['injector']->getInstance('IMP_Identity');
+ $identity = $injector->getInstance('IMP_Identity');
if (isset($this->_vars->identity) &&
- !$GLOBALS['prefs']->isLocked('default_identity')) {
+ !$prefs->isLocked('default_identity')) {
$identity->setDefault($this->_vars->identity);
}
try {
$headers['from'] = $identity->getFromLine(null, $this->_vars->from);
} catch (Horde_Exception $e) {
- $GLOBALS['notification']->push($e);
+ $notification->push($e);
$result->success = 0;
return array($result);
}
- $imp_ui = $GLOBALS['injector']->getInstance('IMP_Ui_Compose');
+ $imp_ui = $injector->getInstance('IMP_Ui_Compose');
$headers['to'] = $imp_ui->getAddressList($this->_vars->to);
- if ($GLOBALS['prefs']->getValue('compose_cc')) {
+ if ($prefs->getValue('compose_cc') ||
+ !$prefs->isLocked('compose_cc')) {
$headers['cc'] = $imp_ui->getAddressList($this->_vars->cc);
}
- if ($GLOBALS['prefs']->getValue('compose_bcc')) {
+ if ($prefs->getValue('compose_bcc') ||
+ !$prefs->isLocked('compose_bcc')) {
$headers['bcc'] = $imp_ui->getAddressList($this->_vars->bcc);
}
$headers['subject'] = $this->_vars->subject;
- $imp_compose = $GLOBALS['injector']->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->composeCache);
+ $imp_compose = $injector->getInstance('IMP_Injector_Factory_Compose')->create($this->_vars->composeCache);
return array($result, $imp_compose, $headers, $identity);
}
* done to them. */
$basic_headers = $imp_ui->basicHeaders();
if (empty($args['headers'])) {
- $args['headers'] = array('from', 'date', 'to', 'cc');
+ $args['headers'] = array('from', 'date', 'to', 'cc', 'bcc');
}
$headers_list = array_intersect_key($basic_headers, array_flip($args['headers']));
/* Build From/To/Cc/Bcc/Reply-To links. */
foreach (array('from', 'to', 'cc', 'bcc', 'reply-to') as $val) {
if (isset($headers_list[$val]) &&
- (!$preview || !in_array($val, array('bcc', 'reply-to')))) {
+ (!$preview || ($val != 'reply-to'))) {
$tmp = $this->_buildAddressList($envelope[$val]);
if (!empty($tmp)) {
$result[$val] = $tmp;
<td class="label"><?php echo _("Cc") ?>:</td>
<td class="cc"></td>
</tr>
+ <tr id="msgHeaderBcc">
+ <td class="label"><?php echo _("Bcc") ?>:</td>
+ <td class="bcc"></td>
+ </tr>
<tr id="msgAtc" style="display:none">
<td class="label" id="partlist_toggle">
<span class="iconImg attachmentImg attachmentImage"></span>