From 7c6fb57318b05ed5d6794eac4fe08c5b48fcce2e Mon Sep 17 00:00:00 2001 From: Nikki Murray Date: Mon, 5 Oct 2015 09:21:54 -0400 Subject: [PATCH] Updating API for is_visible --- CRM/Utils/Check/Message.php | 2 +- api/v3/System.php | 19 ++++--------------- xml/schema/Core/StatusPreference.xml | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/CRM/Utils/Check/Message.php b/CRM/Utils/Check/Message.php index a49187560f..26fada181a 100644 --- a/CRM/Utils/Check/Message.php +++ b/CRM/Utils/Check/Message.php @@ -142,7 +142,7 @@ class CRM_Utils_Check_Message { 'message' => $this->message, 'title' => $this->title, 'severity' => $this->level, - 'isVisible' => $this->isVisible, + 'is_visible' => $this->isVisible, ); if (!empty($this->help)) { $array['help'] = $this->help; diff --git a/api/v3/System.php b/api/v3/System.php index 76ee3eba1c..14e515d855 100644 --- a/api/v3/System.php +++ b/api/v3/System.php @@ -104,28 +104,17 @@ function _civicrm_api3_system_check_spec(&$spec) { */ function civicrm_api3_system_check($params) { // array(array('name'=> $, 'severity'=>$, ...)) + $id = 1; $returnValues = array(); // array(CRM_Utils_Check_Message) $messages = CRM_Utils_Check::singleton()->checkAll(); - $showHushed = CRM_Utils_Array::value('show_hushed', $params); - if (!$showHushed) { - foreach ($messages as $key => $message) { - if ($message->isVisible()) { - $returnValues[] = $message->toArray(); - } - } + foreach ($messages as $msg) { + $returnValues[] = $msg->toArray() + array('id' => $id++); } - else { - foreach ($messages as $msg) { - $returnValues[] = $msg->toArray(); - } - } - - // Spec: civicrm_api3_create_success($values = 1, $params = array(), $entity = NULL, $action = NULL) - return civicrm_api3_create_success($returnValues, $params, 'System', 'Check'); + return _civicrm_api3_basic_array_get('systemCheck', $params, $returnValues, id, array('id', 'name', 'message', 'title', 'severity', 'isVisible')); } /** diff --git a/xml/schema/Core/StatusPreference.xml b/xml/schema/Core/StatusPreference.xml index 84f26f519a..7f670d3cb3 100644 --- a/xml/schema/Core/StatusPreference.xml +++ b/xml/schema/Core/StatusPreference.xml @@ -54,7 +54,7 @@ hush_until - Hush Status Notifications Until + Snooze Status Notifications Until date true expires ignore_severity. NULL never hushes. -- 2.25.1