Index: lams_monitoring/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/conf/language/lams/ApplicationResources.properties,v diff -u -r1.66.2.19 -r1.66.2.20 --- lams_monitoring/conf/language/lams/ApplicationResources.properties 18 Nov 2016 17:11:10 -0000 1.66.2.19 +++ lams_monitoring/conf/language/lams/ApplicationResources.properties 23 Nov 2016 10:06:50 -0000 1.66.2.20 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java,v diff -u -r1.118.2.53 -r1.118.2.54 --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 22 Nov 2016 09:12:06 -0000 1.118.2.53 +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/MonitoringAction.java 23 Nov 2016 10:06:50 -0000 1.118.2.54 @@ -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/monitor.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/web/monitor.jsp,v diff -u -r1.27.2.37 -r1.27.2.38 --- lams_monitoring/web/monitor.jsp 21 Nov 2016 10:20:40 -0000 1.27.2.37 +++ lams_monitoring/web/monitor.jsp 23 Nov 2016 10:06:50 -0000 1.27.2.38 @@ -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 @@ + + + + + Index: lams_monitoring/web/css/monitorLesson.css =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/web/css/monitorLesson.css,v diff -u -r1.15.2.18 -r1.15.2.19 --- lams_monitoring/web/css/monitorLesson.css 18 Nov 2016 17:11:10 -0000 1.15.2.18 +++ lams_monitoring/web/css/monitorLesson.css 23 Nov 2016 10:06:50 -0000 1.15.2.19 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_monitoring/web/includes/javascript/monitorLesson.js,v diff -u -r1.44.2.51 -r1.44.2.52 --- lams_monitoring/web/includes/javascript/monitorLesson.js 21 Nov 2016 10:13:29 -0000 1.44.2.51 +++ lams_monitoring/web/includes/javascript/monitorLesson.js 23 Nov 2016 10:06:50 -0000 1.44.2.52 @@ -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.