Exemplo n.º 1
0
 /**
  * this builds an array containing the filters value and condition
  * @param string initial $value
  * @param string intial $condition
  * @param string eval - how the value should be handled
  * @return array (value condition)
  */
 function getFilterValue($value, $condition, $eval)
 {
     $value = $this->prepareFilterVal($value);
     $return = parent::getFilterValue($value, $condition, $eval);
     return $return;
 }
Exemplo n.º 2
0
 /**
  * this builds an array containing the filters value and condition
  * If no date time option, then we change the filter into a ranged filter to search
  * the whole day for records.
  * @param string initial $value
  * @param string intial $condition
  * @param string eval - how the value should be handled
  * @return array (value condition) values should be in mySQL format
  */
 function getFilterValue($value, $condition, $eval)
 {
     $params =& $this->getParams();
     $store_as_local = (int) $params->get('date_store_as_local', 0);
     if (!$params->get('date_showtime', 0) || $store_as_local) {
         $this->_resetToGMT = false;
     }
     $exactTime = $this->formatContainsTime($params->get('date_table_format'));
     $filterType =& $this->getElement()->filter_type;
     switch ($filterType) {
         case 'field':
         case 'dropdown':
             $mysql = $this->tableDateToMySQL($value);
             if ($mysql !== false) {
                 $value = $mysql;
             }
             if (!$params->get('date_showtime', 0) || $exactTime == false) {
                 //$$$ rob turn into a ranged filter to search the entire day
                 $value = (array) $value;
                 $condition = 'BETWEEN';
                 $value[1] = date("Y-m-d H:i:s", strtotime($this->addDays($value[0], 1)) - 1);
             }
             break;
         case 'ranged':
             $value = (array) $value;
             foreach ($value as &$v) {
                 $mysql = $this->tableDateToMySQL($v);
                 if ($mysql !== false) {
                     $v = $mysql;
                 }
             }
             break;
     }
     $this->_resetToGMT = true;
     return parent::getFilterValue($value, $condition, $eval);
 }