From: eileen Date: Mon, 4 Nov 2019 04:56:19 +0000 (+1300) Subject: Remove 'recode handling X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=afbe25c172db77637bf825e3a0e2ce8e058d0340;p=civicrm-core.git Remove 'recode handling --- diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index bc127ac765..6601418650 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -6369,6 +6369,7 @@ AND displayRelType.is_active = 1 * * @return string * list(string $orderByClause, string $additionalFromClause). + * * @throws \CRM_Core_Exception */ protected function prepareOrderBy($sort, $sortOrder) { diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index 2819b8d04b..bea1cf5639 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -417,47 +417,26 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_ * @param string $fieldName * @param string $op * @param array|string|int $value + * + * @throws \CiviCRM_API3_Exception */ public static function decodeRelativeFields(&$formValues, $fieldName, $op, $value) { // check if its a custom date field, if yes then 'searchDate' format the value - $isCustomDateField = CRM_Contact_BAO_Query::isCustomDateField($fieldName); - - // select date range as default - if ($isCustomDateField) { - if (array_key_exists('relative_dates', $formValues) && array_key_exists($fieldName, $formValues['relative_dates'])) { - $formValues[$fieldName . '_relative'] = $formValues['relative_dates'][$fieldName]; - } - else { - $formValues[$fieldName . '_relative'] = 0; - } + if (CRM_Contact_BAO_Query::isCustomDateField($fieldName)) { + return; } + switch ($op) { case 'BETWEEN': - if ($isCustomDateField) { - list($formValues[$fieldName . '_from'], $formValues[$fieldName . '_from_time']) = CRM_Utils_Date::setDateDefaults($value[0], 'searchDate'); - list($formValues[$fieldName . '_to'], $formValues[$fieldName . '_to_time']) = CRM_Utils_Date::setDateDefaults($value[1], 'searchDate'); - } - else { - list($formValues[$fieldName . '_from'], $formValues[$fieldName . '_to']) = $value; - } + list($formValues[$fieldName . '_from'], $formValues[$fieldName . '_to']) = $value; break; case '>=': - if ($isCustomDateField) { - list($formValues[$fieldName . '_from'], $formValues[$fieldName . '_from_time']) = CRM_Utils_Date::setDateDefaults($value, 'searchDate'); - } - else { - $formValues[$fieldName . '_from'] = $value; - } + $formValues[$fieldName . '_from'] = $value; break; case '<=': - if ($isCustomDateField) { - list($formValues[$fieldName . '_to'], $formValues[$fieldName . '_to_time']) = CRM_Utils_Date::setDateDefaults($value, 'searchDate'); - } - else { - $formValues[$fieldName . '_to'] = $value; - } + $formValues[$fieldName . '_to'] = $value; break; } }