mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 23:16:03 +00:00
fix notifications
This commit is contained in:
@@ -31,6 +31,18 @@ namespace Espo\Entities;
|
||||
|
||||
class Note extends \Espo\Core\ORM\Entity
|
||||
{
|
||||
private $aclIsProcessed = false;
|
||||
|
||||
public function setAclIsProcessed()
|
||||
{
|
||||
$this->aclIsProcessed = true;
|
||||
}
|
||||
|
||||
public function isAclProcessed()
|
||||
{
|
||||
return $this->aclIsProcessed;
|
||||
}
|
||||
|
||||
public function loadAttachments()
|
||||
{
|
||||
$data = $this->get('data');
|
||||
|
||||
@@ -133,10 +133,19 @@ class Notifications extends \Espo\Core\Hooks\Base
|
||||
$targetType = $parentType;
|
||||
}
|
||||
|
||||
$teamIdList = $entity->getLinkMultipleIdList('teams');
|
||||
$userIdList = $entity->getLinkMultipleIdList('users');
|
||||
$skipAclCheck = false;
|
||||
if (!$entity->isAclProcessed()) {
|
||||
$skipAclCheck = true;
|
||||
} else {
|
||||
$teamIdList = $entity->getLinkMultipleIdList('teams');
|
||||
$userIdList = $entity->getLinkMultipleIdList('users');
|
||||
}
|
||||
|
||||
foreach ($userList as $user) {
|
||||
if ($skipAclCheck) {
|
||||
$notifyUserIdList[] = $user->id;
|
||||
continue;
|
||||
}
|
||||
if ($user->isAdmin()) {
|
||||
$notifyUserIdList[] = $user->id;
|
||||
continue;
|
||||
|
||||
@@ -889,6 +889,10 @@ class Stream extends \Espo\Core\Services\Base
|
||||
|
||||
protected function processNoteTeamsUsers(Entity $note, Entity $entity)
|
||||
{
|
||||
$note->setAclIsProcessed();
|
||||
$note->set('teamsIds', []);
|
||||
$note->set('usersIds', []);
|
||||
|
||||
if ($entity->hasLinkMultipleField('teams') && $entity->has('teamsIds')) {
|
||||
$teamIdList = $entity->get('teamsIds');
|
||||
if (!empty($teamIdList)) {
|
||||
|
||||
Reference in New Issue
Block a user