return $result;
}
-function _changed($mbox, $compare, $rw = null)
+function _changed($mbox, $compare, $action, $rw = null)
{
- if ($GLOBALS['imp_search']->isVFolder($mbox)) {
- return true;
+ /* Only update search mailboxes on forced refreshes. */
+ if ($GLOBALS['imp_search']->isSearchMbox($mbox)) {
+ return ($action == 'ViewPort') || Horde_Util::getPost('forceUpdate');
}
/* We know we are going to be dealing with this mailbox, so select it on
$changed = false;
if (!empty($mbox)) {
- $changed =_changed($mbox, $cacheid);
+ $changed =_changed($mbox, $cacheid, $action);
if ($changed) {
$result->ViewPort = _getListMessages($mbox, true);
}
IMP::setSort($sortby, $sortdir, $mbox);
}
- $changed = _changed($mbox, $cacheid, false);
+ $changed = _changed($mbox, $cacheid, $action, false);
if (is_null($changed)) {
$list_msg = new IMP_Views_ListMessages();
}
$change = ($action == 'MoveMessage')
- ? _changed($mbox, $cacheid, true)
+ ? _changed($mbox, $cacheid, $action, true)
: false;
if (!is_null($change)) {
}
$imp_message = IMP_Message::singleton();
- $change = _changed($mbox, $cacheid, true);
+ $change = _changed($mbox, $cacheid, $action, true);
if ($imp_message->delete($indices)) {
$result = _generateDeleteResult($mbox, $indices, $change, !$prefs->getValue('hide_deleted') && !$prefs->getValue('use_trash'));
break;
case 'ReportSpam':
- $change = _changed($mbox, $cacheid, false);
+ $change = _changed($mbox, $cacheid, $action, false);
if (IMP_Spam::reportSpam($indices, Horde_Util::getPost('spam') ? 'spam' : 'notspam')) {
$result = _generateDeleteResult($mbox, $indices, $change);
$imp_filter = new IMP_Filter();
if (Horde_Util::getPost('blacklist')) {
- $change = _changed($mbox, $cacheid, false);
+ $change = _changed($mbox, $cacheid, $action, false);
if (!is_null($change)) {
try {
if ($imp_filter->blacklistMessage($indices, false)) {
break;
case 'PurgeDeleted':
- $change = _changed($mbox, $cacheid, $indices);
+ $change = _changed($mbox, $cacheid, $action, $indices);
if (!is_null($change)) {
if (!$change) {
$sort = IMP::getSort($mbox);
v5.0-git
--------
+[mms] Only update search mailbox on explicit user action (Request #7297).
[mms] Add auto-save draft to IMP (Request #7656).
[mms] Add keyboard shortcut to move to next unseen message (Request #8223).
[mms] Add hook to dynamically change mailbox label (Request #6734).
this.folder = f;
- if (this.isSearch(f) &&
- (!this.search || this.search.flag)) {
- this._quicksearchDeactivate(!this.search);
+ if (this.isSearch(f)) {
+ if (!this.search || this.search.flag) {
+ this._quicksearchDeactivate(!this.search);
+ }
+ $('refreshlink').show();
+ } else {
+ $('refreshlink').hide();
}
}
}
},
/* Folder list updates. */
- poll: function()
+ poll: function(force)
{
- var args = {};
+ var args = {},
+ check = 'checkmaillink';
// Reset poll folder counter.
this.setPoll();
this.viewport.getMetaData('label')) {
args = this.viewport.addRequestParams({});
}
- $('checkmaillink').down('A').update('[' + DIMP.text.check + ']');
+
+ if (force) {
+ args.set('forceUpdate', 1);
+ check = 'refreshlink';
+ }
+
+ $(check).down('A').update('[' + DIMP.text.check + ']');
DimpCore.doAction('Poll', args);
},
}
$('checkmaillink').down('A').update(DIMP.text.getmail);
+ if ($('refreshlink').visible()) {
+ $('refreshlink').down('A').update(DIMP.text.refresh);
+ }
},
_displayQuota: function(r)
return;
case 'checkmaillink':
- this.poll();
+ case 'refreshlink':
+ this.poll(id == 'refreshlink');
e.stop();
return;
/* Store these text strings for updating purposes. */
DIMP.text.getmail = $('checkmaillink').down('A').innerHTML;
+ DIMP.text.refresh = $('refreshlink').down('A').innerHTML;
DIMP.text.showalog = $('alertsloglink').down('A').innerHTML;
/* Initialize the starting page. */
$imp_flags = IMP_Imap_Flags::singleton();
$flag_list = $imp_flags->getList(array('imap' => true));
-function _simpleButton($id, $text, $image)
+function _simpleButton($id, $text, $image, $nodisplay = false)
{
$ak = Horde::getAccessKey($text, true);
return '<li class="servicelink"' .
(strlen($id) ? ' id="' . $id . '"' : '') .
- (strlen($ak) ? ' accesskey="' . $ak . '"' : '') . '>' .
+ (strlen($ak) ? ' accesskey="' . $ak . '"' : '') .
+ ($nodisplay ? ' style="display:none"' : '') . '>' .
'<span class="iconSpan ' . $image . '"></span>' .
'<a>' . Horde::highlightAccessKey($text, $ak) . '</a></li>';
}
<ul id="dimpbarActions">
<?php echo _simpleButton('composelink', _("_New Message"), 'dimpactionCompose') ?>
<?php echo _simpleButton('checkmaillink', _("_Get Mail"), 'dimpactionCheckmail') ?>
+ <?php echo _simpleButton('refreshlink', _("_Refresh Search"), 'dimpactionRefresh', true) ?>
<?php echo _simpleButton('alertsloglink', _("Alerts _Log"), 'infoIcon') ?>
<?php if (!empty($_SESSION['imp']['filteravail'])): ?>
<?php echo _simpleButton('applyfilterlink', _("Apply Filters"), 'filtersIcon') ?>
span.dimpactionCheckmail {
background-image: url("graphics/checkmail.png");
}
+span.dimpactionRefresh {
+ background-image: url("graphics/reload.png");
+}
span.dimpactionDelete {
background-image: url("graphics/delete.png");
}
span.dimpactionCheckmail {
background-image: url("graphics/checkmail.png");
}
+span.dimpactionRefresh {
+ background-image: url("graphics/reload.png");
+}
span.dimpactionDelete {
background-image: url("graphics/delete.png");
}