Commit 2a243675 authored by colemanw's avatar colemanw

SystemCheck help improvements

parent e42a4a0b
......@@ -223,7 +223,11 @@ class CRM_Utils_Check_Env {
\Psr\Log\LogLevel::WARNING,
'fa-envelope'
);
$message->addHelp(ts('Learn more in the <a href="%1">user guide</a>', array(1 => 'http://book.civicrm.org/user/advanced-configuration/email-system-configuration/')));
$docUrl = 'target="_blank" href="' . CRM_Utils_System::docURL(array('page' => 'user/advanced-configuration/email-system-configuration/', 'URLonly' => TRUE)) . '""';
$message->addHelp(
ts('A default mailbox must be configured for email bounce processing.') . '<br />' .
ts("Learn more in the <a %1>online documentation</a>.", array(1 => $docUrl))
);
$messages[] = $message;
}
......@@ -259,26 +263,19 @@ class CRM_Utils_Check_Env {
'fa-clock-o'
);
}
elseif ($lastCron > gmdate('U') - 86400) {
$message = new CRM_Utils_Check_Message(
__FUNCTION__,
$msg,
ts('Cron Not Running'),
\Psr\Log\LogLevel::WARNING,
'fa-clock-o'
);
$message->addHelp(ts('Learn more in the <a href="%1">Administrator\'s Guide supplement</a>', array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs')));
$messages[] = $message;
}
else {
$message = new CRM_Utils_Check_Message(
__FUNCTION__,
$msg,
ts('Cron Not Running'),
\Psr\Log\LogLevel::ERROR,
($lastCron > gmdate('U') - 86400) ? \Psr\Log\LogLevel::WARNING : \Psr\Log\LogLevel::ERROR,
'fa-clock-o'
);
$message->addHelp(ts('Learn more in the <a href="%1">Administrator\'s Guide supplement</a>', array(1 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Managing+Scheduled+Jobs')));
$docUrl = 'target="_blank" href="' . CRM_Utils_System::docURL(array('resource' => 'wiki', 'page' => 'Managing Scheduled Jobs', 'URLonly' => TRUE)) . '""';
$message->addHelp(
ts('Configuring cron on your server is necessary for running scheduled jobs such as sending mail and scheduled reminders.') . '<br />' .
ts("Learn more in the <a %1>online documentation</a>.", array(1 => $docUrl))
);
$messages[] = $message;
}
......
......@@ -26,7 +26,7 @@
<a
ng-if="status.help"
class="helpicon"
ng-click="alert(status.help, status.title, 'info');"
ng-click="help(status.title, status.help);"
href="javascript:void(0)"
>
</a>
......
......@@ -3,7 +3,7 @@
angular.module('statuspage').controller('statuspageStatusPage',
function($scope, crmApi, crmStatus, statusData) {
$scope.ts = CRM.ts();
$scope.alert = CRM.alert;
$scope.help = CRM.help;
$scope.formatDate = CRM.utils.formatDate;
$scope.statuses = statusData.values;
......
......@@ -1006,21 +1006,29 @@ if (!CRM.vars) CRM.vars = {};
};
var helpDisplay, helpPrevious;
// Non-ajax example:
// CRM.help('Example title', 'Here is some text to describe this example');
// Ajax example (will load help id "foo" from templates/CRM/bar.tpl):
// CRM.help('Example title', {id: 'foo', file: 'CRM/bar'});
CRM.help = function (title, params, url) {
var ajax = typeof params !== 'string';
if (helpDisplay && helpDisplay.close) {
// If the same link is clicked twice, just close the display - todo use underscore method for this comparison
if (helpDisplay.isOpen && helpPrevious === JSON.stringify(params)) {
// If the same link is clicked twice, just close the display
if (helpDisplay.isOpen && _.isEqual(helpPrevious, params)) {
helpDisplay.close();
return;
}
helpDisplay.close();
}
helpPrevious = JSON.stringify(params);
params.class_name = 'CRM_Core_Page_Inline_Help';
params.type = 'page';
helpDisplay = CRM.alert('...', title, 'crm-help crm-msg-loading', {expires: 0});
$.ajax(url || CRM.url('civicrm/ajax/inline'),
{
helpPrevious = _.cloneDeep(params);
helpDisplay = CRM.alert(ajax ? '...' : params, title, 'crm-help ' + (ajax ? 'crm-msg-loading' : 'info'), {expires: 0});
if (ajax) {
if (!url) {
url = CRM.url('civicrm/ajax/inline');
params.class_name = 'CRM_Core_Page_Inline_Help';
params.type = 'page';
}
$.ajax(url, {
data: params,
dataType: 'html',
success: function (data) {
......@@ -1031,8 +1039,8 @@ if (!CRM.vars) CRM.vars = {};
$('#crm-notification-container .crm-help .notify-content:last').html('Unable to load help file.');
$('#crm-notification-container .crm-help').removeClass('crm-msg-loading').addClass('error');
}
}
);
});
}
};
/**
* @see https://wiki.civicrm.org/confluence/display/CRMDOC/Notification+Reference
......
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