Merge branch 'deactivateSupervisorChanged' into develop

This commit is contained in:
Emil Siverhall 2013-02-20 13:50:00 +01:00
commit 50951e1afb

@ -461,29 +461,29 @@ public class ImporterFacade {
final Employee emp = roleDao.makeEmployee(linkedUser);
project.setHeadSupervisor(emp);
/**
* We have no choice but to instantiate a source here like this
*/
NotificationSource source = new NotificationSource();
source.setMessage("Project head supervisor change");
source.setSupervisorSource(sourceURL.getProjectSupervisorURL() + project.getId());
source.setUserSource(sourceURL.getProjectStudentURL() + project.getId());
projectService.sendNotifications(project, project.getId()==null, source);
notificationController.notifyProject(project, ProjectEvent.Event.HEAD_SUPERVISOR_CHANGED, source);
GeneralSystemSettings settings = systemSettingsService.getGeneralSystemSettingsInstance();
MailEvent mail = new MailEvent();
mail.setFromEmail(settings.getSystemFromMail());
mail.setFromName(settings.getMailFromName());
mail.setMessageBody("The head supervisor for the project " + project.getTitle() + " was changed in Daisy. " +
"A notification has been sent to all involved. Staff must also email all involved and explain in " +
"more detail what has happened and why.");
mail.setSubject("[SciPro] Project head supervisor change");
mail.setNonUserRecipients(new HashSet<String>(settings.getTurnitinExpirationMails()));
mailEventDao.save(mail);
// /**
// * We have no choice but to instantiate a source here like this
// */
// NotificationSource source = new NotificationSource();
// source.setMessage("Project head supervisor change");
// source.setSupervisorSource(sourceURL.getProjectSupervisorURL() + project.getId());
// source.setUserSource(sourceURL.getProjectStudentURL() + project.getId());
// projectService.sendNotifications(project, project.getId()==null, source);
//
// notificationController.notifyProject(project, ProjectEvent.Event.HEAD_SUPERVISOR_CHANGED, source);
//
// GeneralSystemSettings settings = systemSettingsService.getGeneralSystemSettingsInstance();
// MailEvent mail = new MailEvent();
//
// mail.setFromEmail(settings.getSystemFromMail());
// mail.setFromName(settings.getMailFromName());
// mail.setMessageBody("The head supervisor for the project " + project.getTitle() + " was changed in Daisy. " +
// "A notification has been sent to all involved. Staff must also email all involved and explain in " +
// "more detail what has happened and why.");
// mail.setSubject("[SciPro] Project head supervisor change");
// mail.setNonUserRecipients(new HashSet<String>(settings.getTurnitinExpirationMails()));
//
// mailEventDao.save(mail);
break;
}