AntonLV 7 лет назад
Родитель
Сommit
954799bf42

+ 10 - 2
modules/boonex/notifications/classes/BxNtfsResponse.php

@@ -33,11 +33,19 @@ class BxNtfsResponse extends BxBaseModNotificationsResponse
         if(empty($aHandler) || !is_array($aHandler))
             return;
 
+        /**
+         * silent_mode is needed for alert sending module to tell that this alert
+         * should be ignored with Notifications module completely or partially.
+         * Currently Complete ignore is used only.
+         */
+        if(isset($oAlert->aExtras['silent_mode']) && (int)$oAlert->aExtras['silent_mode'] != 0)
+            return;
+
         switch($aHandler['type']) {
             case BX_BASE_MOD_NTFS_HANDLER_TYPE_INSERT:
             	$sMethod = 'getInsertData' . bx_gen_method_name($oAlert->sUnit . '_' . $oAlert->sAction);           	
             	if(!method_exists($this, $sMethod))
-            		$sMethod = 'getInsertData';
+                    $sMethod = 'getInsertData';
 
                 $aDataItems = $this->$sMethod($oAlert, $aHandler);
                 foreach($aDataItems as $aDataItem) {
@@ -48,7 +56,7 @@ class BxNtfsResponse extends BxBaseModNotificationsResponse
                         $this->_oModule->onPost($iId);
                     }
                 }
-				break;
+                break;
 
             case BX_BASE_MOD_NTFS_HANDLER_TYPE_UPDATE:
                 $this->_oModule->_oDb->updateEvent(array('object_privacy_view' => $iObjectPrivacyView), array('type' => $oAlert->sUnit, 'object_id' => $oAlert->iObject));

+ 3 - 0
modules/boonex/notifications/classes/BxNtfsTemplate.php

@@ -123,6 +123,9 @@ class BxNtfsTemplate extends BxBaseModNotificationsTemplate
     	if((int)$aEvent['processed'] == 0)
             $this->_processContent($aEvent);
 
+        if(empty($aEvent['content']))
+            return '';
+
         $aEvent['content'] = unserialize($aEvent['content']);
 
         $sParam = 'perform_privacy_check';