EspoCRM – Open Source CRM Application
PHP calendarcontactscrmcrm-platformcrm-systemcustomer-portalcustomer-supportcustomizabledocumentsemail-marketingkanbanleadsopen-sourcephpplatformsales-automationsingle-page-applicationsupport
note fields const
Yuriie153a70c1c11
diff --git a/application/Espo/Classes/AssignmentNotificators/Email.php b/application/Espo/Classes/AssignmentNotificators/Email.phpindex 84087b0c69..c99b499102 100644--- a/application/Espo/Classes/AssignmentNotificators/Email.php+++ b/application/Espo/Classes/AssignmentNotificators/Email.php@@ -35,6 +35,7 @@ use Espo\Core\Name\Field;use Espo\Core\Notification\DefaultAssignmentNotificator;use Espo\Entities\EmailAddress;use Espo\Entities\EmailFolder;+use Espo\Entities\Note;use Espo\Modules\Crm\Entities\Account;use Espo\Modules\Crm\Entities\Contact;use Espo\Modules\Crm\Entities\Lead;@@ -165,9 +166,9 @@ class Email implements AssignmentNotificator]);if ($person) {- $data['personEntityType'] = $person->getEntityType();- $data['personEntityName'] = $person->get(Field::NAME);- $data['personEntityId'] = $person->getId();+ $data[Note::DATA_ATTR_PERSON_ENTITY_TYPE] = $person->getEntityType();+ $data[Note::DATA_ATTR_PERSON_ENTITY_NAME] = $person->get(Field::NAME);+ $data[Note::DATA_ATTR_PERSON_ENTITY_ID] = $person->getId();}}@@ -177,11 +178,11 @@ class Email implements AssignmentNotificator$userIdFrom = $person->getId();}- if (empty($data['personEntityId'])) {- $data['fromString'] = Util::parseFromName($entity->getFromString() ?? '');+ if (empty($data[Note::DATA_ATTR_PERSON_ENTITY_ID])) {+ $data[Note::DATA_ATTR_FROM_STRING] = Util::parseFromName($entity->getFromString() ?? '');- if (empty($data['fromString']) && $from) {- $data['fromString'] = $from;+ if (empty($data[Note::DATA_ATTR_FROM_STRING]) && $from) {+ $data[Note::DATA_ATTR_FROM_STRING] = $from;}}diff --git a/application/Espo/Entities/Note.php b/application/Espo/Entities/Note.phpindex f1ea175a5b..3c7d4b522d 100644--- a/application/Espo/Entities/Note.php+++ b/application/Espo/Entities/Note.php@@ -73,6 +73,14 @@ class Note extends Entitypublic const string DATA_ATTR_ASSIGNED_USER_NAME = 'assignedUserName';public const string DATA_ATTR_FIELDS = 'fields';public const string DATA_ATTR_ATTRIBUTES = 'attributes';+ public const string DATA_ATTR_PERSON_ENTITY_TYPE = 'personEntityType';+ public const string DATA_ATTR_PERSON_ENTITY_NAME = 'personEntityName';+ public const string DATA_ATTR_PERSON_ENTITY_ID = 'personEntityId';+ public const string DATA_ATTR_FROM_STRING = 'fromString';++ public const string FIELD_TYPE = 'type';+ public const string FIELD_NUMBER = 'number';+ public const string FIELD_POST = 'post';private bool $aclIsProcessed = false;diff --git a/application/Espo/Tools/Stream/Service.php b/application/Espo/Tools/Stream/Service.phpindex 4d05a2f95c..18b7815326 100644--- a/application/Espo/Tools/Stream/Service.php+++ b/application/Espo/Tools/Stream/Service.php@@ -500,9 +500,9 @@ class Service$person = $this->getEmailAddressRepository()->getEntityByAddress($from);if ($person) {- $data['personEntityType'] = $person->getEntityType();- $data['personEntityName'] = $person->get(Field::NAME);- $data['personEntityId'] = $person->getId();+ $data[Note::DATA_ATTR_PERSON_ENTITY_TYPE] = $person->getEntityType();+ $data[Note::DATA_ATTR_PERSON_ENTITY_NAME] = $person->get(Field::NAME);+ $data[Note::DATA_ATTR_PERSON_ENTITY_ID] = $person->getId();if (!$isInitial &&@@ -566,9 +566,9 @@ class Service}if ($person) {- $data['personEntityType'] = $person->getEntityType();- $data['personEntityName'] = $person->get(Field::NAME);- $data['personEntityId'] = $person->getId();+ $data[Note::DATA_ATTR_PERSON_ENTITY_TYPE] = $person->getEntityType();+ $data[Note::DATA_ATTR_PERSON_ENTITY_NAME] = $person->get(Field::NAME);+ $data[Note::DATA_ATTR_PERSON_ENTITY_ID] = $person->getId();}$note->setData($data);