Просмотр исходного кода

Ticket #4895 - Notifications: Add possibility to change date.

AntonLV 1 год назад
Родитель
Сommit
637edbe6cc

+ 1 - 0
modules/boonex/notifications/classes/BxNtfsDb.php

@@ -228,6 +228,7 @@ class BxNtfsDb extends BxBaseModNotificationsDb
                         $sSelectClause = 'DISTINCT ' . $sSelectClause;
                 }
 
+                $sWhereClause .= $this->prepareAsString("AND `" . $this->_sTable . "`.`date` <= ? ", time());
                 break;
         }
 

+ 6 - 0
modules/boonex/notifications/classes/BxNtfsResponse.php

@@ -145,6 +145,7 @@ class BxNtfsResponse extends BxBaseModNotificationsResponse
                 'content' => $this->_getContent($oAlert->aExtras),
                 'source' => $this->_getSource($oAlert->aExtras),
                 'allow_view_event_to' => $this->_oModule->_oConfig->getPrivacyViewDefault('event'),
+                'date' => $this->_getDate($oAlert->aExtras),
                 'processed' => 0
     	    );
 
@@ -385,6 +386,11 @@ class BxNtfsResponse extends BxBaseModNotificationsResponse
     {
         return isset($aExtras['source']) ? $aExtras['source'] : '';
     }
+
+    protected function _getDate($aExtras)
+    {
+        return isset($aExtras['date']) ? $aExtras['date'] : time();
+    }
 }
 
 /** @} */