Skip to content

Commit

Permalink
Merge pull request #1 from ginkgostreet/status-page-1
Browse files Browse the repository at this point in the history
CRM-13823: combine status messages into a single notification
  • Loading branch information
agh1 committed Apr 25, 2015
2 parents 60f6948 + 765e90a commit 6bf17d7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion CRM/Utils/Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '<ul><li>' . implode('</li><li>',$statusMessages) . '</li></ul>';
}
else {
$statusMessage = array_shift($statusMessages);
}
// TODO: add link to status page
CRM_Core_Session::setStatus($statusMessage, $statusTitle);
}
}
}
}
Expand Down

0 comments on commit 6bf17d7

Please sign in to comment.