Commit 165aab59 authored by colemanw's avatar colemanw

CRM-13823 - Cleanup and add icons to system status messages

parent 93fe5d6f
......@@ -52,7 +52,7 @@ class CRM_Utils_Check_Case {
}
/**
* Run some sanity checks.
* Run all checks in this class.
*
* @return array<CRM_Utils_Check_Message>
*/
......@@ -81,13 +81,17 @@ class CRM_Utils_Check_Case {
elseif ($normalFile && $mungedFile) {
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__,
ts('Case type "%2" has duplicate XML files ("%3" and "%4").<br /><a href="%1">Read more about this warning</a>', array(
1 => CRM_Utils_System::getWikiBaseURL() . __FUNCTION__,
2 => $caseTypeName,
3 => $normalFile,
4 => $mungedFile,
)),
ts('CiviCase')
ts('Case type "%1" has duplicate XML files ("%2" and "%3")', array(
1 => $caseTypeName,
2 => $normalFile,
3 => $mungedFile,
)) .
'<br /><a href="' . CRM_Utils_System::getWikiBaseURL() . __FUNCTION__ . '">' .
ts('Read more about this warning') .
'</a>',
ts('CiviCase'),
\Psr\Log\LogLevel::WARNING,
'fa-puzzle-piece'
);
}
elseif ($normalFile && !$mungedFile) {
......@@ -96,13 +100,17 @@ class CRM_Utils_Check_Case {
elseif (!$normalFile && $mungedFile) {
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__,
ts('Case type "%2" corresponds to XML file ("%3") The XML file should be named "%4".<br /><a href="%1">Read more about this warning</a>', array(
1 => CRM_Utils_System::getWikiBaseURL() . __FUNCTION__,
2 => $caseTypeName,
3 => $mungedFile,
4 => "{$caseTypeName}.xml",
)),
ts('CiviCase')
ts('Case type "%1" corresponds to XML file ("%2") The XML file should be named "%3".', array(
1 => $caseTypeName,
2 => $mungedFile,
3 => "{$caseTypeName}.xml",
)) .
'<br /><a href="' . CRM_Utils_System::getWikiBaseURL() . __FUNCTION__ . '">' .
ts('Read more about this warning') .
'</a>',
ts('CiviCase'),
\Psr\Log\LogLevel::WARNING,
'fa-puzzle-piece'
);
}
elseif (!$normalFile && !$mungedFile) {
......
This diff is collapsed.
......@@ -58,6 +58,12 @@ class CRM_Utils_Check_Message {
*/
private $help;
/**
* @var string
* crm-i css class
*/
private $icon;
/**
*
* @var bool
......@@ -77,7 +83,7 @@ class CRM_Utils_Check_Message {
*
* @see Psr\Log\LogLevel
*/
public function __construct($name, $message, $title, $level = \Psr\Log\LogLevel::WARNING) {
public function __construct($name, $message, $title, $level = \Psr\Log\LogLevel::WARNING, $icon = NULL) {
$this->name = $name;
$this->message = $message;
$this->title = $title;
......@@ -86,6 +92,7 @@ class CRM_Utils_Check_Message {
$level = CRM_Utils_Check::severityMap($level);
}
$this->level = $level;
$this->icon = $icon;
}
/**
......@@ -143,6 +150,7 @@ class CRM_Utils_Check_Message {
'title' => $this->title,
'severity' => $this->level,
'is_visible' => $this->isVisible,
'icon' => $this->icon,
);
if (!empty($this->help)) {
$array['help'] = $this->help;
......
......@@ -50,7 +50,7 @@ class CRM_Utils_Check_Security {
}
/**
* Run some sanity checks.
* Run all checks in this class.
*
* @return array<CRM_Utils_Check_Message>
*/
......@@ -110,9 +110,11 @@ class CRM_Utils_Check_Security {
. '<br />' .
'<a href="%2">Read more about this warning</a>';
$messages[] = new CRM_Utils_Check_Message(
'checkLogFileIsNotAccessible',
__FUNCTION__,
ts($msg, array(1 => $log_url, 2 => $docs_url)),
ts('Security Warning')
ts('Security Warning'),
\Psr\Log\LogLevel::WARNING,
'fa-lock'
);
}
}
......@@ -151,7 +153,7 @@ class CRM_Utils_Check_Security {
$heuristicUrl = $this->guessUrl($privateDir);
if ($this->isDirAccessible($privateDir, $heuristicUrl)) {
$messages[] = new CRM_Utils_Check_Message(
'checkUploadsAreNotAccessible',
__FUNCTION__,
ts('Files in the data directory (<a href="%3">%2</a>) should not be downloadable.'
. '<br />'
. '<a href="%1">Read more about this warning</a>',
......@@ -161,7 +163,8 @@ class CRM_Utils_Check_Security {
3 => $heuristicUrl,
)),
ts('Private Files Readable'),
\Psr\Log\LogLevel::WARNING
\Psr\Log\LogLevel::WARNING,
'fa-lock'
);
}
}
......@@ -205,10 +208,11 @@ class CRM_Utils_Check_Security {
'<a href="%3">Read more about this warning</a>';
$docs_url = $this->createDocUrl('checkDirectoriesAreNotBrowseable');
$messages[] = new CRM_Utils_Check_Message(
'checkDirectoriesAreNotBrowseable',
__FUNCTION__,
ts($msg, array(1 => $publicDir, 2 => $publicDir, 3 => $docs_url)),
ts('Browseable Directories'),
\Psr\Log\LogLevel::ERROR
\Psr\Log\LogLevel::ERROR,
'fa-lock'
);
}
}
......@@ -254,10 +258,11 @@ class CRM_Utils_Check_Security {
foreach ($files as $file) {
if (file_exists($file[0])) {
$messages[] = new CRM_Utils_Check_Message(
'checkFilesAreNotPresent',
__FUNCTION__,
ts('File \'%1\' presents a security risk and should be deleted.', array(1 => $file)),
ts('Unsafe Files'),
$file[1]
$file[1],
'fa-lock'
);
}
}
......@@ -281,11 +286,13 @@ class CRM_Utils_Check_Security {
if (!empty($list)) {
$messages[] = new CRM_Utils_Check_Message(
'checkCxnOverrides',
__FUNCTION__,
ts('The system administrator has disabled security settings (%1). Connections to remote applications are insecure.', array(
1 => implode(', ', $list),
)),
ts('Security Warning')
ts('Security Warning'),
\Psr\Log\LogLevel::WARNING,
'fa-lock'
);
}
......
......@@ -2,11 +2,7 @@
<div crm-ui-debug="statuses"></div>
<div crm-ui-debug="preferences"></div>
<form name="myForm" crm-ui-id-scope>
<div class="help">
<p>{{ts('Help messages will be displayed here')}}</p>
</div>
<form name="crm-system-status" crm-ui-id-scope>
<div>
<h1>Status Page</h1><br />
......@@ -14,7 +10,9 @@
<button ng-if="(path === '/status')" ng-click="navigator.redirect('#/status/hushed')">Show snoozed and hushed</button>
</div>
<div id="crm-status-list" ng-repeat="status in statuses.values track by status.name" >
<h3 class="crm-severity-{{status.severity}}">{{status.title}}
<h3 class="crm-severity-{{status.severity}}">
<i ng-if="status.icon" class="crm-i {{status.icon}}"></i>
{{status.title}}
<span class="status-snooze-options" ng-show="status.snoozeOptions.show" style="display: inline-block">
<div crm-snooze-options style="display: inline"></div>
</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment