PMCORE-976

This commit is contained in:
Paula Quispe
2021-03-03 14:03:20 -04:00
parent 1cbb780e76
commit e678760a08
11 changed files with 66 additions and 23 deletions

View File

@@ -5,6 +5,7 @@ namespace ProcessMaker\ChangeLog;
use Cases;
use G;
use ProcessMaker\ChangeLog\LogStruct;
use ProcessMaker\Util\DateTime;
use Propel;
class ChangeLogResult
@@ -149,12 +150,16 @@ class ChangeLogResult
$count = 0;
foreach ($appData as $key => $value) {
if ($hasPermission && (!isset($values[$key]) || $values[$key] !== $value)) {
// Apply mask
$dateLabel = applyMaskDateEnvironment($row['DATE'],'', false);
// Apply the timezone
$dateLabel = DateTime::convertUtcToTimeZone($dateLabel);
$previousValue = !isset($values[$key]) ? null : $values[$key];
$record = ''
. G::LoadTranslation('ID_TASK') . ': ' . $row['TAS_TITLE'] . ' / '
. G::LoadTranslation('ID_DYNAFORM') . ': ' . $row['DYN_TITLE'] . ' / '
. G::LoadTranslation('ID_LAN_UPDATE_DATE') . ': ' . $row['DATE'] . ' / '
. G::LoadTranslation('ID_LAN_UPDATE_DATE') . ': ' . $dateLabel . ' / '
. G::LoadTranslation('ID_USER') . ': ' . $row['USR_USERNAME'] . ' / '
. G::LoadTranslation('ID_FROM') . ': ' . ChangeLog::getChangeLog()->getApplicationNameById($row['SOURCE_ID']);

View File

@@ -606,16 +606,23 @@ function getMysqlVersion()
*
* @param string $date in the format <Y-m-d H:m:d>
* @param string $mask
* @param bool $caseListSetting
*
* @return string
*/
function applyMaskDateEnvironment(string $date, $mask = '')
function applyMaskDateEnvironment(string $date, $mask = '', $caseListSetting = true)
{
$result = '';
if (empty($mask)) {
$systemConf = new Configurations();
$systemConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
$mask = isset($systemConf->aConfig['dateFormat']) ? $systemConf->aConfig['dateFormat'] : '';
if ($caseListSetting) {
// Format defined in Cases list: Date Format
$mask = isset($systemConf->aConfig['casesListDateFormat']) ? $systemConf->aConfig['casesListDateFormat'] : '';
} else {
// Format defined in Regional Settings: Global Date Format
$mask = isset($systemConf->aConfig['dateFormat']) ? $systemConf->aConfig['dateFormat'] : '';
}
}
if (!empty($date) && !empty($mask)) {
$date = new DateTime($date);