From 6ab9369eb194e4dde0cc830a84466dd240e95b23 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 15 Aug 2012 16:21:34 +0200 Subject: Fix lower-casing email address on replies (#1488598) --- program/steps/mail/compose.inc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'program/steps') diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 1a1d244e1..56f4a052b 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -252,7 +252,8 @@ $MESSAGE->identities = $RCMAIL->user->list_identities(); if (count($MESSAGE->identities)) { foreach ($MESSAGE->identities as $idx => $ident) { - $email = mb_strtolower(rcube_idn_to_utf8($ident['email'])); + $ident['email'] = format_email($ident['email']); + $email = format_email(rcube_idn_to_utf8($ident['email'])); $MESSAGE->identities[$idx]['email_ascii'] = $ident['email']; $MESSAGE->identities[$idx]['ident'] = format_email_recipient($ident['email'], $ident['name']); @@ -277,7 +278,7 @@ else if (count($MESSAGE->identities)) { $a_to = rcube_mime::decode_address_list($MESSAGE->headers->to, null, true, $MESSAGE->headers->charset); foreach ($a_to as $addr) { if (!empty($addr['mailto'])) { - $a_recipients[] = strtolower($addr['mailto']); + $a_recipients[] = format_email($addr['mailto']); $a_names[] = $addr['name']; } } @@ -286,7 +287,7 @@ else if (count($MESSAGE->identities)) { $a_cc = rcube_mime::decode_address_list($MESSAGE->headers->cc, null, true, $MESSAGE->headers->charset); foreach ($a_cc as $addr) { if (!empty($addr['mailto'])) { - $a_recipients[] = strtolower($addr['mailto']); + $a_recipients[] = format_email($addr['mailto']); $a_names[] = $addr['name']; } } @@ -433,7 +434,7 @@ foreach ($parts as $header) { if (empty($addr_part['mailto'])) continue; - $mailto = mb_strtolower(rcube_idn_to_utf8($addr_part['mailto'])); + $mailto = format_email(rcube_idn_to_utf8($addr_part['mailto'])); if (!in_array($mailto, $a_recipients) && ($header == 'to' || empty($MESSAGE->compose['from_email']) || $mailto != $MESSAGE->compose['from_email']) -- cgit v1.2.3 From 60082ad665cfcb3b517f765a5192e99ddf1a730c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 17 Aug 2012 10:51:54 +0200 Subject: Fix PHP Warning: strlen() expects parameter 1 to be string, object given --- program/steps/addressbook/export.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'program/steps') diff --git a/program/steps/addressbook/export.inc b/program/steps/addressbook/export.inc index 84a63aebc..850795c85 100644 --- a/program/steps/addressbook/export.inc +++ b/program/steps/addressbook/export.inc @@ -86,7 +86,7 @@ while ($result && ($row = $result->next())) { foreach ($row as $key => $values) { list($field, $section) = explode(':', $key); foreach ((array)$values as $value) { - if (is_array($value) || strlen($value)) + if (is_array($value) || @strlen($value)) $vcard->set($field, $value, strtoupper($section)); } } -- cgit v1.2.3 From c8f35a17e645ec7328557846b976e38432c9a062 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 20 Aug 2012 08:52:00 +0200 Subject: Added "Undeleted" option to messages list filter --- CHANGELOG | 1 + program/localization/en_US/labels.inc | 5 +---- program/localization/pl_PL/labels.inc | 1 + program/steps/mail/func.inc | 4 +++- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'program/steps') diff --git a/CHANGELOG b/CHANGELOG index 65b2dcbc8..6ea101e8f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Added "Undeleted" option to messages list filter - 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/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 94bae1974..6085b3898 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -1,7 +1,6 @@ | +-----------------------------------------------------------------------+ - - @version $Id$ - */ $labels = array(); @@ -163,6 +159,7 @@ $labels['unread'] = 'Unread'; $labels['flagged'] = 'Flagged'; $labels['unanswered'] = 'Unanswered'; $labels['deleted'] = 'Deleted'; +$labels['undeleted'] = 'Not deleted'; $labels['invert'] = 'Invert'; $labels['filter'] = 'Filter'; $labels['list'] = 'List'; diff --git a/program/localization/pl_PL/labels.inc b/program/localization/pl_PL/labels.inc index 92da1f6ef..d5ffcaa61 100644 --- a/program/localization/pl_PL/labels.inc +++ b/program/localization/pl_PL/labels.inc @@ -134,6 +134,7 @@ $labels['unread'] = 'Nieprzeczytane'; $labels['flagged'] = 'Oznaczone'; $labels['unanswered'] = 'Bez odpowiedzi'; $labels['deleted'] = 'Usunięte'; +$labels['undeleted'] = 'Nieusunięte'; $labels['invert'] = 'Odwróć'; $labels['filter'] = 'Filtr'; $labels['list'] = 'Lista'; diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 3d65eacb1..7f0b4db5b 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1712,8 +1712,10 @@ function rcmail_search_filter($attrib) $select_filter->add(rcube_label('unread'), 'UNSEEN'); $select_filter->add(rcube_label('flagged'), 'FLAGGED'); $select_filter->add(rcube_label('unanswered'), 'UNANSWERED'); - if (!$CONFIG['skip_deleted']) + if (!$CONFIG['skip_deleted']) { $select_filter->add(rcube_label('deleted'), 'DELETED'); + $select_filter->add(rcube_label('undeleted'), 'UNDELETED'); + } $select_filter->add(rcube_label('priority').': '.rcube_label('highest'), 'HEADER X-PRIORITY 1'); $select_filter->add(rcube_label('priority').': '.rcube_label('high'), 'HEADER X-PRIORITY 2'); $select_filter->add(rcube_label('priority').': '.rcube_label('normal'), 'NOT HEADER X-PRIORITY 1 NOT HEADER X-PRIORITY 2 NOT HEADER X-PRIORITY 4 NOT HEADER X-PRIORITY 5'); -- cgit v1.2.3 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') 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') 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') 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') 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 4c127375ce2c560ad60c61b0ec3ec5cc21405d4f Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 27 Aug 2012 11:19:05 +0200 Subject: Fix identity selection on reply (#1488101) --- CHANGELOG | 1 + program/steps/mail/compose.inc | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'program/steps') diff --git a/CHANGELOG b/CHANGELOG index d123003f9..8e9dcb3c7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- 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) - Fix Larry's messages list filter in IE (#1488632) diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index e57b44ae6..29e12675e 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -295,16 +295,12 @@ else if (count($MESSAGE->identities)) { } $from_idx = null; - $default_identity = null; + $found_idx = null; + $default_identity = 0; // default identity is always first on the list $return_path = $MESSAGE->headers->others['return-path']; // Select identity foreach ($MESSAGE->identities as $idx => $ident) { - // save default identity ID - if ($ident['standard']) { - $default_identity = $idx; - } - // use From header if (in_array($compose_mode, array(RCUBE_COMPOSE_DRAFT, RCUBE_COMPOSE_EDIT))) { if ($MESSAGE->headers->from == $ident['ident']) { @@ -319,13 +315,22 @@ else if (count($MESSAGE->identities)) { } // use replied message recipients else if (($found = array_search($ident['email_ascii'], $a_recipients)) !== false) { - // match identity name, prefer default identity - if ($from_idx === null || ($a_names[$found] && $ident['name'] && $a_names[$found] == $ident['name'])) { + if ($found_idx === null) { + $found_idx = $idx; + } + // match identity name + if ($a_names[$found] && $ident['name'] && $a_names[$found] == $ident['name']) { $from_idx = $idx; + break; } } } + // If matching by name+address doesn't found any amtches, get first found address (identity) + if ($from_idx === null) { + $from_idx = $found_idx; + } + // Fallback using Return-Path if ($from_idx === null && $return_path) { foreach ($MESSAGE->identities as $idx => $ident) { @@ -336,12 +341,7 @@ else if (count($MESSAGE->identities)) { } } - // Still no ID, use default/first identity - if ($from_idx === null) { - $from_idx = $default_identity !== null ? $default_identity : key(reset($MESSAGE->identities)); - } - - $ident = $MESSAGE->identities[$from_idx]; + $ident = $MESSAGE->identities[$from_idx !== null ? $from_idx : $default_identity]; $from_id = $ident['identity_id']; $MESSAGE->compose['from_email'] = $ident['email']; -- 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') 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 10141cd6fd94105c757a0b91f11897cc5ae2c808 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 3 Sep 2012 19:00:34 +0200 Subject: Fix displaying all headers when they contain malformed characters (#1488666) --- CHANGELOG | 1 + program/steps/mail/headers.inc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'program/steps') diff --git a/CHANGELOG b/CHANGELOG index 7654cdef8..e47673647 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix displaying all headers when they contain malformed characters (#1488666) - Fix decoding of HTML messages with UTF-16 charset specified (#1488654) - Fix quota capability detection so it can be overwritten by a plugin (#1488655) - Added template object 'frame' diff --git a/program/steps/mail/headers.inc b/program/steps/mail/headers.inc index 4d6627393..cad113f68 100644 --- a/program/steps/mail/headers.inc +++ b/program/steps/mail/headers.inc @@ -24,7 +24,8 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_POST)) $source = $RCMAIL->storage->get_raw_headers($uid); if ($source !== false) { - $source = htmlspecialchars(trim($source)); + $source = trim(rcube_charset::clean($source)); + $source = htmlspecialchars($source); $source = preg_replace( array( '/\n[\t\s]+/', -- 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') 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 From af276f21e5364eb65a56b64c3455bc284ff1e2f2 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 4 Sep 2012 09:32:24 +0200 Subject: Add full headers view in message preview window (#1488538) Fix message display page issues - unified with message preview (#1488590, #1488642) --- CHANGELOG | 2 + program/steps/mail/func.inc | 9 +++- skins/larry/ie7hacks.css | 6 +-- skins/larry/iehacks.css | 2 +- skins/larry/images/contactpic_32px.png | Bin 4883 -> 3422 bytes skins/larry/images/contactpic_48px.png | Bin 0 -> 3812 bytes skins/larry/mail.css | 78 ++++++++++++++---------------- skins/larry/svggradients.css | 2 +- skins/larry/templates/message.html | 61 ++++++++++++++--------- skins/larry/templates/messageerror.html | 10 ++-- skins/larry/templates/messagepreview.html | 5 +- skins/larry/ui.js | 34 +++++++++---- 12 files changed, 120 insertions(+), 89 deletions(-) create mode 100644 skins/larry/images/contactpic_48px.png (limited to 'program/steps') diff --git a/CHANGELOG b/CHANGELOG index 8e9dcb3c7..3a14694c9 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ CHANGELOG Roundcube Webmail =========================== +- Add full headers view in message preview window (#1488538) +- Fix message display page issues - unified with message preview (#1488590, #1488642) - 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..6f451e14f 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1053,12 +1053,17 @@ function rcmail_message_full_headers($attrib, $headers=NULL) global $OUTPUT; $html = html::div(array('id' => "all-headers", 'class' => "all", 'style' => 'display:none'), html::div(array('id' => 'headers-source'), '')); - $html .= html::div(array('class' => "more-headers show-headers", 'onclick' => "return ".JS_OBJECT_NAME.".command('show-headers','',this)"), ''); + + if (!get_boolean($attrib['no-switch'])) { + $html .= html::div(array('class' => "more-headers show-headers", 'onclick' => "return ".JS_OBJECT_NAME.".command('show-headers','',this)"), ''); + } + + unset($attrib['no-switch']); $OUTPUT->add_gui_object('all_headers_row', 'all-headers'); $OUTPUT->add_gui_object('all_headers_box', 'headers-source'); - return html::div($attrib, $html); + return count($attrib) > 1 ? html::div($attrib, $html) : $html; } diff --git a/skins/larry/ie7hacks.css b/skins/larry/ie7hacks.css index 024c35bb2..935a504fe 100644 --- a/skins/larry/ie7hacks.css +++ b/skins/larry/ie7hacks.css @@ -29,7 +29,7 @@ a.deletebutton, .boxfooter .listbutton .inner, .attachmentslist li a.delete, .attachmentslist li a.cancelupload, -#messagepreviewheader .iconlink { +#messageheader .iconlink { /* workaround for text-indent which also offsets the background image */ text-indent: 0; font-size: 0; @@ -45,7 +45,7 @@ a.deletebutton, .pagenav a.button, .pagenav a.button span.inner, -#messagepreviewheader .iconlink, +#messageheader .iconlink, #uploadform a.iconlink { display: inline; } @@ -67,7 +67,7 @@ a.deletebutton, text-align: left; } -#messagepreviewheader .iconlink { +#messageheader .iconlink { color: #fff; height: 14px; } diff --git a/skins/larry/iehacks.css b/skins/larry/iehacks.css index 288202111..bba93dc33 100644 --- a/skins/larry/iehacks.css +++ b/skins/larry/iehacks.css @@ -143,7 +143,7 @@ ul.toolbarmenu li a.active:hover, filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#005d76', endColorstr='#004558', GradientType=0); } -#messageheader, #partheader, #composeheaders { +#partheader, #composeheaders { filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e9e9e9', GradientType=0); } diff --git a/skins/larry/images/contactpic_32px.png b/skins/larry/images/contactpic_32px.png index 276f1974f..25a81418d 100644 Binary files a/skins/larry/images/contactpic_32px.png and b/skins/larry/images/contactpic_32px.png differ diff --git a/skins/larry/images/contactpic_48px.png b/skins/larry/images/contactpic_48px.png new file mode 100644 index 000000000..9cd3bceaf Binary files /dev/null and b/skins/larry/images/contactpic_48px.png differ diff --git a/skins/larry/mail.css b/skins/larry/mail.css index 4fff24307..d2ff11808 100644 --- a/skins/larry/mail.css +++ b/skins/larry/mail.css @@ -38,10 +38,6 @@ bottom: 28px; } -#mailview-top.fullheight { - border-radius: 4px 4px 0 0; -} - #mailview-bottom { position: absolute; left: 0; @@ -50,6 +46,10 @@ height: 26px; } +#mailview-top.fullheight { + border-radius: 4px 4px 0 0; +} + #folderlist-header { width: 100%; height: 12px; @@ -680,15 +680,14 @@ a.iconbutton.threadmode.selected { #messagecontent { position: absolute; - top: 140px; + top: 0; left: 0; width: 100%; - bottom: 0; + bottom: 28px; overflow: auto; border-radius: 4px 4px 0 0; } -#messageheader, #partheader, #composeheaders { position: relative; @@ -712,7 +711,7 @@ h2.subject { h3.subject { font-size: 14px; - margin: 0 8em 0 0; + margin: 0 13em 0 0; padding: 8px 8px 4px 8px; white-space: nowrap; overflow: hidden; @@ -787,6 +786,7 @@ h3.subject { background: -ms-linear-gradient(left, #fbfbfb 0, #e9e9e9 100%); background: linear-gradient(left, #fbfbfb 0, #e9e9e9 100%); border-right: 1px solid #dfdfdf; + border-radius: 3px 0 0 0; /* for Opera */ } #previewheaderstoggle .iconlink { @@ -801,28 +801,27 @@ h3.subject { #previewheaderstoggle.remove .iconlink { top: auto; - bottom: 5px; + bottom: 15px; background-position: -5px -242px; } -div.more-headers { - cursor: pointer; - height: 10px; - background: url(images/buttons.png) center -1619px no-repeat; +#previewheaderstoggle .iconlink.allheaders { + display: none; } -div.hide-headers { - background-position: center -1629px; +#previewheaderstoggle.remove .iconlink.allheaders { + top: auto; + bottom: 2px; + display: inline-block; + background-position: -27px -242px; } #all-headers { position: relative; - margin: 0 10px; + margin: 2px 0; padding: 0; height: 180px; - border: 1px solid #bbb; - border-radius: 4px; - background: #fff; + background-color: #f0f0f0; } #headers-source { @@ -832,25 +831,30 @@ div.hide-headers { left: 0; right: 0; bottom: 0; - padding: 2px 5px; + padding: 0; overflow: auto; text-align: left; - color: #333; + color: #666; } -#messagepreviewheader { +#messageheader { position: relative; height: auto; margin: 0 8px 0 0; - padding: 0 0 6px 72px; + padding: 0 0 0 72px; border-bottom: 2px solid #f0f0f0; } -#messagepreviewheader h3.subject { +#messagecontent #messageheader { + padding: 0 0 0 90px; + min-height: 68px; +} + +#messageheader h3.subject { padding: 8px 8px 2px 0; } -#messagepreviewheader #contactphoto { +#messageheader #contactphoto { display: block; position: absolute; top: 11px; @@ -862,45 +866,35 @@ div.hide-headers { border-radius: 3px; } -#messagepreviewheader #contactphoto img { +#messageheader #contactphoto img { width: 32px; height: auto; border-radius: 3px; } -#messageheader #contactphoto { - display: block; - position: absolute; - top: 40px; - right: 10px; +#messagecontent #messageheader #contactphoto { + top: 11px; + left: 31px; width: 48px; height: 48px; - overflow: hidden; + background: url(images/contactpic_48px.png) center center no-repeat #fff; border-radius: 4px; } -#messageheader #contactphoto img { +#messagecontent #messageheader #contactphoto img { width: 48px; height: auto; border-radius: 4px; } -#messagepreviewheader #countcontrols, #messageheader #countcontrols { position: absolute; top: 8px; - right: 8px; - width: 20em; + right: 0; text-align: right; white-space: nowrap; } -#messageheader .pagenav .countdisplay { - min-width: 0; - padding-right: 0.5em; - white-space: nowrap; -} - #messagecontent .leftcol, #messagepreview .leftcol { margin-right: 252px; diff --git a/skins/larry/svggradients.css b/skins/larry/svggradients.css index 143fb375f..4f1dd8a05 100644 --- a/skins/larry/svggradients.css +++ b/skins/larry/svggradients.css @@ -133,7 +133,7 @@ ul.toolbarmenu li a.active:hover, background-image: url(svggradient.php?c=005d76;004558); } -#messageheader, #partheader, #composeheaders { +#partheader, #composeheaders { background-image: url(svggradient.php?c=ffffff;e9e9e9); } diff --git a/skins/larry/templates/message.html b/skins/larry/templates/message.html index 1becd711a..89b7bd808 100644 --- a/skins/larry/templates/message.html +++ b/skins/larry/templates/message.html @@ -24,20 +24,38 @@
-
- -
+
+ +
- + + +
+ +
+ +
+

+ + -
+
-
-
-

- - + + + + + + + + + + +
+ + + -
-
+
-
-
- -
-
- - -
+
+
+ +
+
+ + +
-
+
-
-
diff --git a/skins/larry/templates/messageerror.html b/skins/larry/templates/messageerror.html index 70181f174..2f5243200 100644 --- a/skins/larry/templates/messageerror.html +++ b/skins/larry/templates/messageerror.html @@ -27,8 +27,6 @@
-
-
@@ -36,11 +34,11 @@
-
+
-
- -
+
+ +
diff --git a/skins/larry/templates/messagepreview.html b/skins/larry/templates/messagepreview.html index b53683ec1..74c414b0d 100644 --- a/skins/larry/templates/messagepreview.html +++ b/skins/larry/templates/messagepreview.html @@ -6,10 +6,10 @@ -
+

- +
@@ -25,6 +25,7 @@
+