diff --git a/lams_monitoring/conf/language/lams/ApplicationResources.properties b/lams_monitoring/conf/language/lams/ApplicationResources.properties index fd9088e083e..fccb24b9b18 100644 --- a/lams_monitoring/conf/language/lams/ApplicationResources.properties +++ b/lams_monitoring/conf/language/lams/ApplicationResources.properties @@ -405,5 +405,6 @@ tour.progress.email.configure.title =Schedule progress reports tour.progress.email.confure.content =Set up the dates to automatically send emails with a summary of learners progress to all monitors for this lesson. error.date.in.past =Selected date is in the past. - +audit.lesson.removed =Lesson "{0}" ({1}) status changed to removed. +audit.lesson.removed.permanently =Lesson "{0}" ({1}) removed permanently. #======= End labels: Exported 398 labels for en AU ===== diff --git a/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java b/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java index 4743e2a3437..23a2d8ac850 100644 --- a/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java +++ b/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/service/MonitoringService.java @@ -145,6 +145,8 @@ public class MonitoringService implements IMonitoringService { private static Logger log = Logger.getLogger(MonitoringService.class); private static final String AUDIT_LESSON_CREATED_KEY = "audit.lesson.created"; + private static final String AUDIT_LESSON_REMOVED_KEY = "audit.lesson.removed"; + private static final String AUDIT_LESSON_REMOVED_PERMANENTLY_KEY = "audit.lesson.removed.permanently"; private ILessonDAO lessonDAO; @@ -867,6 +869,9 @@ public void removeLesson(long lessonId, Integer userId) { securityService.isLessonMonitor(lessonId, userId, "remove lesson", true); Lesson requestedLesson = lessonDAO.getLesson(new Long(lessonId)); setLessonState(requestedLesson, Lesson.REMOVED_STATE); + + writeAuditLog(MonitoringService.AUDIT_LESSON_REMOVED_KEY, + new Object[] { requestedLesson.getLessonName(), requestedLesson.getLessonId() }); } @SuppressWarnings("unchecked") @@ -937,6 +942,9 @@ public void removeLessonPermanently(long lessonId, Integer userId) { // finally remove the learning design lessonDAO.delete(learningDesign); + + writeAuditLog(MonitoringService.AUDIT_LESSON_REMOVED_PERMANENTLY_KEY, + new Object[] { lesson.getLessonName(), lesson.getLessonId() }); } @Override