Index: lams_admin/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r4c51f9c8b6fab7efa4d5296f1ee60c1c3bd207e5 -r4b865d9e5cdcaa1a21b113764194305d9a7480dd --- lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4c51f9c8b6fab7efa4d5296f1ee60c1c3bd207e5) +++ lams_admin/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4b865d9e5cdcaa1a21b113764194305d9a7480dd) @@ -567,6 +567,7 @@ label.type.learner.content.updated =Learner's Entry Modified label.type.learner.content.show.hide =Learner's Entry Shown/Hidden label.type.unknown =Unknown +label.type.live.edit =Live Edit label.area.lesson =Lesson label.area.security =Security label.area.notification =Notification Index: lams_build/lib/lams/lams.jar =================================================================== diff -u -r664113e5a7f816094b983d8c601e0de4a4b2d19d -r4b865d9e5cdcaa1a21b113764194305d9a7480dd Binary files differ Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -rba6d2394558dc6e82f56561d0913c9e75d000e89 -r4b865d9e5cdcaa1a21b113764194305d9a7480dd --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision ba6d2394558dc6e82f56561d0913c9e75d000e89) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4b865d9e5cdcaa1a21b113764194305d9a7480dd) @@ -818,6 +818,8 @@ authoring.tbl.desc.question=These questions are for iRA and tRA. Click "Create Question" to add more questions. authoring.tbl.desc.ae=State the questions for AE. Click "Create Question" to add more questions. +audit.live.edit.start=Live Edit of Learning Design "{0}" ({1}) for Lesson ({2}) started by {3} ({4}) +audit.live.edit.end=Live Edit of Learning Design "{0}" ({1}) for Lesson ({2}) completed by {3} ({4}) #======= End labels: Exported 757 labels for en AU ===== Index: lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java =================================================================== diff -u -r045ebfd1d11d9ed0a1f81a00abb1a2ea373e8d93 -r4b865d9e5cdcaa1a21b113764194305d9a7480dd --- lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision 045ebfd1d11d9ed0a1f81a00abb1a2ea373e8d93) +++ lams_central/src/java/org/lamsfoundation/lams/authoring/service/AuthoringService.java (.../AuthoringService.java) (revision 4b865d9e5cdcaa1a21b113764194305d9a7480dd) @@ -448,8 +448,17 @@ for (Lesson lesson : (Set) design.getLessons()) { lesson.setLockedForEdit(true); + + if ( design.getEditOverrideUser() == null || design.getEditOverrideLock() == null || !design.getEditOverrideLock() ) { + // create audit log entry only the first time - do not redo one if the monitor has restarted editing. + String message = messageService.getMessage("audit.live.edit.start", new Object[] { design.getTitle(), + design.getLearningDesignId(), lesson.getLessonId(), user.getLogin(), user.getUserId() }); + logEventService.logEvent(LogEvent.TYPE_LIVE_EDIT, user.getUserId(), null, lesson.getLessonId(), null, + message); + } } + // lock Learning Design design.setEditOverrideLock(true); design.setEditOverrideUser(user); @@ -532,6 +541,11 @@ for (Lesson lesson : (Set) design.getLessons()) { lesson.setLockedForEdit(false); + String message = messageService.getMessage("audit.live.edit.end", new Object[] { design.getTitle(), + design.getLearningDesignId(), lesson.getLessonId(), user.getLogin(), user.getUserId() }); + logEventService.logEvent(LogEvent.TYPE_LIVE_EDIT, user.getUserId(), null, lesson.getLessonId(), null, + message); + // LDEV-1899 only mark learners uncompleted if a change was saved and an activity added if (!cancelled && (firstAddedActivityId != null)) { // the lesson may now have additional activities on the end, Index: lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch20180601.sql =================================================================== diff -u --- lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch20180601.sql (revision 0) +++ lams_common/src/java/org/lamsfoundation/lams/dbupdates/patch20180601.sql (revision 4b865d9e5cdcaa1a21b113764194305d9a7480dd) @@ -0,0 +1,14 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-4564 Audit Log entry for Live Edit +INSERT INTO lams_log_event_type (log_event_type_id, description, area) VALUES(22, 'TYPE_LIVE_EDIT', 'LESSON'); + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_common/src/java/org/lamsfoundation/lams/logevent/LogEvent.java =================================================================== diff -u -r045ebfd1d11d9ed0a1f81a00abb1a2ea373e8d93 -r4b865d9e5cdcaa1a21b113764194305d9a7480dd --- lams_common/src/java/org/lamsfoundation/lams/logevent/LogEvent.java (.../LogEvent.java) (revision 045ebfd1d11d9ed0a1f81a00abb1a2ea373e8d93) +++ lams_common/src/java/org/lamsfoundation/lams/logevent/LogEvent.java (.../LogEvent.java) (revision 4b865d9e5cdcaa1a21b113764194305d9a7480dd) @@ -62,6 +62,7 @@ public static final int TYPE_LEARNER_CONTENT_UPDATED = 19; // Audit Service public static final int TYPE_LEARNER_CONTENT_SHOW_HIDE = 20; // Audit Service public static final int TYPE_UNKNOWN = 21; // catch all for conversion + public static final int TYPE_LIVE_EDIT = 22; // Start or end Live Edit of a lesson /** *************************************************************** */ Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/ActivityMapping.java =================================================================== diff -u -rfd1c6c450376476c752e6be5cb6048a2e370bd42 -r4b865d9e5cdcaa1a21b113764194305d9a7480dd --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/ActivityMapping.java (.../ActivityMapping.java) (revision fd1c6c450376476c752e6be5cb6048a2e370bd42) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/util/ActivityMapping.java (.../ActivityMapping.java) (revision 4b865d9e5cdcaa1a21b113764194305d9a7480dd) @@ -84,8 +84,10 @@ String strutsAction = this.activityMappingStrategy.getActivityAction(activity); strutsAction = WebUtil.appendParameterToURL(strutsAction, AttributeNames.PARAM_LEARNER_PROGRESS_ID, progress.getLearnerProgressId().toString()); - strutsAction = WebUtil.appendParameterToURL(strutsAction, AttributeNames.PARAM_ACTIVITY_ID, - activity.getActivityId().toString()); + if ( activity != null ) { + strutsAction = WebUtil.appendParameterToURL(strutsAction, AttributeNames.PARAM_ACTIVITY_ID, + activity.getActivityId().toString()); + } if ((activity != null) && activity.isToolActivity()) { // always use redirect false for a ToolActivity as ToolDisplayActivity