summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/mail/list.inc16
-rw-r--r--program/steps/mail/search.inc44
2 files changed, 29 insertions, 31 deletions
diff --git a/program/steps/mail/list.inc b/program/steps/mail/list.inc
index 277564c38..4b2a955b7 100644
--- a/program/steps/mail/list.inc
+++ b/program/steps/mail/list.inc
@@ -75,6 +75,22 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'])
&& $_SESSION['search_request'] == $_REQUEST['_search']
) {
$_SESSION['search'] = $RCMAIL->storage->get_search_set();
+
+ // multi-folder search
+ if ($_SESSION['search'][1]->multi) {
+ if (empty($cols))
+ $cols = $_SESSION['list_attrib']['columns'] ? $_SESSION['list_attrib']['columns'] : (array)$CONFIG['list_cols'];
+ if (!in_array('folder', $cols))
+ $cols[] = 'folder'; // Add 'folder' column to list
+
+ // make message UIDs unique by appending the folder name
+ foreach ($a_headers as $i => $header) {
+ $header->uid .= '-'.$header->folder;
+ $header->flags['skip_mbox_check'] = true;
+ if ($header->parent_uid)
+ $header->parent_uid .= '-'.$header->folder;
+ }
+ }
}
// remove old search data
else if (empty($_REQUEST['_search']) && isset($_SESSION['search'])) {
diff --git a/program/steps/mail/search.inc b/program/steps/mail/search.inc
index 67fee755d..5ce9fe6e2 100644
--- a/program/steps/mail/search.inc
+++ b/program/steps/mail/search.inc
@@ -111,7 +111,7 @@ $mboxes = $RCMAIL->storage->list_folders_subscribed('', '*', 'mail');
// execute IMAP search
if ($search_str) {
- $RCMAIL->storage->search($mbox, $search_str, $imap_charset, $sort_column);
+ $RCMAIL->storage->search($mboxes, $search_str, $imap_charset, $sort_column);
}
// save search results in session
@@ -125,43 +125,25 @@ if ($search_str) {
}
$_SESSION['search_request'] = $search_request;
-
// Get the headers
$result_h = $RCMAIL->storage->list_messages($mbox, 1, $sort_column, rcmail_sort_order());
$count = $RCMAIL->storage->count($mbox, $RCMAIL->storage->get_threading() ? 'THREADS' : 'ALL');
// Add 'folder' column to list
if ($_SESSION['search'][1]->multi) {
- $a_show_cols = $_SESSION['list_attrib']['columns'] ? $_SESSION['list_attrib']['columns'] : (array)$CONFIG['list_cols'];
- if (!in_array('folder', $a_show_cols))
- $a_show_cols[] = 'folder';
-
- // make message UIDs unique by appending the folder name
- foreach ($result_h as $i => $header) {
- $header->uid .= '-'.$header->folder;
- $header->flags['skip_mbox_check'] = true;
- if ($header->parent_uid)
- $header->parent_uid .= '-'.$header->folder;
- }
-
- $OUTPUT->command('select_folder', '');
-}
+ $a_show_cols = $_SESSION['list_attrib']['columns'] ? $_SESSION['list_attrib']['columns'] : (array)$CONFIG['list_cols'];
+ if (!in_array('folder', $a_show_cols))
+ $a_show_cols[] = 'folder';
+
+ // make message UIDs unique by appending the folder name
+ foreach ($result_h as $i => $header) {
+ $header->uid .= '-'.$header->folder;
+ $header->flags['skip_mbox_check'] = true;
+ if ($header->parent_uid)
+ $header->parent_uid .= '-'.$header->folder;
+ }
-// Add 'folder' column to list
-if ($_SESSION['search'][1]->multi) {
- $a_show_cols = $_SESSION['list_attrib']['columns'] ? $_SESSION['list_attrib']['columns'] : (array)$CONFIG['list_cols'];
- if (!in_array('folder', $a_show_cols))
- $a_show_cols[] = 'folder';
-
- // make message UIDs unique by appending the folder name
- foreach ($result_h as $i => $header) {
- $header->uid .= '-'.$header->folder;
- $header->flags['skip_mbox_check'] = true;
- if ($header->parent_uid)
- $header->parent_uid .= '-'.$header->folder;
- }
-
- $OUTPUT->command('select_folder', '');
+ $OUTPUT->command('select_folder', '');
}
// Make sure we got the headers