v5.0-git
--------
+[mms] Add advanced search query interface to DIMP (Request #6875).
[mms] Add ability to search by a custom defined header (Request #6875).
[mms] Improved advanced search query interface (Request #6875).
[mms] More intelligent ordering of autocomplete search results.
}
switch (loc) {
+ case 'search':
+ this.highlightSidebar();
+ DimpCore.setTitle(DIMP.text.search);
+ this.iframeContent(loc, DimpCore.addURLParam(DIMP.conf.URI_SEARCH, { search_mailbox: this.folder }));
+ break;
+
case 'portal':
this.highlightSidebar('appportal');
this._addHistory(loc);
var curr = $('sidebarPanel').down('.on'),
elt = $(id);
- if (!elt || curr == elt) {
+ if (curr == elt) {
return;
}
- if (!elt.match('LI')) {
+ if (elt && !elt.match('LI')) {
elt = elt.up();
if (!elt) {
return;
if (curr) {
curr.removeClassName('on');
}
- elt.addClassName('on');
- this._toggleSubFolder(elt, 'exp');
+ if (elt) {
+ elt.addClassName('on');
+ this._toggleSubFolder(elt, 'exp');
+ }
},
iframeContent: function(name, loc)
break;
case 'ctx_qsearchopts_advanced':
- alert('Placeholder for advanced search');
+ this.go('search');
break;
case 'ctx_qsearchopts_all':
var elt, unseen,
label = this.viewport.getMetaData('label');
- if (this.isSearch()) {
+ if (this.isSearch() && this.sfolder) {
label += ' (' + this.sfolder + ')';
} else {
elt = $(this.getFolderId(this.folder));
$charset = Horde_Nls::getCharset();
$criteria = Horde_Util::getFormData('criteria_form');
+$dimp_view = ($_SESSION['imp']['view'] == 'dimp');
$search_fields = $imp_search->searchFields();
/* Generate the search query if 'criteria_form' is present in the form
}
/* Redirect to the mailbox page. */
- header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('mailbox.php', true), array('mailbox' => $GLOBALS['imp_search']->createSearchID($id)), null, false));
+ $id = $GLOBALS['imp_search']->createSearchID($id);
+ if ($dimp_view) {
+ /* Output javascript code to close the IFRAME and load the search
+ * mailbox in DIMP. */
+ print '<html><head>' .
+ Horde::wrapInlineScript(array('window.parent.DimpBase.go(' . Horde_Serialize::serialize('folder:' . $id, Horde_Serialize::JSON, $charset) . ')')) .
+ '</head></html>';
+ } else {
+ header('Location: ' . Horde_Util::addParameter(Horde::applicationUrl('mailbox.php', true), array('mailbox' => $$id), null, false));
+ }
exit;
}
$title = _("Search");
Horde::addScriptFile('horde.js', 'horde', true);
Horde::addScriptFile('search.js', 'imp', true);
-IMP::prepareMenu();
+if (!$dimp_view) {
+ IMP::prepareMenu();
+}
require IMP_TEMPLATES . '/common-header.inc';
-IMP::menu();
+if (!$dimp_view) {
+ IMP::menu();
+}
IMP::status();
echo $t->fetch(IMP_TEMPLATES . '/search/search.html');
'URI_PREFS' => Horde::getServiceLink('prefsapi', 'imp'),
'URI_PREFS_IMP' => str_replace('&', '&', Horde::getServiceLink('options', 'imp')),
'URI_SEARCH_BASIC' => Horde::applicationUrl('search-basic.php'),
+ 'URI_SEARCH' => Horde::applicationUrl('search.php'),
'URI_VIEW' => Horde::applicationUrl('view.php'),
'SESSION_ID' => defined('SID') ? SID : '',