This option was meant to work around slowness/inadequacies of c-client.
Our Imap_Client library is much faster, so this should not be an issue
moving forward (if someone really wants to sort their 1,000,000 message
mailbox by thread, I guess that should be their option).
list of folders that can't be modified (deleted, renamed, etc) by the user,
e.g.: "Drafts, Trash". (The mailbox value must be encoded in the
UTF7-IMAP charset; see RFC 3501 [5.1.3])"/>
- <configinteger name="sort_limit" desc="On slower mailservers, sorting by any
- field other than the arrival of the message may result in very slow
- performance. This value, if greater than 0 is the number of messages
- that must be present in a mailbox before the default sort is replaced by
- the much faster arrival time sort.">0</configinteger>
<configboolean name="cache_folders" desc="If using IMAP, should we cache the
list of folders so that the list does not need to be rebuilt on every page
load? If set to true, note that any folders created on the server during an
v5.0-git
--------
+[mms] Remove 'sort_limit' configuration option.
[mms] Mobile view no longer supports WML output.
[jan] Implement iTip viewer actions in DIMP (Request #8061).
[mms] Display alarm notifications in DIMP (Request #6232).
The 'max_from_chars' and 'max_subj_chars' configuration options for the
minimal (mimp) display have been removed.
-The 'limit_factor' configuration option has been removed.
+The 'limit_factor' and 'sort_limit' configuration options have been removed.
Preferences
e.stop();
- // Don't change sort if we are past the sortlimit
- if (this.viewport.getMetaData('sortlimit')) {
- return;
- }
-
sortby = Number(sortby);
if (sortby == this.viewport.getMetaData('sortby')) {
s = { sortdir: (this.viewport.getMetaData('sortdir') ? 0 : 1) };
/* Toggle between Subject/Thread header. */
tmp = m.down('.msgSubject');
if (this.isSearch() ||
- this.viewport.getMetaData('nothread') ||
- this.viewport.getMetaData('sortlimit')) {
+ this.viewport.getMetaData('nothread')) {
togglesort.push({ l: 'subject', t: tmp });
} else if (sortby == ptr.get('thread').v) {
togglesort.push({ l: 'thread', s: 'subject', t: tmp });
var ImpMailbox = {
// The following variables are defined in mailbox.php:
- // sortlimit, unread
+ // unread
anySelected: function()
{
return;
}
- if (!this.sortlimit &&
- elt.match('TH') &&
+ if (elt.match('TH') &&
elt.up('TABLE.messageList')) {
document.location.href = elt.down('A').href;
}
* in the session).
*
* @return array An array with the following keys:
- * 'by' - Sort type (Horde_Imap_Client constant)
- * 'dir' - Sort direction
- * 'limit' - Was the sort limit reached?
+ * <pre>
+ * 'by' - (integer) Sort type (Horde_Imap_Client constant)
+ * 'dir' - (integer) Sort direction
+ * </pre>
*/
static public function getSort($mbox = null)
{
$ob = array(
'by' => isset($entry['b']) ? $entry['b'] : $sortby,
'dir' => isset($entry['d']) ? $entry['d'] : $GLOBALS['prefs']->getValue('sortdir'),
- 'limit' => false
);
/* Restrict POP3 sorting to arrival only. Although possible to
* download of all messages, which is too much overhead.*/
if ($_SESSION['imp']['protocol'] == 'pop') {
$ob['by'] = Horde_Imap_Client::SORT_ARRIVAL;
- $ob['limit'] = true;
return $ob;
}
$ob['by'] = Horde_Imap_Client::SORT_DATE;
}
- if (!$search_mbox &&
- !empty($GLOBALS['conf']['server']['sort_limit'])) {
- try {
- $status = $GLOBALS['imp_imap']->ob()->status($mbox, Horde_Imap_Client::STATUS_MESSAGES);
- if (isset($status['messages']) &&
- ($status['messages'] > $GLOBALS['conf']['server']['sort_limit'])) {
- $ob['limit'] = true;
- $ob['by'] = Horde_Imap_Client::SORT_ARRIVAL;
- }
- } catch (Horde_Imap_Client_Exception $e) {}
- }
-
- if (!$ob['limit']) {
- if (self::isSpecialFolder($mbox)) {
- /* If the preference is to sort by From Address, when we are
- * in the Drafts or Sent folders, sort by To Address. */
- if ($ob['by'] == Horde_Imap_Client::SORT_FROM) {
- $ob['by'] = Horde_Imap_Client::SORT_TO;
- }
- } elseif ($ob['by'] == Horde_Imap_Client::SORT_TO) {
- $ob['by'] = Horde_Imap_Client::SORT_FROM;
+ if (self::isSpecialFolder($mbox)) {
+ /* If the preference is to sort by From Address, when we are
+ * in the Drafts or Sent folders, sort by To Address. */
+ if ($ob['by'] == Horde_Imap_Client::SORT_FROM) {
+ $ob['by'] = Horde_Imap_Client::SORT_TO;
}
+ } elseif ($ob['by'] == Horde_Imap_Client::SORT_TO) {
+ $ob['by'] = Horde_Imap_Client::SORT_FROM;
}
return $ob;
/* Update the current array index to its new position in the message
* array. */
$this->setIndex(0, 'offset');
-
- /* If we have a sortlimit, it is possible the sort prefs will have
- * changed after messages are expunged. */
- if (!empty($GLOBALS['conf']['server']['sort_limit']) &&
- ($sortcount > $GLOBALS['conf']['server']['sort_limit']) &&
- (($sortcount - $msgcount) <= $GLOBALS['conf']['server']['sort_limit'])) {
- $this->_rebuild(true);
- }
}
/**
/* These entries may change during a session, so always need to
* update them. */
$md->readonly = intval($GLOBALS['imp_imap']->isReadOnly($mbox));
- if (!$is_search &&
- !empty($GLOBALS['conf']['server']['sort_limit'])) {
- $md->sortlimit = $sortpref['limit'] ? 1 : 0;
- }
/* Check for mailbox existence now. If there are no messages, there
* is a chance that the mailbox doesn't exist. If there is at least
'hdr_thread' => array(_("Thread"), Horde_Imap_Client::SORT_THREAD)
);
foreach ($hdr_list as $key => $val) {
- if ($search_mbox ||
- $sortpref['limit'] && ($key != 'hdr_arrival')) {
- $t->set($key, $val[0]);
+ $sort_link = $mailbox->copy()->add(array('a' => 'c', 'sb' => $val[1]));
+ if ($sortpref['by'] == $val[1]) {
+ $t->set($key, $val[0] . ' <a href="' . strval($sort_link->add('sd', intval(!$sortpref['dir']))) . '">' . ($sortpref['dir'] ? '^' : 'v') . '</a>');
} else {
- $sort_link = $mailbox->copy()->add(array('a' => 'c', 'sb' => $val[1]));
- if ($sortpref['by'] == $val[1]) {
- $t->set($key, $val[0] . ' <a href="' . strval($sort_link->add('sd', intval(!$sortpref['dir']))) . '">' . ($sortpref['dir'] ? '^' : 'v') . '</a>');
- } else {
- $t->set($key, '<a href="' . $sort_link . '">' . $val[0] . '</a>');
- }
+ $t->set($key, '<a href="' . $sort_link . '">' . $val[0] . '</a>');
}
}
/* Add thread header entry. */
-if (!$search_mbox &&
- !$sortpref['limit'] &&
- IMP::threadSortAvailable($mailbox)) {
+if (!$search_mbox && IMP::threadSortAvailable($mailbox)) {
if (is_null($imp_thread)) {
$t->set('hdr_subject_minor', $t->get('hdr_thread'));
} else {
} else {
$ptr['change_sort_link'] = null;
}
- if ($sortpref['limit']) {
- $ptr['sortlimit_text'] = Horde::stripAccessKey($val['text']);
- } else {
- $tmp = ($sortpref['by'] == $key) ? $sort_url : $mailbox_imp_url;
- $ptr['change_sort'] = addslashes($tmp->copy()->add(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)));
- $ptr['change_sort_widget'] = Horde::widget($tmp->copy()->add(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], 'widget', null, null, $val['text']);
- if (!isset($val['extra'])) {
- $ptr['extra'] = null;
- }
+
+ $tmp = ($sortpref['by'] == $key) ? $sort_url : $mailbox_imp_url;
+ $ptr['change_sort'] = addslashes($tmp->copy()->add(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)));
+ $ptr['change_sort_widget'] = Horde::widget($tmp->copy()->add(array('sortby' => $key, 'actionID' => 'change_sort', 'mailbox_token' => $mailbox_token)), $val['stext'], 'widget', null, null, $val['text']);
+ if (!isset($val['extra'])) {
+ $ptr['extra'] = null;
}
}
$mh_template->set('mailbox', htmlspecialchars($imp_mbox['mailbox']));
$mh_template->set('mailbox_token', $mailbox_token);
$mh_template->set('sessiontag', Horde_Util::formInput());
- $mh_template->set('sortlimit', $sortpref['limit']);
$mh_template->set('headers', $headers);
if (!$search_mbox) {
}
Horde::addInlineScript(array(
- 'ImpMailbox.sortlimit = ' . intval($sortpref['limit']),
'ImpMailbox.unread = ' . strval($unread)
));
</th>
</else:mh_count></if:mh_count>
<loop:headers>
-<th class="<tag:headers.class />" width="<tag:headers.width />">
- <tag:headers.change_sort_link /> <if:sortlimit><tag:headers.sortlimit_text /><else:sortlimit><tag:headers.change_sort_widget /> <tag:headers.extra /></else:sortlimit></if:sortlimit>
+ <th class="<tag:headers.class />" width="<tag:headers.width />">
+ <tag:headers.change_sort_link /> <tag:headers.change_sort_widget /> <tag:headers.extra />
</th>
</loop:headers>
</tr>