diff --git a/application/Espo/Core/Console/Commands/Upgrade.php b/application/Espo/Core/Console/Commands/Upgrade.php index 5e1dd5353b..95df4a9c37 100644 --- a/application/Espo/Core/Console/Commands/Upgrade.php +++ b/application/Espo/Core/Console/Commands/Upgrade.php @@ -48,7 +48,7 @@ class Upgrade extends Base return; } - fwrite(\STDOUT, "EspoCRM will be upgaded to version {$nextVersion} now. Type 'Y' to continue.\n"); + fwrite(\STDOUT, "EspoCRM will be upgraded to version {$nextVersion} now. Enter [Y] to continue.\n"); if (!$this->confirm()) { echo "Upgrade canceled.\n"; diff --git a/application/Espo/Core/Utils/DateTime.php b/application/Espo/Core/Utils/DateTime.php index f6c0418b06..6d92cde4e0 100644 --- a/application/Espo/Core/Utils/DateTime.php +++ b/application/Espo/Core/Utils/DateTime.php @@ -251,4 +251,9 @@ class DateTime return false; } + + public static function getSystemNowString() + { + return date(self::$systemDateTimeFormat); + } } diff --git a/application/Espo/Jobs/Cleanup.php b/application/Espo/Jobs/Cleanup.php index f5f1e6cb08..2c9dbe368d 100644 --- a/application/Espo/Jobs/Cleanup.php +++ b/application/Espo/Jobs/Cleanup.php @@ -428,7 +428,7 @@ class Cleanup extends \Espo\Core\Jobs\Base { if (!$this->getConfig()->get('cleanupDeletedRecords')) return; $period = '-' . $this->getConfig()->get('cleanupDeletedRecordsPeriod', $this->cleanupDeletedRecordsPeriod); - $datetime = new \DateTime('-' . $period); + $datetime = new \DateTime($period); $scopeList = array_keys($this->getMetadata()->get(['scopes'])); foreach ($scopeList as $scope) { diff --git a/application/Espo/ORM/Entity.php b/application/Espo/ORM/Entity.php index 91a8a999d7..81f384ecd2 100644 --- a/application/Espo/ORM/Entity.php +++ b/application/Espo/ORM/Entity.php @@ -453,15 +453,21 @@ abstract class Entity implements IEntity public function getFetched($name) { + if ($name === 'id') { + return $this->id; + } if (isset($this->fetchedValuesContainer[$name])) { return $this->fetchedValuesContainer[$name]; } return null; } - public function hasFetched($attributeName) + public function hasFetched($name) { - return array_key_exists($attributeName, $this->fetchedValuesContainer); + if ($name === 'id') { + return !!$this->id; + } + return array_key_exists($name, $this->fetchedValuesContainer); } public function resetFetchedValues() diff --git a/application/Espo/Services/LeadCapture.php b/application/Espo/Services/LeadCapture.php index c4a5c4cbd7..32417ab8a0 100644 --- a/application/Espo/Services/LeadCapture.php +++ b/application/Espo/Services/LeadCapture.php @@ -68,7 +68,7 @@ class LeadCapture extends Record $attributeList = []; - $attributeIgnoreList = ['emailAddressIsOptedOut']; + $attributeIgnoreList = ['emailAddressIsOptedOut', 'phoneNumberIsOptedOut', 'emailAddressData', 'phoneNumberData']; $fieldList = $entity->get('fieldList'); if (is_array($fieldList)) { diff --git a/client/res/templates/record/search.tpl b/client/res/templates/record/search.tpl index 637f1f3a73..3780aebf9c 100644 --- a/client/res/templates/record/search.tpl +++ b/client/res/templates/record/search.tpl @@ -1,6 +1,6 @@