silent and noStream

This commit is contained in:
yuri
2015-11-03 15:43:44 +02:00
parent fea5669078
commit 7287854cc0
2 changed files with 5 additions and 5 deletions
@@ -95,7 +95,7 @@ class Notifications extends \Espo\Core\Hooks\Base
public function afterSave(Entity $entity, array $options = array())
{
if (!empty($options['silent']) && !empty($options['noNotifications'])) {
if (!empty($options['silent']) || !empty($options['noNotifications'])) {
return;
}
@@ -111,7 +111,7 @@ class Notifications extends \Espo\Core\Hooks\Base
public function beforeRemove(Entity $entity, array $options = array())
{
if (!empty($options['silent']) && !empty($options['noNotifications'])) {
if (!empty($options['silent']) || !empty($options['noNotifications'])) {
return;
}
+3 -3
View File
@@ -180,7 +180,7 @@ class Stream extends \Espo\Core\Hooks\Base
$this->getStreamService()->followEntityMass($entity, $userIdList);
}
if (empty($options['noStream'])) {
if (empty($options['noStream']) && empty($options['silent'])) {
$this->getStreamService()->noteCreate($entity);
}
@@ -211,7 +211,7 @@ class Stream extends \Espo\Core\Hooks\Base
}
} else {
if (empty($options['noStream'])) {
if (empty($options['noStream']) && empty($options['silent'])) {
if ($entity->isFieldChanged('assignedUserId')) {
$assignedUserId = $entity->get('assignedUserId');
if (!empty($assignedUserId)) {
@@ -239,7 +239,7 @@ class Stream extends \Espo\Core\Hooks\Base
}
if ($entity->isNew() && empty($options['noStream']) && $this->getMetadata()->get("scopes.{$entityName}.tab")) {
if ($entity->isNew() && empty($options['noStream']) && empty($options['silent']) && $this->getMetadata()->get("scopes.{$entityName}.tab")) {
$this->handleCreateRelated($entity);
}
}