diff options
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | config/defaults.inc.php | 5 | ||||
-rw-r--r-- | plugins/archive/archive.js | 26 | ||||
-rw-r--r-- | plugins/archive/archive.php | 68 | ||||
-rw-r--r-- | plugins/archive/composer.json | 7 | ||||
-rw-r--r-- | plugins/archive/package.xml | 10 | ||||
-rw-r--r-- | program/js/app.js | 8 | ||||
-rw-r--r-- | program/localization/en_US/labels.inc | 3 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 1 | ||||
-rw-r--r-- | program/steps/settings/func.inc | 18 | ||||
-rw-r--r-- | program/steps/settings/save_prefs.inc | 1 | ||||
-rw-r--r-- | skins/classic/functions.js | 2 | ||||
-rw-r--r-- | skins/classic/mail.css | 1 | ||||
-rw-r--r-- | skins/larry/ui.js | 2 |
14 files changed, 123 insertions, 30 deletions
@@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Add an option to disable smart Reply-List behaviour - reply_all_mode (#1488734) - Fix an issue where pressing minus key on contacts list was hiding list records (#1489393) - Fix an issue where shift + arrow-up key wasn't selecting all messages in collapsed thread (#1489397) - Added icon for priority column in messages list header (#1489234) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index 9e4ba11bf..ab0e188bd 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -1023,3 +1023,8 @@ $config['default_font_size'] = '10pt'; // Enables display of email address with name instead of a name (and address in title) $config['message_show_email'] = false; + +// Default behavior of Reply-All button: +// 0 - Reply-All always +// 1 - Reply-List if mailing list is detected +$config['reply_all_mode'] = 0; diff --git a/plugins/archive/archive.js b/plugins/archive/archive.js index 3500b9fe4..17a1ecdb4 100644 --- a/plugins/archive/archive.js +++ b/plugins/archive/archive.js @@ -1,6 +1,6 @@ /* * Archive plugin script - * @version 2.0 + * @version 2.1 */ function rcmail_archive(prop) @@ -8,29 +8,41 @@ function rcmail_archive(prop) if (!rcmail.env.uid && (!rcmail.message_list || !rcmail.message_list.get_selection().length)) return; - if (rcmail.env.mailbox.indexOf(rcmail.env.archive_folder) != 0) { + if (rcmail_is_archive()) { if (!rcmail.env.archive_type) { // simply move to archive folder (if no partition type is set) rcmail.command('move', rcmail.env.archive_folder); } else { // let the server sort the messages to the according subfolders - var post_data = { _uid: rcmail.message_list.get_selection().join(','), _mbox: rcmail.env.mailbox }; - rcmail.http_post('plugin.move2archive', post_data); + rcmail.http_post('plugin.move2archive', rcmail.selection_post_data()); } } } +function rcmail_is_archive() +{ + if (!rcmail.env.archive_folder) + return false; + + // check if current folder is an archive folder or one of its children + if (rcmail.env.mailbox == rcmail.env.archive_folder + || rcmail.env.mailbox.indexOf(rcmail.env.archive_folder + rcmail.env.delimiter) != 0 + ) { + return true; + } +} + // callback for app-onload event if (window.rcmail) { rcmail.addEventListener('init', function(evt) { // register command (directly enable in message view mode) - rcmail.register_command('plugin.archive', rcmail_archive, (rcmail.env.uid && rcmail.env.mailbox != rcmail.env.archive_folder)); + rcmail.register_command('plugin.archive', rcmail_archive, rcmail.env.uid && rcmail_is_archive()); // add event-listener to message list if (rcmail.message_list) rcmail.message_list.addEventListener('select', function(list) { - rcmail.enable_command('plugin.archive', (list.get_selection().length > 0 && rcmail.env.mailbox != rcmail.env.archive_folder)); + rcmail.enable_command('plugin.archive', list.get_selection().length > 0 && rcmail_is_archive()); }); // set css style for archive folder @@ -41,7 +53,7 @@ if (window.rcmail) { // callback for server response rcmail.addEventListener('plugin.move2archive_response', function(result) { if (result.update) - rcmail.command('checkmail'); // refresh list + rcmail.command('list'); // refresh list }); }) } diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php index 7a81606ab..4a00d5f58 100644 --- a/plugins/archive/archive.php +++ b/plugins/archive/archive.php @@ -6,9 +6,9 @@ * Plugin that adds a new button to the mailbox toolbar * to move messages to a (user selectable) archive folder. * - * @version 2.0 + * @version 2.1 * @license GNU GPLv3+ - * @author Andre Rodier, Thomas Bruederli + * @author Andre Rodier, Thomas Bruederli, Aleksander Machniak */ class archive extends rcube_plugin { @@ -110,19 +110,29 @@ class archive extends rcube_plugin */ function move_messages() { - $rcmail = rcmail::get_instance(); $this->add_texts('localization'); - $storage = $rcmail->get_storage(); + $rcmail = rcmail::get_instance(); + $storage = $rcmail->get_storage(); + $delimiter = $storage->get_hierarchy_delimiter(); + $archive_folder = $rcmail->config->get('archive_mbox'); + $archive_type = $rcmail->config->get('archive_type', ''); + $storage->set_folder(($current_mbox = rcube_utils::get_input_value('_mbox', RCUBE_INPUT_POST))); - $delimiter = $storage->get_hierarchy_delimiter(); - $archive_folder = $rcmail->config->get('archive_mbox'); - $archive_type = $rcmail->config->get('archive_type', ''); + $result = array('reload' => false, 'update' => false, 'errors' => array()); + $folders = array(); + $uids = rcube_utils::get_input_value('_uid', RCUBE_INPUT_POST); + $search_request = get_input_value('_search', RCUBE_INPUT_GPC); - $result = array('reload' => false, 'update' => false, 'errors' => array()); + if ($uids == '*') { + $index = $storage->index(null, rcmail_sort_column(), rcmail_sort_order()); + $uids = $index->get(); + } + else { + $uids = explode(',', $uids); + } - $uids = explode(',', rcube_utils::get_input_value('_uid', RCUBE_INPUT_POST)); foreach ($uids as $uid) { if (!$archive_folder || !($message = $rcmail->storage->get_message($uid))) { continue; @@ -164,12 +174,27 @@ class archive extends rcube_plugin } // compose full folder path - $folder = $archive_folder . ($subfolder ? $delimiter . $subfolder : ''); + $folder = $archive_folder . ($subfolder ? $delimiter . $subfolder : ''); // create archive subfolder if it doesn't yet exist - if (!$storage->folder_exists($folder, false)) { - if ($storage->create_folder($folder, true)) - $result['reload'] = true; + // we'll create all folders in the path + if (!in_array($folder, $folders)) { + if (empty($list)) { + $list = $storage->list_folders('', $archive_folder . '*', 'mail', null, true); + } + $path = explode($delimiter, $folder); + + for ($i=0; $i<count($path); $i++) { + $_folder = implode($delimiter, array_slice($path, 0, $i+1)); + if (!in_array($_folder, $list)) { + if ($storage->create_folder($_folder, true)) { + $result['reload'] = true; + $list[] = $_folder; + } + } + } + + $folders[] = $folder; } // move message to target folder @@ -192,7 +217,22 @@ class archive extends rcube_plugin $rcmail->output->show_message($this->gettext('archived'), 'confirmation'); } - $rcmail->output->command('plugin.move2archive_response', $result); + // refresh saved search set after moving some messages + if ($search_request && $rcmail->storage->get_search_set()) { + $_SESSION['search'] = $rcmail->storage->refresh_search(); + } + + if ($_POST['_from'] == 'show' && !empty($result['update'])) { + if ($next = get_input_value('_next_uid', RCUBE_INPUT_GPC)) { + $rcmail->output->command('show_message', $next); + } + else { + $rcmail->output->command('command', 'list'); + } + } + else { + $rcmail->output->command('plugin.move2archive_response', $result); + } } /** diff --git a/plugins/archive/composer.json b/plugins/archive/composer.json index 7826545b8..8a585ad09 100644 --- a/plugins/archive/composer.json +++ b/plugins/archive/composer.json @@ -3,12 +3,17 @@ "type": "roundcube-plugin", "description": "This adds a button to move the selected messages to an archive folder. The folder (and the optional structure of subfolders) can be selected in the settings panel.", "license": "GNU GPLv3+", - "version": "2.0", + "version": "2.1", "authors": [ { "name": "Thomas Bruederli", "email": "roundcube@gmail.com", "role": "Lead" + }, + { + "name": "Aleksander Machniak", + "email": "alec@alec.pl", + "role": "Developer" } ], "repositories": [ diff --git a/plugins/archive/package.xml b/plugins/archive/package.xml index 62a009a99..ec3323e4b 100644 --- a/plugins/archive/package.xml +++ b/plugins/archive/package.xml @@ -13,9 +13,15 @@ <email>roundcube@gmail.com</email> <active>yes</active> </lead> - <date>2013-01-20</date> + <lead> + <name>Aleksander Machniak</name> + <user>alec</user> + <email>alec@alec.pl</email> + <active>yes</active> + </lead> + <date>2013-10-30</date> <version> - <release>2.0</release> + <release>2.1</release> <api>2.0</api> </version> <stability> diff --git a/program/js/app.js b/program/js/app.js index bfae977b9..81b796ec1 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -1065,7 +1065,7 @@ function rcube_webmail() url = {_reply_uid: uid, _mbox: this.env.mailbox}; if (command == 'reply-all') // do reply-list, when list is detected and popup menu wasn't used - url._all = (!props && this.commands['reply-list'] ? 'list' : 'all'); + url._all = (!props && this.env.reply_all_mode == 1 && this.commands['reply-list'] ? 'list' : 'all'); else if (command == 'reply-list') url._all = 'list'; @@ -2742,9 +2742,6 @@ function rcube_webmail() } } - if (this.env.display_next && this.env.next_uid) - post_data._next_uid = this.env.next_uid; - if (count < 0) post_data._count = (count*-1); // remove threads from the end of the list @@ -2780,6 +2777,9 @@ function rcube_webmail() if (this.env.search_request) data._search = this.env.search_request; + if (this.env.display_next && this.env.next_uid) + data._next_uid = this.env.next_uid; + return data; }; diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 69ef2505c..8f221a3a9 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -493,6 +493,9 @@ $labels['standardwindows'] = 'Handle popups as standard windows'; $labels['forwardmode'] = 'Messages forwarding'; $labels['inline'] = 'inline'; $labels['asattachment'] = 'as attachment'; +$labels['replyallmode'] = 'Default action of [Reply all] button'; +$labels['replyalldefault'] = 'reply to all'; +$labels['replyalllist'] = 'reply to mailing list only (if found)'; $labels['folder'] = 'Folder'; $labels['folders'] = 'Folders'; diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 70441e0d7..3c1c2bb65 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -97,6 +97,7 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { $OUTPUT->set_env('delimiter', $delimiter); $OUTPUT->set_env('threading', $threading); $OUTPUT->set_env('threads', $threading || $RCMAIL->storage->get_capability('THREAD')); + $OUTPUT->set_env('reply_all_mode', (int) $RCMAIL->config->get('reply_all_mode')); $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); diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 38bb09c8d..c922aca08 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -869,6 +869,24 @@ function rcmail_user_prefs($current = null) $select_default_font_size->show($RCMAIL->config->get('default_font_size', 1)) ); } + + if (!isset($no_override['reply_all_mode'])) { + if (!$current) { + continue 2; + } + + $field_id = 'rcmfd_reply_all_mode'; + $select = new html_select(array('name' => '_reply_all_mode', 'id' => $field_id)); + + $select->add(rcube_label('replyalldefault'), 0); + $select->add(rcube_label('replyalllist'), 1); + + $blocks['main']['options']['reply_all_mode'] = array( + 'title' => html::label($field_id, Q(rcube_label('replyallmode'))), + 'content' => $select->show(intval($config['reply_all_mode'])), + ); + } + break; // Addressbook config diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc index 717c7ad8c..bcd05bb85 100644 --- a/program/steps/settings/save_prefs.inc +++ b/program/steps/settings/save_prefs.inc @@ -90,6 +90,7 @@ switch ($CURR_SECTION) 'strip_existing_sig' => isset($_POST['_strip_existing_sig']), 'default_font' => get_input_value('_default_font', RCUBE_INPUT_POST), 'default_font_size' => get_input_value('_default_font_size', RCUBE_INPUT_POST), + 'reply_all_mode' => intval($_POST['_reply_all_mode']), 'forward_attachment' => !empty($_POST['_forward_attachment']), ); diff --git a/skins/classic/functions.js b/skins/classic/functions.js index 4ad13136f..8d81c3ad2 100644 --- a/skins/classic/functions.js +++ b/skins/classic/functions.js @@ -625,7 +625,7 @@ prev_sibling: function(elm) enable_command: function(p) { - if (p.command == 'reply-list') { + if (p.command == 'reply-list' && rcmail.env.reply_all_mode == 1) { var label = rcmail.gettext(p.status ? 'replylist' : 'replyall'); $('a.button.replyAll').attr('title', label); } diff --git a/skins/classic/mail.css b/skins/classic/mail.css index 7f150714d..dce49b36f 100644 --- a/skins/classic/mail.css +++ b/skins/classic/mail.css @@ -989,6 +989,7 @@ table.messagelist.fixedcopy #listmenu { padding: 6px; + max-height: none; } #listmenu legend diff --git a/skins/larry/ui.js b/skins/larry/ui.js index d558f16a2..0fd0241f7 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -473,7 +473,7 @@ function rcube_mail_ui() function enable_command(p) { - if (p.command == 'reply-list') { + if (p.command == 'reply-list' && rcmail.env.reply_all_mode == 1) { var label = rcmail.gettext(p.status ? 'replylist' : 'replyall'); if (rcmail.env.action == 'preview') $('a.button.replyall').attr('title', label); |