Changes in `display_next` setting (#6795)

- Move it to Preferences > User Interface > Main Options
- Make it apply to Contacts interface too
- Make it apply only if deleting/moving a previewed message/contact
pull/6799/head
Aleksander Machniak 5 years ago
parent ed9da6cb7f
commit 22a47cced6

@ -9,6 +9,10 @@ CHANGELOG Roundcube Webmail
- Support $HasAttachment/$HasNoAttachment keywords (#6201)
- Support PECL memcached extension as a session and cache storage driver (experimental)
- installto.sh: Add possibility to run the update even on the up-to-date installation (#6533)
- Changes in `display_next` setting (#6795):
- Move it to Preferences > User Interface > Main Options
- Make it apply to Contacts interface too
- Make it apply only if deleting/moving a previewed message/contact
- Redis: Support connection to unix socket
- Elastic: Add Prev/Next buttons on message page toolbar (#6648)
- Elastic: Close search options on Enter key press in quick-search input (#6660)

@ -1159,7 +1159,7 @@ $config['refresh_interval'] = 60;
// If true all folders will be checked for recent messages
$config['check_all_folders'] = false;
// If true, after message delete/move, the next message will be displayed
// If true, after message/contact delete/move, the next message/contact will be displayed
$config['display_next'] = true;
// Default messages listing mode. One of 'threads' or 'list'.

@ -3203,13 +3203,14 @@ function rcube_webmail()
// show wait message
if (this.env.action == 'show')
lock = this.set_busy(true, 'movingmessage');
else
this.show_contentframe(false);
// Hide message command buttons until a message is selected
this.enable_command(this.env.message_commands, false);
this.with_selected_messages('move', post_data, lock);
if (this.env.action != 'show')
this.show_contentframe(false);
};
// delete selected messages from the current mailbox
@ -3252,8 +3253,8 @@ function rcube_webmail()
if (!post_data._uid)
return;
this.show_contentframe(false);
this.with_selected_messages('delete', post_data);
this.show_contentframe(false);
};
// Send a specific move/delete request with UIDs of all selected messages
@ -3265,7 +3266,8 @@ function rcube_webmail()
// update the list (remove rows, clear selection)
if (this.message_list) {
var n, len, id, root, roots = [],
selection = post_data._uid;
selection = post_data._uid,
display_next = this.env.display_next && this.preview_id;
if (selection === '*')
selection = this.message_list.get_selection();
@ -3283,11 +3285,13 @@ function rcube_webmail()
}
}
if (remove)
this.message_list.remove_row(id, (this.env.display_next && n == selection.length-1));
this.message_list.remove_row(id, display_next && n == selection.length-1);
}
// make sure there are no selected rows
if (!this.env.display_next && remove)
if (!display_next && remove)
this.message_list.clear_selection();
// update thread tree icons
for (n=0, len=roots.length; n<len; n++) {
this.add_tree_icons(roots[n]);
@ -3471,7 +3475,8 @@ function rcube_webmail()
lock = this.display_message('markingmessage', 'loading'),
list = this.message_list,
rows = list ? list.rows : {},
count = 0;
count = 0,
display_next = this.env.display_next && this.preview_id;
for (var i=0, len=a_uids.length; i<len; i++) {
uid = a_uids[i];
@ -3481,7 +3486,7 @@ function rcube_webmail()
if (this.env.skip_deleted) {
count += this.update_thread(uid);
list.remove_row(uid, (this.env.display_next && i == list.get_selection(false).length-1));
list.remove_row(uid, display_next && i == list.get_selection(false).length-1);
}
else
this.set_message(uid, 'deleted', true);
@ -3490,7 +3495,7 @@ function rcube_webmail()
// make sure there are no selected rows
if (this.env.skip_deleted && list) {
if (!this.env.display_next || !list.rowcount)
if (!display_next || !list.rowcount)
list.clear_selection();
if (count < 0)
post_data._count = (count*-1);
@ -6336,9 +6341,11 @@ function rcube_webmail()
if (this.env.search_request)
url._search = this.env.search_request;
if (cid)
url._cid = this.preview_id = cid;
url._action = action;
url._source = this.env.source;
url._cid = cid;
this.location_href(url, target, true);
}
@ -6494,12 +6501,11 @@ function rcube_webmail()
for (n=0; n<selection.length; n++) {
id = selection[n];
a_cids.push(id);
this.contact_list.remove_row(id, (n == selection.length-1));
this.contact_list.remove_row(id, this.env.display_next && this.preview_id && n == selection.length-1);
}
// hide content frame if we delete the currently displayed contact
if (selection.length == 1)
this.show_contentframe(false);
if (!this.env.display_next)
this.contact_list.clear_selection();
}
if (!post_data)
@ -6697,12 +6703,16 @@ function rcube_webmail()
this.remove_group_contacts = function(props)
{
if (this.env.group !== undefined && (this.env.group === props.gid)) {
var n, selection = this.contact_list.get_selection();
var n, selection = this.contact_list.get_selection(),
display_next= this.env.display_next && this.preview_id;
for (n=0; n<selection.length; n++) {
id = selection[n];
this.contact_list.remove_row(id, (n == selection.length-1));
this.contact_list.clear_selection();
this.contact_list.remove_row(id, display_next && n == selection.length-1);
}
if (!display_next)
this.contact_list.clear_selection();
}
};
@ -7278,7 +7288,7 @@ function rcube_webmail()
if (list && id) {
list.remove_row(rid);
this.show_contentframe(false);
this.show_contentframe(false);
}
this.enable_command('delete', false);

@ -360,9 +360,7 @@ remove_row: function(uid, sel_next)
node.style.display = 'none';
// Specify removed row uid in the select_next argument.
// It's needed because after removing a set of rows
// reference to the last selected message is lost.
// Select next row before deletion, because we need the reference
if (sel_next)
this.select_next(uid);

@ -566,7 +566,7 @@ $labels['advancedoptions'] = 'Advanced options';
$labels['toggleadvancedoptions'] = 'Toggle advanced options';
$labels['focusonnewmessage'] = 'Focus browser window on new message';
$labels['checkallfolders'] = 'Check all folders for new messages';
$labels['displaynext'] = 'After message delete/move display the next message';
$labels['displaynext'] = 'Display next after record delete/move';
$labels['defaultfont'] = 'Default font of HTML message';
$labels['mainoptions'] = 'Main Options';
$labels['browseroptions'] = 'Browser Options';

@ -76,14 +76,15 @@ if (!$RCMAIL->action && !$OUTPUT->ajax_call) {
}
}
$search_mods = $RCMAIL->config->get('addressbook_search_mods', $SEARCH_MODS_DEFAULT);
$OUTPUT->set_env('search_mods', $search_mods);
$OUTPUT->set_env('display_next', (bool) $RCMAIL->config->get('display_next'));
$OUTPUT->set_env('search_mods', $RCMAIL->config->get('addressbook_search_mods', $SEARCH_MODS_DEFAULT));
$OUTPUT->set_env('address_sources', $js_list);
$OUTPUT->set_env('writable_source', $writeable);
$OUTPUT->set_env('contact_move_enabled', $writeable > 1);
$OUTPUT->set_env('contact_copy_enabled', $writeable > 1 || ($writeable == 1 && count($js_list) > 1));
$OUTPUT->set_pagetitle($RCMAIL->gettext('contacts'));
$_SESSION['addressbooks_count'] = $count;
$_SESSION['addressbooks_count_writeable'] = $writeable;

@ -281,6 +281,21 @@ function rcmail_user_prefs($current = null)
);
}
// "display after delete" checkbox
if (!isset($no_override['display_next'])) {
if (!$current) {
continue 2;
}
$field_id = 'rcmfd_displaynext';
$input = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['display_next'] = array(
'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('displaynext'))),
'content' => $input->show($config['display_next']?1:0),
);
}
if (!isset($no_override['refresh_interval'])) {
if (!$current) {
continue 2;
@ -604,21 +619,6 @@ function rcmail_user_prefs($current = null)
'content' => $input->show($config['inline_images']?1:0),
);
}
// "display after delete" checkbox
if (!isset($no_override['display_next'])) {
if (!$current) {
continue 2;
}
$field_id = 'rcmfd_displaynext';
$input = new html_checkbox(array('name' => '_display_next', 'id' => $field_id, 'value' => 1));
$blocks['main']['options']['display_next'] = array(
'title' => html::label($field_id, rcube::Q($RCMAIL->gettext('displaynext'))),
'content' => $input->show($config['display_next']?1:0),
);
}
break;
// Mail composition

@ -31,6 +31,7 @@ case 'general':
'date_format' => rcmail_prefs_input('date_format', '/^[a-zA-Z_.\/ -]+$/'),
'time_format' => rcmail_prefs_input('time_format', '/^[a-zA-Z0-9: ]+$/'),
'prettydate' => isset($_POST['_pretty_date']),
'display_next' => isset($_POST['_display_next']),
'refresh_interval' => intval($_POST['_refresh_interval']) * 60,
'standard_windows' => isset($_POST['_standard_windows']),
'skin' => rcmail_prefs_input('skin', '/^[a-zA-Z0-9_.-]+$/'),
@ -63,7 +64,6 @@ case 'mailview':
'prefer_html' => isset($_POST['_prefer_html']),
'inline_images' => isset($_POST['_inline_images']),
'show_images' => intval($_POST['_show_images']),
'display_next' => isset($_POST['_display_next']),
'default_charset' => rcmail_prefs_input('default_charset', '/^[a-zA-Z0-9-]+$/'),
);

Loading…
Cancel
Save