New features for modules

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

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{
}
}
}