From 29e599983ef6ac6f24a6bfa33958213705cb2a78 Mon Sep 17 00:00:00 2001
From: Liquidsoul <liquidsoul@liquidsoul.fr>
Date: Wed, 17 Apr 2019 16:49:03 +0200
Subject: [PATCH] Add smarty dependency on NotificationService

---
 action/add_comment.php                                 | 2 +-
 adminstuds.php                                         | 2 +-
 app/classes/Framadate/Services/NotificationService.php | 4 +++-
 studs.php                                              | 2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/action/add_comment.php b/action/add_comment.php
index 71b9ca3a..11c9152d 100644
--- a/action/add_comment.php
+++ b/action/add_comment.php
@@ -43,7 +43,7 @@ $logService = new LogService();
 $pollService = new PollService($connect, $logService);
 $inputService = new InputService();
 $mailService = new MailService($config['use_smtp'], $config['smtp_options'], $config['use_sendmail']);
-$notificationService = new NotificationService($mailService);
+$notificationService = new NotificationService($mailService, $smarty);
 $securityService = new SecurityService();
 
 /* PAGE */
diff --git a/adminstuds.php b/adminstuds.php
index 26a2e282..93e7b418 100644
--- a/adminstuds.php
+++ b/adminstuds.php
@@ -51,7 +51,7 @@ $pollService = new PollService($connect, $logService);
 $adminPollService = new AdminPollService($connect, $pollService, $logService);
 $inputService = new InputService();
 $mailService = new MailService($config['use_smtp'], $config['smtp_options'], $config['use_sendmail']);
-$notificationService = new NotificationService($mailService);
+$notificationService = new NotificationService($mailService, $smarty);
 $sessionService = new SessionService();
 
 /* PAGE */
diff --git a/app/classes/Framadate/Services/NotificationService.php b/app/classes/Framadate/Services/NotificationService.php
index 615629c3..02a74e49 100644
--- a/app/classes/Framadate/Services/NotificationService.php
+++ b/app/classes/Framadate/Services/NotificationService.php
@@ -15,9 +15,11 @@ class NotificationService {
     const DELETED_POLL = 11;
 
     private $mailService;
+    private $smarty;
 
-    function __construct(MailService $mailService) {
+    function __construct(MailService $mailService, \Smarty $smarty) {
         $this->mailService = $mailService;
+        $this->smarty = $smarty;
     }
 
     /**
diff --git a/studs.php b/studs.php
index 5dec7c90..2d308820 100644
--- a/studs.php
+++ b/studs.php
@@ -59,7 +59,7 @@ $logService = new LogService();
 $pollService = new PollService($connect, $logService);
 $inputService = new InputService();
 $mailService = new MailService($config['use_smtp'], $config['smtp_options'], $config['use_sendmail']);
-$notificationService = new NotificationService($mailService);
+$notificationService = new NotificationService($mailService, $smarty);
 $securityService = new SecurityService();
 $sessionService = new SessionService();
 
-- 
GitLab