diff --git a/lib/BackgroundJob/ArchiveProcess.php b/lib/BackgroundJob/ArchiveProcess.php index f850cfe9909b06b1952ed86346481945e639e2ad..c330a0c1d8d8950ec340784a96571d867dfe9788 100644 --- a/lib/BackgroundJob/ArchiveProcess.php +++ b/lib/BackgroundJob/ArchiveProcess.php @@ -289,18 +289,18 @@ class ArchiveProcess extends TimedJob { $this->_activityManager->publish($event); // notification -// $this->_log('Notification add : archives processed'); -// $notification = $this->_notificationManager->createNotification(); -// $notification->setApp($this->_appName) -// ->setSubject('job_processed', ['nb_success' => $nbSuccess, 'nb_total' => $nbTotal]) -// ->setObject('dematpayslip_process', $dateTimeNow->getTimestamp()) -// ->setUser($userId); -// //->setIcon($this->_urlGenerator->getAbsoluteURL($this->_urlGenerator->imagePath($this->_appName, 'folder.png'))) -// //->setLink($folderLink); -// if ($this->_notificationManager->getCount($notification) === 0) { -// $notification->setDateTime(new DateTime()); -// $this->_notificationManager->notify($notification); -// } + $this->_log('Notification add : archives processed'); + $notification = $this->_notificationManager->createNotification(); + $notification->setApp($this->_appName) + ->setSubject('job_processed', ['nb_success' => $nbSuccess, 'nb_total' => $nbTotal]) + ->setObject('dematpayslip_process', $dateTimeNow->getTimestamp()) + ->setUser($userId); + //->setIcon($this->_urlGenerator->getAbsoluteURL($this->_urlGenerator->imagePath($this->_appName, 'folder.png'))) + //->setLink($folderLink); + if ($this->_notificationManager->getCount($notification) === 0) { + $notification->setDateTime(new DateTime()); + $this->_notificationManager->notify($notification); + } } } $this->_log('Archives process : End'); diff --git a/lib/BackgroundJob/IndexationProcess.php b/lib/BackgroundJob/IndexationProcess.php index bb80bb42f92f7a69c245b2f0c202e23bbbd71cfe..23870c8693c8f3199bd9a364c84457b656c33fc8 100644 --- a/lib/BackgroundJob/IndexationProcess.php +++ b/lib/BackgroundJob/IndexationProcess.php @@ -302,18 +302,18 @@ class IndexationProcess extends TimedJob { $this->_activityManager->publish($event); // notification -// $this->_log('Notification add : indexation processed'); -// $notification = $this->_notificationManager->createNotification(); -// $notification->setApp($this->_appName) -// ->setSubject('job_processed', ['nb_success' => $nbSuccess, 'nb_total' => $nbTotal]) -// ->setObject('dematpayslip_process', $dateTimeNow->getTimestamp()) -// ->setUser($userId); -// //->setIcon($this->_urlGenerator->getAbsoluteURL($this->_urlGenerator->imagePath($this->_appName, 'folder.png'))) -// //->setLink($folderLink); -// if ($this->_notificationManager->getCount($notification) === 0) { -// $notification->setDateTime(new DateTime()); -// $this->_notificationManager->notify($notification); -// } + $this->_log('Notification add : indexation processed'); + $notification = $this->_notificationManager->createNotification(); + $notification->setApp($this->_appName) + ->setSubject('job_processed', ['nb_success' => $nbSuccess, 'nb_total' => $nbTotal]) + ->setObject('dematpayslip_process', $dateTimeNow->getTimestamp()) + ->setUser($userId); + //->setIcon($this->_urlGenerator->getAbsoluteURL($this->_urlGenerator->imagePath($this->_appName, 'folder.png'))) + //->setLink($folderLink); + if ($this->_notificationManager->getCount($notification) === 0) { + $notification->setDateTime(new DateTime()); + $this->_notificationManager->notify($notification); + } } } }