mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-01 06:28:46 +02:00
Merge branch 'support/3.2' into develop
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Combodo\iTop\Service\Notification\Event;
|
||||
namespace Combodo\iTop\Service\Notification\Event;
|
||||
|
||||
use DBObjectSearch;
|
||||
use DBObjectSet;
|
||||
@@ -17,11 +17,10 @@ class EventNotificationNewsroomGC implements iBackgroundProcess
|
||||
$iDeletionTime = (int) MetaModel::GetConfig()->Get('notifications.itop.read_notification_retention');
|
||||
$oDBObjectSearch = DBObjectSearch::FromOQL("SELECT EventNotificationNewsroom WHERE read='yes' AND read_date < DATE_SUB(NOW(), INTERVAL :deletion_time DAY)", ['deletion_time' => $iDeletionTime]);
|
||||
$oEventNotificationNewsroomSet = new DBObjectSet($oDBObjectSearch);
|
||||
while($oEventNotificationNewsroom = $oEventNotificationNewsroomSet->Fetch()){
|
||||
while ($oEventNotificationNewsroom = $oEventNotificationNewsroomSet->Fetch()) {
|
||||
$oEventNotificationNewsroom->DBDelete();
|
||||
}
|
||||
}
|
||||
catch (Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
ExceptionLog::LogException($e);
|
||||
return false;
|
||||
}
|
||||
@@ -30,6 +29,6 @@ class EventNotificationNewsroomGC implements iBackgroundProcess
|
||||
|
||||
public function GetPeriodicity()
|
||||
{
|
||||
return 24*3600; // Every day
|
||||
return 24 * 3600; // Every day
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
namespace Combodo\iTop\Service\Notification\Event;
|
||||
|
||||
namespace Combodo\iTop\Service\Notification\Event;
|
||||
|
||||
use Action;
|
||||
use Combodo\iTop\Application\Branding;
|
||||
@@ -17,7 +17,8 @@ use utils;
|
||||
* @since 3.2.0
|
||||
* @api
|
||||
*/
|
||||
class EventNotificationNewsroomService {
|
||||
class EventNotificationNewsroomService
|
||||
{
|
||||
/**
|
||||
* @param \Action $oAction
|
||||
* @param int $iContactId
|
||||
@@ -36,7 +37,7 @@ class EventNotificationNewsroomService {
|
||||
*/
|
||||
public static function MakeEventFromAction(Action $oAction, int $iContactId, int $iTriggerId, string $sMessage, string $sTitle, string $sUrl, int $iObjectId, ?string $sObjectClass, string|null $sDate = null): EventNotificationNewsroom
|
||||
{
|
||||
|
||||
|
||||
$oEvent = new EventNotificationNewsroom();
|
||||
$oEvent->Set('title', $sTitle);
|
||||
$oEvent->Set('message', $sMessage);
|
||||
@@ -67,7 +68,7 @@ class EventNotificationNewsroomService {
|
||||
} else {
|
||||
$oEvent->SetCurrentDate('date');
|
||||
}
|
||||
|
||||
|
||||
return $oEvent;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user