Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r56c565f6b6e596ec0de434127769de8986a090be -r57ae9b79f99a9cb3f1a39454626086bc0ed1c9ac --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 56c565f6b6e596ec0de434127769de8986a090be) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 57ae9b79f99a9cb3f1a39454626086bc0ed1c9ac) @@ -315,4 +315,9 @@ label.planner.export.sequence=Export sequence error.planner.export.template=There was an error while exporting the template. + +index.coursegradebook =Grade Book Monitor +index.coursegradebook.tooltip =Open course-wide Grade Book +index.coursegradebook.learner =My Grade Book +index.coursegradebookmonitor =Grade Book #======= End labels: Exported 222 labels for en AU ===== Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r56c565f6b6e596ec0de434127769de8986a090be -r57ae9b79f99a9cb3f1a39454626086bc0ed1c9ac --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 56c565f6b6e596ec0de434127769de8986a090be) +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 57ae9b79f99a9cb3f1a39454626086bc0ed1c9ac) @@ -314,4 +314,20 @@ label.planner.export.sequence=Export sequence error.planner.export.template=There was an error while exporting the template. + + +index.coursegradebook =Grade Book Monitor +index.coursegradebook.tooltip =Open course-wide Grade Book +index.coursegradebook.learner =My Grade Book +index.coursegradebookmonitor =Grade Book + + + + + + + + + + #======= End labels: Exported 222 labels for en AU ===== Index: lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java =================================================================== diff -u -reb9abdee9d6131987318218a693ad7e60b8f1d1f -r57ae9b79f99a9cb3f1a39454626086bc0ed1c9ac --- lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision eb9abdee9d6131987318218a693ad7e60b8f1d1f) +++ lams_central/src/java/org/lamsfoundation/lams/web/DisplayGroupAction.java (.../DisplayGroupAction.java) (revision 57ae9b79f99a9cb3f1a39454626086bc0ed1c9ac) @@ -139,6 +139,17 @@ + org.getOrganisationId() + ")", "manage-group-button", null)); } } + + if (org.getEnableGradeBookForLearners() && contains(roles, Role.ROLE_LEARNER)) { + + String link = "javascript:openGradeBookLearnerPopup(" + "'" + org.getName() + "','" + + Configuration.get(ConfigurationKeys.SERVER_URL) + + "/gradebook/gradebookLearning.do?dispatch=courseLearner&organisationID=" + + org.getOrganisationId() + "'," + "1220,500,0,0);"; + + links.add(new IndexLinkBean("index.coursegradebook.learner", link, "manage-group-button", null)); + } + if ((contains(roles, Role.ROLE_GROUP_ADMIN) || contains(roles, Role.ROLE_GROUP_MANAGER) || contains(roles, Role.ROLE_MONITOR)) && stateId.equals(OrganisationState.ACTIVE)) { @@ -157,11 +168,25 @@ + "/findUserLessons.do?dispatch=getResults&courseID=" + org.getOrganisationId() + "&KeepThis=true&TB_iframe=true&height=400&width=600", "search-lesson thickbox" + org.getOrganisationId(), "index.searchlesson.tooltip")); + + // Adding gradebook course monitor links if enabled + if (org.getEnableGradeBookForMonitors() && contains(roles, Role.ROLE_GROUP_MANAGER)) { + String link = "javascript:openGradeBookCourseMonitorPopup(" + "'" + org.getName() + "','" + + Configuration.get(ConfigurationKeys.SERVER_URL) + + "/gradebook/gradebookMonitoring.do?dispatch=courseMonitor&organisationID=" + + org.getOrganisationId() + "'," + "1220,500,0,0);"; + + moreLinks.add(new IndexLinkBean("index.coursegradebook", link, "manage-group-button", + "index.coursegradebook.tooltip")); + + } + } else {//CLASS_TYPE if (contains(roles, Role.ROLE_GROUP_MANAGER) || contains(roles, Role.ROLE_MONITOR)) - links.add(new IndexLinkBean("index.addlesson", Configuration.get(ConfigurationKeys.SERVER_URL) - + "/home.do?method=addLesson&courseID=" + org.getParentOrganisation().getOrganisationId() - + "&classID=" + org.getOrganisationId() + moreLinks.add(new IndexLinkBean("index.coursegradebook", Configuration + .get(ConfigurationKeys.SERVER_URL) + + "/gradebook/ggradebookMonitoring.do?dispatch=courseMonitor&organisationID=" + + org.getParentOrganisation().getOrganisationId() + "&KeepThis=true&TB_iframe=true&height=480&width=610", "add-lesson-button thickbox" + org.getOrganisationId(), null)); } @@ -258,6 +283,12 @@ } } + // getting the organisation + Organisation org = (Organisation) service.findById(Organisation.class, orgId); + + // Getting the parent organisation if applicable + Organisation parent = org.getParentOrganisation(); + // iterate through user's lessons where they are staff, and add staff links to the beans in the map. Map staffMap = getLessonService().getLessonsByOrgAndUserWithCompletedFlag(userId, orgId, true); @@ -272,13 +303,26 @@ if (contains(roles, Role.ROLE_GROUP_MANAGER) || contains(roles, Role.ROLE_MONITOR)) { lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:openMonitorLesson(" + bean.getId() + ")")); + } } else if (stateId.equals(OrganisationState.ARCHIVED)) { if (contains(roles, Role.ROLE_GROUP_MANAGER)) { lessonLinks.add(new IndexLinkBean("index.monitor", "javascript:openMonitorLesson(" + bean.getId() + ")")); } } + + // Adding gradebook course monitor links if enabled + if ((contains(roles, Role.ROLE_GROUP_MANAGER) || contains(roles, Role.ROLE_MONITOR)) + && org.getEnableGradeBookForMonitors() + || (parent != null && parent.getEnableGradeBookForMonitors())) { + String link = "javascript:openGradeBookLessonMonitorPopup(" + "'" + org.getName() + "','" + + Configuration.get(ConfigurationKeys.SERVER_URL) + + "/gradebook/gradebookMonitoring.do?lessonID=" + bean.getId() + "'," + "1220,700,0,0);"; + + lessonLinks.add(new IndexLinkBean("index.coursegradebookmonitor", link)); + } + if (lessonLinks.size() > 0) { bean.setLinks(lessonLinks); } Index: lams_central/web/includes/javascript/openUrls.js =================================================================== diff -u -rc697b5c30ab742ab453859355b35cd518856334f -r57ae9b79f99a9cb3f1a39454626086bc0ed1c9ac --- lams_central/web/includes/javascript/openUrls.js (.../openUrls.js) (revision c697b5c30ab742ab453859355b35cd518856334f) +++ lams_central/web/includes/javascript/openUrls.js (.../openUrls.js) (revision 57ae9b79f99a9cb3f1a39454626086bc0ed1c9ac) @@ -17,6 +17,9 @@ var pWin = null; var copyrightWin = null; var customWin = null; + var gradeBookMonWin = null; + var gradeBookLrnWin = null; + var gradeBookMonLessonWin = null; function closeAllChildren(){ if (authorWin && !authorWin.closed) authorWin.closeWindow(); @@ -28,6 +31,8 @@ if (omWin && !omWin.closed) omWin.close(); if (pWin && !pWin.closed) pWin.close(); if (copyrightWin && !copyrightWin.closed) copyrightWin.close(); + if (gradeBookMonWin && !gradeBookMonWin.closed) gradeBookMonWin.close(); + if (gradeBookLrnWin && !gradeBookLrnWin.closed) gradeBookLrnWin.close(); } function openProfile() @@ -308,4 +313,31 @@ } } } + + function openGradeBookCourseMonitorPopup(winname, url, width, height, left, top) { + if(gradeBookMonWin && !gradeBookMonWin.closed ){ + gradeBookMonWin.focus(); + }else{ + gradeBookMonWin = window.open(url, winname,'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); + gradeBookMonWin.focus(); + } + } + + function openGradeBookLearnerPopup(winname, url, width, height, left, top) { + if(gradeBookLrnWin && !gradeBookLrnWin.closed ){ + gradeBookLrnWin.focus(); + }else{ + gradeBookLrnWin = window.open(url, winname,'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); + gradeBookLrnWin.focus(); + } + } + + function openGradeBookLessonMonitorPopup(winname, url, width, height, left, top) { + if(gradeBookMonLessonWin && !gradeBookMonLessonWin.closed ){ + gradeBookMonLessonWin.focus(); + }else{ + gradeBookMonLessonWin = window.open(url, winname,'resizable,left='+left+',top='+top+',width='+width+',height='+height+',scrollbars'); + gradeBookMonLessonWin.focus(); + } + } //-->