Merge branch 'dev/display_next' of https://github.com/alecpl/roundcubemail into alecpl-dev/display_next

pull/6832/head
Aleksander Machniak 5 years ago
commit 446ff50c57

@ -12,6 +12,10 @@ CHANGELOG Roundcube Webmail
- installto.sh: Add possibility to run the update even on the up-to-date installation (#6533)
- Plugin API: Add 'render_folder_selector' hook
- Added 'keyservers' option to define list of HKP servers for Enigma/Mailvelope (#6326)
- 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
- Put charset meta specification before a title tag, add page title automatically (#6811)
- Elastic: Add Prev/Next buttons on message page toolbar (#6648)

@ -1163,7 +1163,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'.

@ -3198,13 +3198,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
@ -3247,8 +3248,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
@ -3260,7 +3261,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();
@ -3278,11 +3280,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]);
@ -3466,7 +3470,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];
@ -3476,7 +3481,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);
@ -3485,7 +3490,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);
@ -6326,9 +6331,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);
}
@ -6484,12 +6491,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)
@ -6687,12 +6693,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();
}
};
@ -7268,7 +7278,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 record after 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