Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149)

pull/21/head
Aleksander Machniak 12 years ago
parent 4877dbd4d2
commit 651c7b6e9d

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149)
- Fix Larry's messages list filter in IE (#1488632) - Fix Larry's messages list filter in IE (#1488632)
- Fix more IE issues by disabling Compat. mode with X-UA-Compatible meta tag (#1488626) - Fix more IE issues by disabling Compat. mode with X-UA-Compatible meta tag (#1488626)
- Fix setting locales under Solaris - use additional .UTF-8 suffix (#1488628) - Fix setting locales under Solaris - use additional .UTF-8 suffix (#1488628)

@ -783,8 +783,11 @@ $rcmail_config['display_next'] = true;
// 2 - Expand only threads with unread messages // 2 - Expand only threads with unread messages
$rcmail_config['autoexpand_threads'] = 0; $rcmail_config['autoexpand_threads'] = 0;
// When replying place cursor above original message (top posting) // When replying:
$rcmail_config['top_posting'] = false; // -1 - don't cite the original message
// 0 - place cursor below the original message
// 1 - place cursor above original message (top posting)
$rcmail_config['reply_mode'] = 0;
// When replying strip original signature from message // When replying strip original signature from message
$rcmail_config['strip_existing_sig'] = true; $rcmail_config['strip_existing_sig'] = true;

@ -42,6 +42,7 @@ class rcube_install
'imap_root' => 'imap_ns_personal', 'imap_root' => 'imap_ns_personal',
'pagesize' => 'mail_pagesize', 'pagesize' => 'mail_pagesize',
'default_imap_folders' => 'default_folders', 'default_imap_folders' => 'default_folders',
'top_posting' => 'reply_mode',
); );
// these config options are required for a working system // these config options are required for a working system

@ -42,6 +42,7 @@ class rcube_config
'default_folders' => 'default_imap_folders', 'default_folders' => 'default_imap_folders',
'mail_pagesize' => 'pagesize', 'mail_pagesize' => 'pagesize',
'addressbook_pagesize' => 'pagesize', 'addressbook_pagesize' => 'pagesize',
'reply_mode' => 'top_posting',
); );

@ -429,8 +429,9 @@ $labels['maintenance'] = 'Maintenance';
$labels['newmessage'] = 'New Message'; $labels['newmessage'] = 'New Message';
$labels['signatureoptions'] = 'Signature Options'; $labels['signatureoptions'] = 'Signature Options';
$labels['whenreplying'] = 'When replying'; $labels['whenreplying'] = 'When replying';
$labels['replytopposting'] = 'start new message above original'; $labels['replyempty'] = 'do not quote the original message';
$labels['replybottomposting'] = 'start new message below original'; $labels['replytopposting'] = 'start new message above the quote';
$labels['replybottomposting'] = 'start new message below the quote';
$labels['replyremovesignature'] = 'When replying remove original signature from message'; $labels['replyremovesignature'] = 'When replying remove original signature from message';
$labels['autoaddsignature'] = 'Automatically add signature'; $labels['autoaddsignature'] = 'Automatically add signature';
$labels['newmessageonly'] = 'new message only'; $labels['newmessageonly'] = 'new message only';

