New features for modules

This commit is contained in:
Thilina Hasantha committed 2015-12-13 15:21:23 +05:30
1 parent ca3492e30e
commit ea106119ab
25 files changed
+457 -305

No files matched your search

+8 -3
View File
@@ -7,7 +7,7 @@ class NotificationManager{
$this->baseService = $baseService;
}
public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false){
public function addNotification($toEmployee, $message, $action, $type, $toUserId = null, $fromSystem = false, $sendEmail = false){
$userEmp = new User();
@@ -63,7 +63,12 @@ class NotificationManager{
$ok = $noti->Save();
if(!$ok){
error_log("Error adding notification: ".$noti->ErrorMsg());
}
}else if($sendEmail){
$emailSender = BaseService::getInstance()->getEmailSender();
if(!empty($emailSender)){
$emailSender->sendEmailFromNotification($noti);
}
}
}
public function clearNotifications($userId){
@@ -127,4 +132,4 @@ class NotificationManager{
}
}
}