From 06103b2327ed267ca3965fc543b7afefc41220cc Mon Sep 17 00:00:00 2001 From: kurund Date: Wed, 1 Jan 2014 15:23:50 -0800 Subject: [PATCH] use create_date and modified_date instead of civicrm_log table CRM-12753 ---------------------------------------- * CRM-12753: Searching for contacts by date created http://issues.civicrm.org/jira/browse/CRM-12753 --- CRM/Contact/BAO/Query.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 22297656bc..ecff903636 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -3654,18 +3654,20 @@ WHERE id IN ( $groupIDs ) // CRM-11281, default to added date if not set $fieldTitle = ts('Added Date'); - + $fieldName = 'created_date'; foreach (array_keys($this->_params) as $id) { if ($this->_params[$id][0] == 'log_date') { if ($this->_params[$id][2] == 2) { $fieldTitle = ts('Modified Date'); + $fieldName = 'modified_date'; } } } - $this->dateQueryBuilder($values, - 'civicrm_log', 'log_date', 'modified_date', $fieldTitle - ); + + $this->dateQueryBuilder($values, 'contact_a', 'log_date', $fieldName, $fieldTitle); + + self::$_openedPanes[ts('Change Log')] = TRUE; } function demographics(&$values) { @@ -4744,16 +4746,6 @@ SELECT COUNT( civicrm_contribution.total_amount ) as cancel_count, $this->_tables[$tableName] = $this->_whereTables[$tableName] = 1; $this->_qill[$grouping][] = "$fieldTitle - $phrase \"$format\""; } - - if ( - $tableName == 'civicrm_log' && - $fieldTitle == ts('Added Date') - ) { - //CRM-6903 --hack to check modified date of first record. - //as added date means first modified date of object. - $addedDateQuery = 'select id from civicrm_log group by entity_id order by id'; - $this->_where[$grouping][] = "civicrm_log.id IN ( {$addedDateQuery} )"; - } } function numberRangeBuilder(&$values, -- 2.25.1