Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r8d7332a908101db10e719593c2e6666247e5934f -r4bbff846d0964a517ddad7020fe6cf10536c347e --- lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 8d7332a908101db10e719593c2e6666247e5934f) +++ lams_monitoring/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4bbff846d0964a517ddad7020fe6cf10536c347e) @@ -208,6 +208,9 @@ button.view.learners.tooltip =Shows all learners assigned to this lesson and allows to email them button.edit.class =Edit Class button.edit.class.tooltip =Edit the list of learners and monitors assigned to this lesson +class.add.all.confirm =Do you want to add all learners to the class? +class.add.all.success =All learners were added to the class +button.edit.class.add.all =Add all learners button.open.im =Open IM lesson.change.state =Change Status: lesson.select.state =Select status Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java =================================================================== diff -u -rb7720dcc6709cdd217b2c0c2a54c9cfd01c79c3f -r4bbff846d0964a517ddad7020fe6cf10536c347e --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision b7720dcc6709cdd217b2c0c2a54c9cfd01c79c3f) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java (.../MonitoringAction.java) (revision 4bbff846d0964a517ddad7020fe6cf10536c347e) @@ -404,7 +404,7 @@ public ActionForward addAllOrganisationLearnersToLesson(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException { Long lessonId = WebUtil.readLongParam(request, AttributeNames.PARAM_LESSON_ID); - if (!getSecurityService().isLessonMonitor(lessonId, getUserId(), "get lesson learners", false)) { + if (!getSecurityService().isLessonMonitor(lessonId, getUserId(), "add all lesson learners to lesson", false)) { response.sendError(HttpServletResponse.SC_FORBIDDEN, "User is not a monitor in the lesson"); return null; } Index: lams_monitoring/web/css/monitorLesson.css =================================================================== diff -u -r8d7332a908101db10e719593c2e6666247e5934f -r4bbff846d0964a517ddad7020fe6cf10536c347e --- lams_monitoring/web/css/monitorLesson.css (.../monitorLesson.css) (revision 8d7332a908101db10e719593c2e6666247e5934f) +++ lams_monitoring/web/css/monitorLesson.css (.../monitorLesson.css) (revision 4bbff846d0964a517ddad7020fe6cf10536c347e) @@ -202,20 +202,6 @@ height: 23px; } -.dialogSearchPhrase { - width: 90%; -} - -.dialogSearchPhraseIcon { - margin-top: 2px; -} - -.dialogSearchPhraseClear { - visibility: hidden; - margin-top: 3px; - cursor: pointer; -} - #classDialogTable input[type="checkbox"] { margin: 0 5px 0px 0px; border: none; @@ -226,10 +212,29 @@ border-right: thin solid black; } +#classLearnerTable #addAllLearnersButton { + margin-right: 10px; +} + #classMonitorTable { + width: 320px; margin-left: 10px; } +.dialogSearchPhrase { + width: 90%; +} + +.dialogSearchPhraseIcon { + margin-top: 2px; +} + +.dialogSearchPhraseClear { + visibility: hidden; + margin-top: 3px; + cursor: pointer; +} + #emailDialog { width: 100%; } Index: lams_monitoring/web/includes/javascript/monitorLesson.js =================================================================== diff -u -r7a3f08b6db6d88c2d47856121f3b07de6fce3b6e -r4bbff846d0964a517ddad7020fe6cf10536c347e --- lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 7a3f08b6db6d88c2d47856121f3b07de6fce3b6e) +++ lams_monitoring/web/includes/javascript/monitorLesson.js (.../monitorLesson.js) (revision 4bbff846d0964a517ddad7020fe6cf10536c347e) @@ -1444,6 +1444,26 @@ }); } +/** + * Adds all learners to the class. + */ +function addAllLearners(){ + if (confirm(LABELS.CLASS_ADD_ALL_CONFIRM)) { + $.ajax({ + url : LAMS_URL + 'monitoring/monitoring.do', + type : 'POST', + cache : false, + data : { + 'method' : 'addAllOrganisationLearnersToLesson', + 'lessonID' : lessonId + }, + success : function(){ + alert(LABELS.CLASS_ADD_ALL_SUCCESS); + $('#classDialog').modal('hide'); + } + }); + } +} /** * Opens Authoring for live edit. Index: lams_monitoring/web/monitor.jsp =================================================================== diff -u -rb87dce2d1c7f8837679d21e327a79a4d440b55f2 -r4bbff846d0964a517ddad7020fe6cf10536c347e --- lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision b87dce2d1c7f8837679d21e327a79a4d440b55f2) +++ lams_monitoring/web/monitor.jsp (.../monitor.jsp) (revision 4bbff846d0964a517ddad7020fe6cf10536c347e) @@ -123,6 +123,10 @@ LESSON_ERROR_SCHEDULE_DATE : decoderDiv.html('').text(), LESSON_EDIT_CLASS : '', + + CLASS_ADD_ALL_CONFIRM : '', + + CLASS_ADD_ALL_SUCCESS : '', LESSON_GROUP_DIALOG_CLASS : '', @@ -636,6 +640,14 @@ + + + + +