@ -139,7 +139,7 @@ if (!empty($CONFIG['drafts_mbox'])) {
// set current mailbox in client environment // set current mailbox in client environment
$OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder()); $OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder());
$OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false)); $OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false));
$OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false)); $OUTPUT->set_env('top_posting', intval($RCMAIL->config->get('reply_mode')) > 0);
$OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ','))); $OUTPUT->set_env('recipients_separator', trim($RCMAIL->config->get('recipients_separator', ',')));
// default font for HTML editor // default font for HTML editor
@ -641,7 +641,7 @@ function rcmail_prepare_message_body()
rcmail_write_forward_attachment($MESSAGE); rcmail_write_forward_attachment($MESSAGE);
} }
// reply/edit/draft/forward // reply/edit/draft/forward
else if ($compose_mode) { else if ($compose_mode && ($compose_mode != RCUBE_COMPOSE_REPLY || $RCMAIL->config->get('reply_mode') != -1)) {
$isHtml = rcmail_compose_editor_mode(); $isHtml = rcmail_compose_editor_mode();
if (!empty($MESSAGE->parts)) { if (!empty($MESSAGE->parts)) {
@ -906,9 +906,10 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
$prefix .= "\n"; $prefix .= "\n";
$suffix = ''; $suffix = '';
if ($RCMAIL->config->get('top_posting')) if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
$prefix = "\n\n\n" . $prefix; $prefix = "\n\n\n" . $prefix;
} }
}
else { else {
// save inline images to files // save inline images to files
$cid_map = rcmail_write_inline_attachments($MESSAGE); $cid_map = rcmail_write_inline_attachments($MESSAGE);
@ -921,7 +922,7 @@ function rcmail_create_reply_body($body, $bodyIsHtml)
$prefix = '<p>' . Q($prefix) . "</p>\n"; $prefix = '<p>' . Q($prefix) . "</p>\n";
$prefix .= '<blockquote>'; $prefix .= '<blockquote>';
if ($RCMAIL->config->get('top_posting')) { if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting
$prefix = '<br>' . $prefix; $prefix = '<br>' . $prefix;
$suffix = '</blockquote>'; $suffix = '</blockquote>';
} }

@ -544,16 +544,17 @@ function rcmail_user_prefs($current=null)
); );
} }
if (!isset($no_override['top_posting'])) { if (!isset($no_override['reply_mode'])) {
$field_id = 'rcmfd_top_posting'; $field_id = 'rcmfd_reply_mode';
$select_replymode = new html_select(array('name' => '_top_posting', 'id' => $field_id, $select_replymode = new html_select(array('name' => '_reply_mode', 'id' => $field_id,
'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex==0)")); 'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex<2)"));
$select_replymode->add(rcube_label('replyempty'), -1);
$select_replymode->add(rcube_label('replybottomposting'), 0); $select_replymode->add(rcube_label('replybottomposting'), 0);
$select_replymode->add(rcube_label('replytopposting'), 1); $select_replymode->add(rcube_label('replytopposting'), 1);
$blocks['main']['options']['top_posting'] = array( $blocks['main']['options']['reply_mode'] = array(
'title' => html::label($field_id, Q(rcube_label('whenreplying'))), 'title' => html::label($field_id, Q(rcube_label('whenreplying'))),
'content' => $select_replymode->show($config['top_posting']?1:0), 'content' => $select_replymode->show(intval($config['reply_mode'])),
); );
} }
@ -597,7 +598,7 @@ function rcmail_user_prefs($current=null)
if (!isset($no_override['sig_above'])) { if (!isset($no_override['sig_above'])) {
$field_id = 'rcmfd_sig_above'; $field_id = 'rcmfd_sig_above';
$select_sigabove = new html_select(array('name' => '_sig_above', 'id' => $field_id, 'disabled' => !$config['top_posting'])); $select_sigabove = new html_select(array('name' => '_sig_above', 'id' => $field_id, 'disabled' => $config['reply_mode'] < 1));
$select_sigabove->add(rcube_label('belowquote'), 0); $select_sigabove->add(rcube_label('belowquote'), 0);
$select_sigabove->add(rcube_label('abovequote'), 1); $select_sigabove->add(rcube_label('abovequote'), 1);

@ -82,9 +82,9 @@ switch ($CURR_SECTION)
'spellcheck_ignore_nums' => isset($_POST['_spellcheck_ignore_nums']) ? TRUE : FALSE, 'spellcheck_ignore_nums' => isset($_POST['_spellcheck_ignore_nums']) ? TRUE : FALSE,
'spellcheck_ignore_caps' => isset($_POST['_spellcheck_ignore_caps']) ? TRUE : FALSE, 'spellcheck_ignore_caps' => isset($_POST['_spellcheck_ignore_caps']) ? TRUE : FALSE,
'show_sig' => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1, 'show_sig' => isset($_POST['_show_sig']) ? intval($_POST['_show_sig']) : 1,
'top_posting' => !empty($_POST['_top_posting']), 'reply_mode' => isset($_POST['_reply_mode']) ? intval($_POST['_reply_mode']) : 0,
'strip_existing_sig' => isset($_POST['_strip_existing_sig']), 'strip_existing_sig' => isset($_POST['_strip_existing_sig']),
'sig_above' => !empty($_POST['_sig_above']) && !empty($_POST['_top_posting']), 'sig_above' => !empty($_POST['_sig_above']) && $_POST['_reply_mode'] < 1,
'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST), 'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST),
'forward_attachment' => !empty($_POST['_forward_attachment']), 'forward_attachment' => !empty($_POST['_forward_attachment']),
); );

Loading…
Cancel
Save