/*
+--------------------------------------------------------------------+
- | 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
*
*/
unset($params['version']);
}
+/**
+ * @param $params
+ *
+ * @return array|null
+ */
function _civicrm_api3_dashboard_contact_check_params(&$params) {
$dashboard_id = CRM_Utils_Array::value('dashboard_id', $params);
if ($dashboard_id) {
- $allDashlets = CRM_Core_BAO_Dashboard::getDashlets();
+ $allDashlets = CRM_Core_BAO_Dashboard::getDashlets(TRUE, CRM_Utils_Array::value('check_permissions', $params, 0));
if (!isset($allDashlets[$dashboard_id])) {
- return civicrm_api3_create_error('Invalid Dashboard ID');
+ return civicrm_api3_create_error('Invalid or inaccessible dashboard ID');
}
}
return NULL;
-}
\ No newline at end of file
+}
+
+/**
+ * Delete an existing dashboard-contact
+ *
+ * This method is used to delete any existing dashboard-board. the id of the dashboard-contact
+ * is required field in $params array
+ *
+ * {@getfields dashboard_contact_delete}
+ * @access public
+ */
+function civicrm_api3_dashboard_contact_delete($params) {
+ return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
+}