From fe2f0be4352ba0bc213a2c6d4dfcbbddea1a551c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 21 Aug 2012 10:50:14 +0200 Subject: Fix possible PHP warning, read default_folders using config->get() to support deprecated option name (default_imap_folders) --- program/steps/settings/folders.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'program/steps/settings') diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 2691a6e26..1031fc136 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -44,8 +44,8 @@ if ($RCMAIL->action == 'subscribe') if ($result) { // Handle subscription of protected folder (#1487656) - if ($CONFIG['protect_default_folders'] == true - && in_array($mbox, $CONFIG['default_folders']) + if ($RCMAIL->config->get('protect_default_folders') + && in_array($mbox, (array)$RCMAIL->config->get('default_folders')) ) { $OUTPUT->command('disable_subscription', $mbox); } -- cgit v1.2.3 From 9cb76ad3c2ebcf6f75053de2e686390470dce7ba Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 21 Aug 2012 11:22:23 +0200 Subject: Fix so subscribed non-existing/non-accessible shared folder can be unsubscribed --- CHANGELOG | 1 + program/steps/settings/folders.inc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'program/steps/settings') diff --git a/CHANGELOG b/CHANGELOG index 65b2dcbc8..6a7b2143b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix so subscribed non-existing/non-accessible shared folder can be unsubscribed - Rewritten test scripts for PHPUnit - Add new DB abstraction layer based on PHP PDO, supporting SQLite3 (#1488332) - Removed PEAR::MDB2 package diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 1031fc136..2c2cbdcc2 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -321,8 +321,8 @@ function rcube_subscription_form($attrib) } } } - // check if the folder is shared, then disable subscription option on it - if (!$disabled && $folder['virtual'] && !empty($namespace)) { + // check if the folder is shared, then disable subscription option on it (if not subscribed already) + if (!$disabled && !$subscribed && $folder['virtual'] && !empty($namespace)) { $tmp_ns = array_merge((array)$namespace['other'], (array)$namespace['shared']); foreach ($tmp_ns as $item) { if (strpos($folder['id'], $item[0]) === 0) { -- cgit v1.2.3 From 651c7b6e9df38a3b7cdf6daebed39021d88c3bea Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 26 Aug 2012 18:20:28 +0200 Subject: Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149) --- CHANGELOG | 1 + config/main.inc.php.dist | 7 +++++-- installer/rcube_install.php | 11 ++++++----- program/include/rcube_config.php | 1 + program/localization/en_US/labels.inc | 5 +++-- program/steps/mail/compose.inc | 9 +++++---- program/steps/settings/func.inc | 15 ++++++++------- program/steps/settings/save_prefs.inc | 4 ++-- 8 files changed, 31 insertions(+), 22 deletions(-) (limited to 'program/steps/settings') diff --git a/CHANGELOG b/CHANGELOG index 05540a5a4..f48ace4e8 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ 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 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) diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist index 504593028..69a6ea279 100644 --- a/config/main.inc.php.dist +++ b/config/main.inc.php.dist @@ -783,8 +783,11 @@ $rcmail_config['display_next'] = true; // 2 - Expand only threads with unread messages $rcmail_config['autoexpand_threads'] = 0; -// When replying place cursor above original message (top posting) -$rcmail_config['top_posting'] = false; +// When replying: +// -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 $rcmail_config['strip_existing_sig'] = true; diff --git a/installer/rcube_install.php b/installer/rcube_install.php index bfb111f1d..5af871346 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -35,13 +35,14 @@ class rcube_install var $obsolete_config = array('db_backend', 'double_auth'); var $replaced_config = array( - 'skin_path' => 'skin', - 'locale_string' => 'language', - 'multiple_identities' => 'identities_level', + 'skin_path' => 'skin', + 'locale_string' => 'language', + 'multiple_identities' => 'identities_level', 'addrbook_show_images' => 'show_images', - 'imap_root' => 'imap_ns_personal', - 'pagesize' => 'mail_pagesize', + 'imap_root' => 'imap_ns_personal', + 'pagesize' => 'mail_pagesize', 'default_imap_folders' => 'default_folders', + 'top_posting' => 'reply_mode', ); // these config options are required for a working system diff --git a/program/include/rcube_config.php b/program/include/rcube_config.php index e2997906c..41acc80dd 100644 --- a/program/include/rcube_config.php +++ b/program/include/rcube_config.php @@ -42,6 +42,7 @@ class rcube_config 'default_folders' => 'default_imap_folders', 'mail_pagesize' => 'pagesize', 'addressbook_pagesize' => 'pagesize', + 'reply_mode' => 'top_posting', ); diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 6085b3898..88de277ac 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -429,8 +429,9 @@ $labels['maintenance'] = 'Maintenance'; $labels['newmessage'] = 'New Message'; $labels['signatureoptions'] = 'Signature Options'; $labels['whenreplying'] = 'When replying'; -$labels['replytopposting'] = 'start new message above original'; -$labels['replybottomposting'] = 'start new message below original'; +$labels['replyempty'] = 'do not quote the original message'; +$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['autoaddsignature'] = 'Automatically add signature'; $labels['newmessageonly'] = 'new message only'; diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 56f4a052b..c243c887e 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -139,7 +139,7 @@ if (!empty($CONFIG['drafts_mbox'])) { // set current mailbox in client environment $OUTPUT->set_env('mailbox', $RCMAIL->storage->get_folder()); $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', ','))); // default font for HTML editor @@ -641,7 +641,7 @@ function rcmail_prepare_message_body() rcmail_write_forward_attachment($MESSAGE); } // 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(); if (!empty($MESSAGE->parts)) { @@ -906,8 +906,9 @@ function rcmail_create_reply_body($body, $bodyIsHtml) $prefix .= "\n"; $suffix = ''; - if ($RCMAIL->config->get('top_posting')) + if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting $prefix = "\n\n\n" . $prefix; + } } else { // save inline images to files @@ -921,7 +922,7 @@ function rcmail_create_reply_body($body, $bodyIsHtml) $prefix = '

' . Q($prefix) . "

\n"; $prefix .= '
'; - if ($RCMAIL->config->get('top_posting')) { + if (intval($RCMAIL->config->get('reply_mode')) > 0) { // top-posting $prefix = '
' . $prefix; $suffix = '
'; } diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 3f5ef5390..6d548ef36 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -544,16 +544,17 @@ function rcmail_user_prefs($current=null) ); } - if (!isset($no_override['top_posting'])) { - $field_id = 'rcmfd_top_posting'; - $select_replymode = new html_select(array('name' => '_top_posting', 'id' => $field_id, - 'onchange' => "\$('#rcmfd_sig_above').attr('disabled',this.selectedIndex==0)")); + if (!isset($no_override['reply_mode'])) { + $field_id = 'rcmfd_reply_mode'; + $select_replymode = new html_select(array('name' => '_reply_mode', 'id' => $field_id, + '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('replytopposting'), 1); - $blocks['main']['options']['top_posting'] = array( + $blocks['main']['options']['reply_mode'] = array( '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'])) { $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('abovequote'), 1); diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 88fa5298a..dc149929e 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -82,9 +82,9 @@ switch ($CURR_SECTION) 'spellcheck_ignore_nums' => isset($_POST['_spellcheck_ignore_nums']) ? TRUE : FALSE, 'spellcheck_ignore_caps' => isset($_POST['_spellcheck_ignore_caps']) ? TRUE : FALSE, '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']), - '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), 'forward_attachment' => !empty($_POST['_forward_attachment']), ); -- cgit v1.2.3 From 8eefbb2158c43b51a8c33e6c480cbe61539b9535 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 27 Aug 2012 10:16:04 +0200 Subject: Add option to enable HTML editor on forwarding (#1488517) --- CHANGELOG | 1 + config/main.inc.php.dist | 2 +- program/localization/en_US/labels.inc | 3 ++- program/steps/mail/compose.inc | 7 +++++-- program/steps/settings/func.inc | 1 + 5 files changed, 10 insertions(+), 4 deletions(-) (limited to 'program/steps/settings') diff --git a/CHANGELOG b/CHANGELOG index f48ace4e8..d123003f9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Add option to enable HTML editor on forwarding (#1488517) - 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 more IE issues by disabling Compat. mode with X-UA-Compatible meta tag (#1488626) diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist index 69a6ea279..7e07341a9 100644 --- a/config/main.inc.php.dist +++ b/config/main.inc.php.dist @@ -725,7 +725,7 @@ $rcmail_config['prefer_html'] = true; $rcmail_config['show_images'] = 0; // compose html formatted messages by default -// 0 - never, 1 - always, 2 - on reply to HTML message only +// 0 - never, 1 - always, 2 - on reply to HTML message, 3 - on forward or reply to HTML message $rcmail_config['htmleditor'] = 0; // show pretty dates as standard diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 88de277ac..9882c19b5 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -381,7 +381,8 @@ $labels['pagesize'] = 'Rows per page'; $labels['signature'] = 'Signature'; $labels['dstactive'] = 'Daylight saving time'; $labels['htmleditor'] = 'Compose HTML messages'; -$labels['htmlonreply'] = 'on reply to HTML message only'; +$labels['htmlonreply'] = 'on reply to HTML message'; +$labels['htmlonreplyandforward'] = 'on forward or reply to HTML message'; $labels['htmlsignature'] = 'HTML signature'; $labels['previewpane'] = 'Show preview pane'; $labels['skin'] = 'Interface skin'; diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index c243c887e..e57b44ae6 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -610,9 +610,12 @@ function rcmail_compose_editor_mode() $useHtml = $MESSAGE->has_html_part(false); } else if ($compose_mode == RCUBE_COMPOSE_REPLY) { - $useHtml = ($html_editor == 1 || ($html_editor == 2 && $MESSAGE->has_html_part(false))); + $useHtml = ($html_editor == 1 || ($html_editor >= 2 && $MESSAGE->has_html_part(false))); } - else { // RCUBE_COMPOSE_FORWARD or NEW + else if ($compose_mode == RCUBE_COMPOSE_FORWARD) { + $useHtml = ($html_editor == 1 || ($html_editor == 3 && $MESSAGE->has_html_part(false))); + } + else { $useHtml = ($html_editor == 1); } diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 6d548ef36..59b4e3735 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -470,6 +470,7 @@ function rcmail_user_prefs($current=null) $select_htmleditor->add(rcube_label('never'), 0); $select_htmleditor->add(rcube_label('always'), 1); $select_htmleditor->add(rcube_label('htmlonreply'), 2); + $select_htmleditor->add(rcube_label('htmlonreplyandforward'), 3); $blocks['main']['options']['htmleditor'] = array( 'title' => html::label($field_id, Q(rcube_label('htmleditor'))), -- cgit v1.2.3 From 46d0012e26d18b1a780ff71cd8aa2f04e6c4a11b Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 29 Aug 2012 08:32:06 +0200 Subject: Fix quota capability detection so it can be overwritten by a plugin (#1488655) --- CHANGELOG | 1 + program/steps/mail/func.inc | 4 +++- program/steps/settings/folders.inc | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'program/steps/settings') diff --git a/CHANGELOG b/CHANGELOG index 8e9dcb3c7..dcaf3f861 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix quota capability detection so it can be overwritten by a plugin (#1488655) - Fix identity selection on reply (#1488101) - Add option to enable HTML editor on forwarding (#1488517) - Add option to not include original message on reply, rename option top_posting to reply_mode (#1485149) diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 7f0b4db5b..45582d40d 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -90,11 +90,13 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { // set current mailbox and some other vars in client environment $OUTPUT->set_env('mailbox', $mbox_name); $OUTPUT->set_env('pagesize', $RCMAIL->storage->get_pagesize()); - $OUTPUT->set_env('quota', $RCMAIL->storage->get_capability('QUOTA')); $OUTPUT->set_env('delimiter', $RCMAIL->storage->get_hierarchy_delimiter()); $OUTPUT->set_env('threading', $threading); $OUTPUT->set_env('threads', $threading || $RCMAIL->storage->get_capability('THREAD')); $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0)); + if ($RCMAIL->storage->get_capability('QUOTA')) { + $OUTPUT->set_env('quota', true); + } if ($CONFIG['delete_junk']) $OUTPUT->set_env('delete_junk', true); diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 2c2cbdcc2..6ca704998 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -411,8 +411,10 @@ function rcmail_rename_folder($oldname, $newname) $OUTPUT->set_pagetitle(rcube_label('folders')); $OUTPUT->include_script('list.js'); -$OUTPUT->set_env('quota', $STORAGE->get_capability('QUOTA')); $OUTPUT->set_env('prefix_ns', $STORAGE->get_namespace('prefix')); +if ($STORAGE->get_capability('QUOTA')) { + $OUTPUT->set_env('quota', true); +} // add some labels to client $OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting', -- cgit v1.2.3 From 26fc0defe374734db81baa8177466639ed65c900 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 3 Sep 2012 19:56:59 +0200 Subject: Fix bug where parentnotwritable error wasn't displayed in the interface --- program/steps/settings/save_folder.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'program/steps/settings') diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc index 09f76ac27..73cc5e4bf 100644 --- a/program/steps/settings/save_folder.inc +++ b/program/steps/settings/save_folder.inc @@ -80,7 +80,10 @@ if (!$error && strlen($path) && (!strlen($old_imap) || $old_imap != $name_imap)) } } -if (!$error) { +if ($error) { + $OUTPUT->command('display_message', $error, 'error'); +} +else { $folder['name'] = $name_imap; $folder['oldname'] = $old_imap; $folder['class'] = ''; -- cgit v1.2.3