/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
* @package CiviCRM_APIv3
* @subpackage API_ActionSchedule
*
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
*
*/
/**
* Get CiviCRM Action Schedule details
* {@getfields action_schedule_create}
- *
+ *
*/
function civicrm_api3_action_schedule_get($params) {
- $bao = new CRM_Core_BAO_ActionSchedule();
- _civicrm_api3_dao_set_filter($bao, $params, true, 'ActionSchedule');
- $actionSchedules = _civicrm_api3_dao_to_array($bao, $params, true,'ActionSchedule');
-
- return civicrm_api3_create_success($actionSchedules, $params, 'action_schedule', 'get', $bao);
+ return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'action_schedule');
}
* @param array $params
*
* @return array
- *
+ *
* {@getfields action_schedule_create}
*/
function civicrm_api3_action_schedule_create($params) {
- return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+ civicrm_api3_verify_one_mandatory($params, NULL, array('start_action_date', 'absolute_date'));
+ if (!array_key_exists('name', $params) && !array_key_exists('id', $params)) {
+ $params['name'] = CRM_Utils_String::munge($params['title']);
+ }
+ return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'action_schedule');
}
/**
* @param array $params array or parameters determined by getfields
*/
function _civicrm_api3_action_schedule_create_spec(&$params) {
- unset($params['version']);
+ $params['title']['api.required'] = TRUE;
+ $params['mapping_id']['api.required'] = TRUE;
+// $params['entity_status']['api.required'] = TRUE;
+ $params['entity_value']['api.required'] = TRUE;
}
/**
*/
function civicrm_api3_action_schedule_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
-}
\ No newline at end of file
+}
+
+