diff --git a/LICENSE.txt b/LICENSE.txt index e11546ac1a..20d40b6bce 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -631,29 +631,29 @@ to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. - EspoCRM - Open Source CRM - Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko + + Copyright (C) - EspoCRM is free software: you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - EspoCRM is distributed in the hope that it will be useful, + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with EspoCRM. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: - EspoCRM Copyright (C) 2014 Yuri Kuznetsov, Taras Machyshyn, Oleksiy Avramenko - EspoCRM comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. diff --git a/application/Espo/Hooks/Note/Notifications.php b/application/Espo/Hooks/Note/Notifications.php index ae91bb1a78..7c6d64f1f7 100644 --- a/application/Espo/Hooks/Note/Notifications.php +++ b/application/Espo/Hooks/Note/Notifications.php @@ -76,7 +76,6 @@ class Notifications extends \Espo\Core\Hooks\Base if ($entity->isNew()) { $parentType = $entity->get('parentType'); $parentId = $entity->get('parentId'); - $superParentType = $entity->get('superParentType'); $superParentTypeId = $entity->get('superParentTypeId'); @@ -84,14 +83,20 @@ class Notifications extends \Espo\Core\Hooks\Base if ($parentType && $parentId) { $userIdList = array_merge($userIdList, $this->getSubscriberIdList($parentType, $parentId)); + if ($superParentType && $superParentTypeId) { + $userIdList = array_merge($userIdList, $this->getSubscriberIdList($superParentType, $superParentTypeId)); + } + } else { + $targetType = $entity->get('targetType'); + if ($targetType === 'users') { + $targetUserIdList = $entity->get('usersIds'); + foreach ($targetUserIdList as $userId) { + if ($userId == $this->getUser()->id) continue; + $userIdList[] = $userId; + } + } } - if ($superParentType && $superParentTypeId) { - $userIdList = array_merge($userIdList, $this->getSubscriberIdList($superParentType, $superParentTypeId)); - } - - //$userIdList = array_merge($userIdList, $this->getMentionedUserIdList($entity)); - $userIdList = array_unique($userIdList); if (!empty($userIdList)) {