summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-11-28 19:03:24 +0000
committerthomascube <thomas@roundcube.net>2008-11-28 19:03:24 +0000
commit2fd975071a43147b054adaa857008f6ae2ee245f (patch)
tree71f60d8580ddff8656296e63c00fa86899b8db42
parent41b43ba00e9110e6f415014382e11af7fe381fcb (diff)
Option to check for new mails in all folders (#1484374)
-rw-r--r--CHANGELOG5
-rw-r--r--config/main.inc.php.dist3
-rw-r--r--program/localization/de_CH/labels.inc5
-rw-r--r--program/localization/de_DE/labels.inc5
-rw-r--r--program/localization/en_GB/labels.inc1
-rw-r--r--program/localization/en_US/labels.inc1
-rw-r--r--program/steps/mail/check_recent.inc26
-rw-r--r--program/steps/settings/func.inc9
-rw-r--r--program/steps/settings/save_prefs.inc1
9 files changed, 38 insertions, 18 deletions
diff --git a/CHANGELOG b/CHANGELOG
index b4042af49..95bab76fa 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,11 @@
CHANGELOG RoundCube Webmail
---------------------------
+2008/11/28 (thomasb)
+----------
+- Option to check for new mails in all folders (#1484374)
+- Don't set client busy when checking for new messages (#1485276)
+
2008/11/26 (alec)
----------
- Allow UTF-8 folder names in config (#1485579)
diff --git a/config/main.inc.php.dist b/config/main.inc.php.dist
index d9ef3d343..b2c005653 100644
--- a/config/main.inc.php.dist
+++ b/config/main.inc.php.dist
@@ -402,5 +402,8 @@ $rcmail_config['flag_for_deletion'] = FALSE;
// Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime'
$rcmail_config['keep_alive'] = 60;
+// If true all folders will be checked for recent messages
+$rcmail_config['check_all_folders'] = FALSE;
+
// end of config file
?>
diff --git a/program/localization/de_CH/labels.inc b/program/localization/de_CH/labels.inc
index 165122034..b05dcf729 100644
--- a/program/localization/de_CH/labels.inc
+++ b/program/localization/de_CH/labels.inc
@@ -122,6 +122,8 @@ $labels['select'] = 'Auswählen';
$labels['all'] = 'Alle';
$labels['none'] = 'Keine';
$labels['unread'] = 'Ungelesene';
+$labels['flagged'] = 'Markiert';
+$labels['unanswered'] = 'Unbeantwortet';
$labels['compact'] = 'Packen';
$labels['empty'] = 'Leeren';
$labels['purge'] = 'Aufräumen';
@@ -234,11 +236,12 @@ $labels['never'] = 'nie';
$labels['messagesdisplaying'] = 'Nachrichtendarstellung';
$labels['messagescomposition'] = 'Nachrichtenerstellung';
$labels['mimeparamfolding'] = 'Namen der Dateianhänge';
-$labels['2231folding'] = 'Vollständig RFC 2231 kompatibel (Mozilla Thunderbird)';
+$labels['2231folding'] = 'Vollständig RFC 2231 kompatibel (Thunderbird)';
$labels['miscfolding'] = 'RFC 2047/2231 kompatibel (Microsoft Outlook)';
$labels['2047folding'] = 'Vollständig RFC 2047 kompatibel (andere)';
$labels['advancedoptions'] = 'Erweiterte Einstellungen';
$labels['focusonnewmessage'] = 'Fokussiere Browserfenster bei neuen Nachrichten';
+$labels['checkallfolders'] = 'Alle Ordner auf neue Nachrichten prüfen';
$labels['folder'] = 'Ordner';
$labels['folders'] = 'Ordner';
$labels['foldername'] = 'Ordnername';
diff --git a/program/localization/de_DE/labels.inc b/program/localization/de_DE/labels.inc
index 1fba41c57..10636e0a0 100644
--- a/program/localization/de_DE/labels.inc
+++ b/program/localization/de_DE/labels.inc
@@ -121,6 +121,8 @@ $labels['select'] = 'Auswählen';
$labels['all'] = 'Alle';
$labels['none'] = 'Keine';
$labels['unread'] = 'Ungelesene';
+$labels['flagged'] = 'Markiert';
+$labels['unanswered'] = 'Unbeantwortet';
$labels['compact'] = 'Packen';
$labels['empty'] = 'Leeren';
$labels['purge'] = 'Bereinigen';
@@ -233,11 +235,12 @@ $labels['never'] = 'nie';
$labels['messagesdisplaying'] = 'Nachrichtendarstellung';
$labels['messagescomposition'] = 'Nachrichtenerstellung';
$labels['mimeparamfolding'] = 'Namen der Dateianhänge';
-$labels['2231folding'] = 'Vollständig RFC 2231 kompatibel (Mozilla Thunderbird)';
+$labels['2231folding'] = 'Vollständig RFC 2231 kompatibel (Thunderbird)';
$labels['miscfolding'] = 'RFC 2047/2231 kompatibel (Microsoft Outlook)';
$labels['2047folding'] = 'Vollständig RFC 2047 kompatibel (andere)';
$labels['advancedoptions'] = 'Erweiterte Einstellungen';
$labels['focusonnewmessage'] = 'Fokussiere Browserfenster bei neuen Nachrichten';
+$labels['checkallfolders'] = 'Alle Ordner auf neue Nachrichten prüfen';
$labels['folder'] = 'Ordner';
$labels['folders'] = 'Ordner';
$labels['foldername'] = 'Ordnername';
diff --git a/program/localization/en_GB/labels.inc b/program/localization/en_GB/labels.inc
index 48656c214..deecde1a8 100644
--- a/program/localization/en_GB/labels.inc
+++ b/program/localization/en_GB/labels.inc
@@ -233,6 +233,7 @@ $labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
$labels['2047folding'] = 'Full RFC 2047 (other)';
$labels['advancedoptions'] = 'Advanced options';
$labels['focusonnewmessage'] = 'Focus browser window on new message';
+$labels['checkallfolders'] = 'Check all folders for new messages';
$labels['messagesdisplaying'] = 'Displaying Messages';
$labels['messagescomposition'] = 'Composing Messages';
$labels['folder'] = 'Folder';
diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc
index 99ef6b0f3..142dd714c 100644
--- a/program/localization/en_US/labels.inc
+++ b/program/localization/en_US/labels.inc
@@ -295,6 +295,7 @@ $labels['miscfolding'] = 'RFC 2047/2231 (MS Outlook)';
$labels['2047folding'] = 'Full RFC 2047 (other)';
$labels['advancedoptions'] = 'Advanced options';
$labels['focusonnewmessage'] = 'Focus browser window on new message';
+$labels['checkallfolders'] = 'Check all folders for new messages';
$labels['folder'] = 'Folder';
$labels['folders'] = 'Folders';
diff --git a/program/steps/mail/check_recent.inc b/program/steps/mail/check_recent.inc
index 07313c156..35c15a2db 100644
--- a/program/steps/mail/check_recent.inc
+++ b/program/steps/mail/check_recent.inc
@@ -5,7 +5,7 @@
| program/steps/mail/check_recent.inc |
| |
| This file is part of the RoundCube Webmail client |
- | Copyright (C) 2005-2007, RoundCube Dev. - Switzerland |
+ | Copyright (C) 2005-2008, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
| |
| PURPOSE: |
@@ -20,13 +20,11 @@
*/
$a_mailboxes = $IMAP->list_mailboxes();
+$check_all = (bool)$RCMAIL->config->get('check_all_folders');
-foreach ($a_mailboxes as $mbox_name)
- {
- if ($mbox_name == $IMAP->get_mailbox_name())
- {
- if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE))
- {
+foreach ($a_mailboxes as $mbox_name) {
+ if ($mbox_name == $IMAP->get_mailbox_name()) {
+ if ($recent_count = $IMAP->messagecount(NULL, 'RECENT', TRUE)) {
// refresh saved search set
if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $IMAP->search_set)
$_SESSION['search'][$search_request] = $IMAP->refresh_search();
@@ -47,7 +45,7 @@ foreach ($a_mailboxes as $mbox_name)
// add new message headers to list
$a_headers = array();
for ($i=$recent_count, $id=$count_all-$recent_count+1; $i>0; $i--, $id++)
- {
+ {
// skip message if it does not match the current search
if (!$IMAP->in_searchset($id))
continue;
@@ -55,17 +53,15 @@ foreach ($a_mailboxes as $mbox_name)
$header = $IMAP->get_headers($id, NULL, FALSE);
if ($header->recent)
$a_headers[] = $header;
- }
+ }
rcmail_js_message_list($a_headers, TRUE);
- }
- }
- else
- {
- if ($IMAP->messagecount($mbox_name, 'RECENT'))
- $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN'));
}
}
+ else if ($IMAP->messagecount($mbox_name, 'RECENT', $check_all)) {
+ $OUTPUT->command('set_unread_count', $mbox_name, $IMAP->messagecount($mbox_name, 'UNSEEN', $check_all));
+ }
+}
$OUTPUT->send();
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 980108ad9..6a158b9e9 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -181,7 +181,7 @@ function rcmail_user_prefs_form($attrib)
foreach(array(1, 3, 5, 10, 15, 30, 60) as $min)
if((!$config['min_keep_alive'] || $config['min_keep_alive'] <= $min * 60)
- && (!$config['session_lifetime'] || $config['session_lifetime'] > $min)) {
+ && (!$config['session_lifetime'] || $config['session_lifetime'] > $min)) {
$select_keep_alive->add(rcube_label(array('name' => 'keepaliveevery', 'vars' => array('n' => $min))), $min);
}
@@ -189,6 +189,13 @@ function rcmail_user_prefs_form($attrib)
$table->add(null, $select_keep_alive->show($config['keep_alive']/60));
}
+ if (!isset($no_override['check_all_folders'])) {
+ $field_id = 'rcmfd_check_all_folders';
+ $input_check_all = new html_checkbox(array('name' => '_check_all_folders', 'id' => $field_id, 'value' => 1));
+ $table->add('title', html::label($field_id, Q(rcube_label('checkallfolders'))));
+ $table->add(null, $input_check_all->show($config['check_all_folders']?1:0));
+ }
+
$out .= html::tag('fieldset', null, html::tag('legend', null, Q(rcube_label('mailboxview'))) . $table->show($attrib));
$table = new html_table(array('cols' => 2));
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index debd345e3..023ffff36 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -38,6 +38,7 @@ $a_user_prefs = array(
'logout_expunge' => isset($_POST['_logout_expunge']) ? TRUE : FALSE,
'draft_autosave' => isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0,
'keep_alive' => isset($_POST['_keep_alive']) ? intval($_POST['_keep_alive'])*60 : $CONFIG['keep_alive'],
+ 'check_all_folders' => isset($_POST['_check_all_folders']) ? TRUE : FALSE,
'mime_param_folding' => isset($_POST['_mime_param_folding']) ? intval($_POST['_mime_param_folding']) : 0,
'mdn_requests' => isset($_POST['_mdn_requests']) ? intval($_POST['_mdn_requests']) : 0,
'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'],