/**
* Checks if new versions are available
+ * @param bool $force
* @return CRM_Utils_Check_Message[]
+ * @throws CRM_Core_Exception
*/
- public function checkVersion() {
+ public function checkVersion($force = FALSE) {
$messages = [];
try {
$vc = new CRM_Utils_VersionCheck();
- $vc->initialize();
+ $vc->initialize($force);
}
catch (Exception $e) {
$messages[] = new CRM_Utils_Check_Message(
}
// Show a notice if the version_check job is disabled
- if (empty($vc->cronJob['is_active'])) {
+ if (!$force && empty($vc->cronJob['is_active'])) {
$args = empty($vc->cronJob['id']) ? ['reset' => 1] : ['reset' => 1, 'action' => 'update', 'id' => $vc->cronJob['id']];
$messages[] = new CRM_Utils_Check_Message(
'checkVersionDisabled',
}
if ($vc->isInfoAvailable) {
- $severities = [
- 'info' => CRM_Utils_Check::severityMap(\Psr\Log\LogLevel::INFO),
- 'notice' => CRM_Utils_Check::severityMap(\Psr\Log\LogLevel::NOTICE) ,
- 'warning' => CRM_Utils_Check::severityMap(\Psr\Log\LogLevel::WARNING) ,
- 'critical' => CRM_Utils_Check::severityMap(\Psr\Log\LogLevel::CRITICAL),
- ];
foreach ($vc->getVersionMessages() ?? [] as $msg) {
$messages[] = new CRM_Utils_Check_Message(__FUNCTION__ . '_' . $msg['name'],
- $msg['message'], $msg['title'], $severities[$msg['severity']], 'fa-cloud-upload');
+ $msg['message'], $msg['title'], $msg['severity'], 'fa-cloud-upload');
}
}
return $messages;
}
- if (!$remotes) {
- // CRM-13141 There may not be any compatible extensions available for the requested CiviCRM version + CMS. If so, $extdir is empty so just return a notice.
- $messages[] = new CRM_Utils_Check_Message(
- __FUNCTION__,
- ts('There are currently no extensions on the CiviCRM public extension directory which are compatible with version %1. If you want to install an extension which is not marked as compatible, you may be able to download and install extensions manually (depending on access to your web server).', [
- 1 => CRM_Utils_System::majorVersion(),
- ]) . '<br />' . CRM_Utils_System::docURL2('sysadmin/customize/extensions/#installing-a-new-extension'),
- ts('No Extensions Available for this Version'),
- \Psr\Log\LogLevel::NOTICE,
- 'fa-plug'
- );
- return $messages;
- }
-
$keys = array_keys($manager->getStatuses());
sort($keys);
$updates = $errors = $okextensions = [];
case CRM_Extension_Manager::STATUS_INSTALLED:
if (!empty($remotes[$key]) && version_compare($row['version'], $remotes[$key]->version, '<')) {
- $updates[] = ts('%1 (%2) version %3 is installed. <a %4>Upgrade to version %5</a>.', [
- 1 => $row['label'] ?? NULL,
- 2 => $key,
- 3 => $row['version'],
- 4 => 'href="' . CRM_Utils_System::url('civicrm/admin/extensions', "action=update&id=$key&key=$key") . '"',
- 5 => $remotes[$key]->version,
- ]);
+ $updates[] = $row['label'] . ': ' . $mapper->getUpgradeLink($remotes[$key], $row);
}
else {
if (empty($row['label'])) {
$okextensions[] = $key;
}
else {
- $okextensions[] = ts('%1 (%2) version %3', [
+ $okextensions[] = ts('%1: Version %2', [
1 => $row['label'],
- 2 => $key,
- 3 => $row['version'],
+ 2 => $row['version'],
]);
}
}
return $messages;
}
+ public function checkWkHtmlToPDFPath() {
+ $messages = [];
+ $wkhtmltopdfPath = CRM_Core_Config::singleton()->wkhtmltopdfPath;
+ if (!empty($wkhtmltopdfPath) && !file_exists($wkhtmltopdfPath)) {
+ $messages[] = new CRM_Utils_Check_Message(
+ __FUNCTION__,
+ ts('CiviCRM is configured to use the wkhtmltopdf package to produce PDFs however it is missing, as such the system will fall back to using the DOMPDF package, this may mean that the output is different to what was expected. You should resolve this by either clearing the setting at Administer -> System Settings -> Miscellaneous or by getting your system administrator to install the wkhtmltopdf package'),
+ ts('Missing System Package: wkhtmltopdf'),
+ \Psr\Log\LogLevel::WARNING,
+ 'fa-server'
+ );
+ }
+ return $messages;
+ }
+
}