From 765e90ac12c63942ad3cd92cf71d65d56f85f7b9 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Sat, 25 Apr 2015 12:59:47 -0400 Subject: [PATCH] CRM-13823: combine status messages into a single notification ---------------------------------------- * CRM-13823: Admin Status Page https://issues.civicrm.org/jira/browse/CRM-13823 --- CRM/Utils/Check.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Check.php b/CRM/Utils/Check.php index 0332175d7c8f..e609122d5e6c 100644 --- a/CRM/Utils/Check.php +++ b/CRM/Utils/Check.php @@ -81,11 +81,25 @@ public function showPeriodicAlerts($messages = NULL, $filter = array(__CLASS__, if ($messages === NULL) { $messages = $this->checkAll(); } + $statusMessages = array(); foreach ($messages as $message) { if ($filter === TRUE || call_user_func($filter, $message)) { - CRM_Core_Session::setStatus($message->getMessage(), $message->getTitle()); + $statusMessages[] = $message->getMessage(); + $statusTitle = $message->getTitle(); } } + + if (count($statusMessages)) { + if (count($statusMessages) > 1) { + $statusTitle = ts('Multiple Alerts'); + $statusMessage = ''; + } + else { + $statusMessage = array_shift($statusMessages); + } + // TODO: add link to status page + CRM_Core_Session::setStatus($statusMessage, $statusTitle); + } } } }