From 5bd361934f5dd97d2e3ef40d15f0946541e546cb Mon Sep 17 00:00:00 2001 From: vivekarora Date: Fri, 15 Nov 2013 16:43:00 +0530 Subject: [PATCH] Fixed Action schedule API warnings and case type export issue --- CRM/Utils/Migrate/Export.php | 2 +- api/v3/ActionSchedule.php | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CRM/Utils/Migrate/Export.php b/CRM/Utils/Migrate/Export.php index 3d44bdb16c..d53df5b43f 100644 --- a/CRM/Utils/Migrate/Export.php +++ b/CRM/Utils/Migrate/Export.php @@ -482,7 +482,7 @@ class CRM_Utils_Migrate_Export { } else { foreach ($types as $type) { - if (in_array($key, array('activity_type', 'event_type'))) { + if (in_array($key, array('activity_type', 'event_type','case_type'))) { $ogID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', $key, 'id', 'name'); $ovParams = array('option_group_id' => $ogID, 'value' => $type); CRM_Core_BAO_OptionValue::retrieve($ovParams, $oValue); diff --git a/api/v3/ActionSchedule.php b/api/v3/ActionSchedule.php index 37ce6a30a5..ab92a06b2f 100644 --- a/api/v3/ActionSchedule.php +++ b/api/v3/ActionSchedule.php @@ -60,7 +60,19 @@ function civicrm_api3_action_schedule_get($params) { * {@getfields action_schedule_create} */ function civicrm_api3_action_schedule_create($params) { - return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); + $ids = array(); + if (isset($params['id']) && !CRM_Utils_Rule::integer($params['id'])) { + return civicrm_api3_create_error('Invalid value for ID'); + } + + $actionSchedule = new CRM_Core_BAO_ActionSchedule(); + $actionSchedule = CRM_Core_BAO_ActionSchedule::add($params, $ids); + + $actSchedule = array(); + + _civicrm_api3_object_to_array($actionSchedule, $actSchedule[$actionSchedule->id]); + + return civicrm_api3_create_success($actSchedule, $params, 'action_schedule', 'create', $actionSchedule); } /** -- 2.25.1