color: #000;
background: #ffc;
border: 1px solid #aaa;
- padding: 1px 1px 1px 5px;
+ padding: 1px 3px;
}
.notices img, .notice img {
margin-right: .5em;
$header = $reply_msg['headers'];
$header['replytype'] = 'reply';
- if (($vars->type == 'reply_auto') && ($reply_msg['type'] == 'reply_all')) {
- $fillform_opts['reply_auto_all'] = 1;
+ if ($vars->type == 'reply_auto') {
+ switch ($reply_msg['type']) {
+ case 'reply_all':
+ $fillform_opts['reply_auto'] = 'all';
+ break;
+
+ case 'reply_list':
+ $fillform_opts['reply_auto'] = 'list';
+ break;
+ }
}
$vars->type = $reply_msg['type'];
}
},
- // opts = focus, noupdate, reply_auto_all
+ // opts = focus, noupdate, reply_auto
fillForm: function(msg, header, opts)
{
// On IE, this can get loaded before DOM:loaded. Check for an init
Field.focus(opts.focus || 'to');
this.resizeMsgArea();
- if (opts.reply_auto_all) {
- $('noticerow').show().down('.replyallnotice').show();
+ switch (opts.reply_auto) {
+ case 'all':
+ $('noticerow', 'replyallnotice').invoke('show');
+ break
+
+ case 'list':
+ $('noticerow', 'replylistnotice').invoke('show');
+ break;
}
if (DIMP.conf_compose.show_editor) {
}
},
- replyAutoAllCallback: function(r)
+ swapToAddressCallback: function(r)
{
if (r.response.header) {
$('to').setValue(r.response.header.to);
this.resizeto.resizeNeeded();
}
+ $('to_loading_img').hide();
},
focusEditor: function()
this.setSaveSentMail($F(elt));
break;
- case 'replyallclick':
- elt.up('LI').fade({
+ case 'replyallnotice':
+ case 'replylistnotice':
+ elt.fade({
afterFinish: function() {
elt.up('TR').hide();
this.resizeMsgArea();
}.bind(this),
duration: 0.4
});
- DimpCore.doAction('GetReplyData', { headeronly: 1, imp_compose: $F('composeCache'), type: 'reply' }, { callback: this.replyAutoAllCallback.bind(this) });
+ $('to_loading_img').show();
+ DimpCore.doAction('GetReplyData', { headeronly: 1, imp_compose: $F('composeCache'), type: 'reply' }, { callback: this.swapToAddressCallback.bind(this) });
e.stop();
return;
}
*/
public function GetReplyData($vars)
{
-
try {
$imp_compose = IMP_Compose::singleton($vars->imp_compose);
- if ($imp_compose->getMetadata('reply_type')) {
- $idx_string = $imp_compose->getMetadata('uid') . IMP::IDX_SEP . $imp_compose->getMetadata('mailbox');
- } else {
+ if (!($imp_contents = $imp_compose->getContentsOb())) {
$indices = $GLOBALS['imp_imap']->ob()->utils->fromSequenceString($vars->uid);
$i = each($indices);
- $idx_string = reset($i['value']) . IMP::IDX_SEP . $i['key'];
+ $imp_contents = IMP_Contents::singleton(reset($i['value']) . IMP::IDX_SEP . $i['key']);
}
- $imp_contents = IMP_Contents::singleton($idx_string);
$reply_msg = $imp_compose->replyMessage($vars->type, $imp_contents);
$header = $reply_msg['headers'];
$header['replytype'] = 'reply';
$result->format = $reply_msg['format'];
$result->identity = $reply_msg['identity'];
$result->imp_compose = $imp_compose->getCacheId();
- if (($vars->type == 'reply_auto') &&
- ($reply_msg['type'] == 'reply_all')) {
- $result->opts = array('reply_auto_all' => 1);
+ if ($vars->type == 'reply_auto') {
+ switch ($reply_msg['type']) {
+ case 'reply_all':
+ $result->opts = array('reply_auto' => 'all');
+ break;
+
+ case 'reply_list':
+ $result->opts = array('reply_auto' => 'list');
+ break;
+ }
}
}
} catch (Horde_Exception $e) {
$match_identity = $this->_getMatchingIdentity($h);
$reply_type = 'reply';
- if (!isset($this->_metadata['reply_type'])) {
+ if (!$this->getMetadata('reply_type')) {
$this->_metadata['mailbox'] = $contents->getMailbox();
$this->_metadata['reply_type'] = 'reply';
$this->_metadata['uid'] = $contents->getUid();
return array('sources' => $src, 'fields' => $fields);
}
+
+ /**
+ * If this object contains sufficient metadata, return an IMP_Contents
+ * object reflecting that metadata.
+ *
+ * @return mixed Either an IMP_Contents object or null.
+ */
+ public function getContentsOb()
+ {
+ return $this->getMetadata('reply_type')
+ ? IMP_Contents::singleton($this->getMetadata('uid') . IMP::IDX_SEP . $this->getMetadata('mailbox'))
+ : null;
+ }
+
}
<tr id="noticerow" style="display:none">
<td colspan="2">
<ul class="notices">
- <li class="replyallnotice" style="display:none"><?php echo Horde::img('alerts/message.png', _("Message"), null, $GLOBALS['registry']->getImageDir('horde')) ?> <?php echo sprintf(_("You are currently replying to ALL recipients. To reply only to the original sender, click %s."), '<a href="#" id="replyallclick">' . _("HERE") . '</a>') ?></li>
+ <li id="replyallnotice" style="display:none"><?php echo _("You are currently replying to ALL recipients. Click here to reply to the original sender instead.") ?></li>
+ <li id="replylistnotice" style="display:none"><?php echo _("You are currently replying to the mailing list. Click here to reply to the original sender instead.") ?></li>
</ul>
</td>
</tr>
.msgwrite .dimpOptions div {
padding-bottom: 0;
}
-.msgwrite .dimpOptions label {
+.msgwrite .dimpOptions label, #replyallnotice, #replylistnotice {
cursor: pointer;
}
.msgwrite tr {
}
.msgwrite span.loadingImg {
float: right;
- padding: 0;
+ margin-left: 3px;
+ padding: 1px;
}
#composeMessageParent {