From 874ee3860b67499902e7c11bcbc7940147ae483b Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Mon, 28 Aug 2017 19:03:11 -0700 Subject: [PATCH] CRM-21079, CRM-9683 - CRM_Utils_Check - Expand advice --- CRM/Utils/Check/Component/Timestamps.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/CRM/Utils/Check/Component/Timestamps.php b/CRM/Utils/Check/Component/Timestamps.php index 4e98293169..00477e1d0b 100644 --- a/CRM/Utils/Check/Component/Timestamps.php +++ b/CRM/Utils/Check/Component/Timestamps.php @@ -43,12 +43,21 @@ class CRM_Utils_Check_Component_Timestamps extends CRM_Utils_Check_Component { $problems = array(); foreach (self::getConvertedTimestamps() as $target) { if (self::isFieldType($target['table'], $target['column'], 'datetime')) { + $phrases = array(); + $phrases[] = sprintf('%s.%s', $target['table'], $target['column']); + if ($target['changed']) { - $problems[] = sprintf('%s.%s (New sites default to TIMESTAMP in %s+)', $target['table'], $target['column'], $target['changed']); + $phrases[] = sprintf('(New sites default to TIMESTAMP in v%s+)', $target['changed']); } else { - $problems[] = sprintf('%s.%s (Experimental suggestion)', $target['table'], $target['column']); + $phrases[] = '(Experimental suggestion)'; + } + + if (isset($target['jira'])) { + $phrases[] = sprintf(' [%s]', $target['jira'], $target['jira']); } + + $problems[] = implode(' ', $phrases); } } @@ -57,17 +66,20 @@ class CRM_Utils_Check_Component_Timestamps extends CRM_Utils_Check_Component { $messages[] = new CRM_Utils_Check_Message( __FUNCTION__ . md5(implode(',', $problems)), '

' . - ts('This system includes some SQL columns with type "DATETIME". These may work better as "TIMESTAMP".') . + ts('This MySQL database stores certain fields with data-type "DATETIME". To improve timezone support, you may want to change these from "DATETIME" to "TIMESTAMP".') . '

' . '' . '

' . + ts('Changing should improve data-quality for organizations working in multiple timezones. However, if you do change, then you may need to re-test any customizations or processes that reference these fields. Changing is suggested but not required.') . + '

' . + '

' . ts('For further discussion, please visit %1', array( 1 => sprintf('%s', self::DOCTOR_WHEN, self::DOCTOR_WHEN), )) . '

', - ts('Timestamp Schema'), + ts('Timestamps and Timezones'), \Psr\Log\LogLevel::NOTICE, 'fa-clock-o' ); -- 2.25.1