Commit 3c49839d authored by eileen's avatar eileen Committed by deb.monish

Fix call to deprecated funciton

parent 8b0533f0
......@@ -183,6 +183,13 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
}
}
if ($customSearchClass = CRM_Utils_Array::value('customSearchClass', $result)) {
// check if there is a special function - formatSavedSearchFields defined in the custom search form
if (method_exists($customSearchClass, 'formatSavedSearchFields')) {
$customSearchClass::formatSavedSearchFields($result);
}
}
return $result;
}
......
......@@ -43,7 +43,7 @@ class CRM_Contact_Form_Search_Custom_ContribSYBNT extends CRM_Contact_Form_Searc
* @param $formValues
*/
public function __construct(&$formValues) {
$this->_formValues = $formValues;
$this->_formValues = self::formatSavedSearchFields($formValues);
$this->_permissionedComponent = 'CiviContribute';
$this->_columns = array(
......@@ -400,4 +400,26 @@ AND c.receive_date < {$this->start_date_1}
list($this->_aclFrom, $this->_aclWhere) = CRM_Contact_BAO_Contact_Permission::cacheClause($tableAlias);
}
/**
* Format saved search fields for this custom group
*
* @param array $formValues
*
*/
public static function formatSavedSearchFields(&$formValues) {
$dateFields = array(
'start_date_1',
'end_date_1',
'start_date_2',
'end_date_2',
'exclude_start_date',
'exclude_end_date',
);
foreach ($formValues as $element => $value) {
if (in_array($element, $dateFields) && !empty($value)) {
$formValues[$element] = date('Y-m-d', strtotime($value));
}
}
}
}
......@@ -556,10 +556,7 @@ FROM civicrm_action_schedule cas
'provider_id' => $schedule->sms_provider_id,
'activity_subject' => $messageSubject,
);
$activityTypeID = CRM_Core_OptionGroup::getValue('activity_type',
'SMS',
'name'
);
$activityTypeID = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'SMS');
$activityParams = array(
'source_contact_id' => $userID,
'activity_type_id' => $activityTypeID,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment