Fix basic search.
Fix since/equals/before searching.
calendarSelectHandler: function(e)
{
- var elt = e.element();
- this.replaceDate(elt.up('TR').identify(), this.criteria[elt.identify()], e.memo);
+ var id = e.findElement('TR').identify();
+ this.replaceDate(id, this.criteria[id].t, e.memo);
}
};
'not' => true
),
'date_on' => array(
- 'label' => _("Date ="),
+ 'label' => _("Date Equals (=)"),
'type' => 'date',
'not' => true
),
'date_until' => array(
- 'label' => _("Date <"),
+ 'label' => _("Date Until (<)"),
'type' => 'date',
'not' => true
),
'date_since' => array(
- 'label' => _("Date >="),
+ 'label' => _("Date Since (>=)"),
'type' => 'date',
'not' => true
),
break;
case 'date':
- $text_array[] = sprintf("%s '%s'", $searchfields[$field]['label'], strftime("%x", mktime(0, 0, 0, $rule->v->m + 1, $rule->v->d, $rule->v->y)));
+ $date_ob = new Horde_Date($rule->v);
+ $text_array[] = sprintf("%s '%s'", $searchfields[$field]['label'], $date_ob->strftime("%x"));
break;
case 'within':
case 'date':
if (!empty($rule->v)) {
- $date = new Horde_Date(array('year' => $rule->v->y, 'month' => $rule->v->m + 1, 'mday' => $rule->v->d));
+ $date = new Horde_Date($rule->v);
$ob->dateSearch($date, ($rule->t == 'date_on') ? Horde_Imap_Client_Search_Query::DATE_ON : (($rule->t == 'date_until') ? Horde_Imap_Client_Search_Query::DATE_BEFORE : Horde_Imap_Client_Search_Query::DATE_SINCE));
$search_array[] = $ob;
}
require_once dirname(__FILE__) . '/lib/Application.php';
Horde_Registry::appInit('imp');
+/* This is an IMP-only script. */
+if ($_SESSION['imp']['view'] != 'imp') {
+ exit;
+}
+
if ($_SESSION['imp']['protocol'] == 'pop') {
- if ($_SESSION['imp']['view'] == 'imp') {
- $notification->push(_("Searching is not available with a POP3 server."), 'horde.error');
- $from_message_page = true;
- $actionID = $start = null;
- require_once IMP_BASE . '/mailbox.php';
- }
+ $notification->push(_("Searching is not available with a POP3 server."), 'horde.error');
+ $from_message_page = true;
+ $actionID = $start = null;
+ require_once IMP_BASE . '/mailbox.php';
exit;
}
$vars = Horde_Variables::getDefaultVariables();
/* If search_basic_mbox is set, we are processing the search query. */
-if ($vars->search_mailbox) {
+if ($vars->search_basic_mailbox) {
$imp_ui_search = new IMP_Ui_Search();
$id = $imp_ui_search->processBasicSearch($vars->search_mailbox, $vars->search_criteria, $vars->search_criteria_text, $vars->search_criteria_not, $vars->search_flags);