Index: lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java =================================================================== diff -u -rc7c5d74f9c402bdab97bd3fd46436adbfa9202b8 -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java (.../ImportService.java) (revision c7c5d74f9c402bdab97bd3fd46436adbfa9202b8) +++ lams_admin/src/java/org/lamsfoundation/lams/admin/service/ImportService.java (.../ImportService.java) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -310,7 +310,9 @@ rowResult = new ArrayList<>(); StringBuilder generatedPassword = new StringBuilder(); row = sheet.getRow(i); - user = parseUser(row, i, generatedPassword); + if (row != null) { + user = parseUser(row, i, generatedPassword); + } if (emptyRow) { ImportService.log.debug("Row " + i + " is empty."); Index: lams_admin/web/import/importGroups.jsp =================================================================== diff -u -r4dfac2d5a56db552565f34ac9fa2398bc01838b5 -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_admin/web/import/importGroups.jsp (.../importGroups.jsp) (revision 4dfac2d5a56db552565f34ac9fa2398bc01838b5) +++ lams_admin/web/import/importGroups.jsp (.../importGroups.jsp) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -47,7 +47,7 @@ UPLOAD_FILE_MAX_SIZE = ''; $(document).ready(function() { - initFileUpload('${importForm.tmpFileUploadId}', '${language}'); + initFileUpload('', '${language}'); }); /** Index: lams_admin/web/import/importexcel.jsp =================================================================== diff -u -r4dfac2d5a56db552565f34ac9fa2398bc01838b5 -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_admin/web/import/importexcel.jsp (.../importexcel.jsp) (revision 4dfac2d5a56db552565f34ac9fa2398bc01838b5) +++ lams_admin/web/import/importexcel.jsp (.../importexcel.jsp) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -46,7 +46,7 @@ UPLOAD_FILE_MAX_SIZE = ''; $(document).ready(function() { - initFileUpload('${importExcelForm.tmpFileUploadId}', '${language}'); + initFileUpload('', '${language}'); }); /** Index: lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveController.java =================================================================== diff -u -r1fb317e9f6db7094ec64f77782bf0be389012e43 -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveController.java (.../PortraitSaveController.java) (revision 1fb317e9f6db7094ec64f77782bf0be389012e43) +++ lams_central/src/java/org/lamsfoundation/lams/web/PortraitSaveController.java (.../PortraitSaveController.java) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -127,39 +127,39 @@ // upload to the content repository originalFileNode = centralToolContentHandler.uploadFile(is, fileNameWithoutExt + "_original.jpg", - "image/jpeg", true); + "image/jpeg"); is.close(); - log.debug("saved file with uuid: " + originalFileNode.getUuid() + " and portrait uuid " - + originalFileNode.getPortraitUuid() + " and version: " + originalFileNode.getVersion()); + log.debug("saved file with uuid: " + originalFileNode.getNodeId() + " and portrait uuid " + + originalFileNode.getUuid() + " and version: " + originalFileNode.getVersion()); //resize to the large size is = ResizePictureUtil.resize(file.getInputStream(), CommonConstants.PORTRAIT_LARGEST_DIMENSION_LARGE); - NodeKey node = centralToolContentHandler.updateFile(originalFileNode.getUuid(), is, + NodeKey node = centralToolContentHandler.updateFile(originalFileNode.getNodeId(), is, fileNameWithoutExt + "_large.jpg", "image/jpeg"); is.close(); - log.debug("saved file with uuid: " + node.getUuid() + " and version: " + node.getVersion()); + log.debug("saved file with uuid: " + node.getNodeId() + " and version: " + node.getVersion()); //resize to the medium size is = ResizePictureUtil.resize(file.getInputStream(), CommonConstants.PORTRAIT_LARGEST_DIMENSION_MEDIUM); - node = centralToolContentHandler.updateFile(node.getUuid(), is, fileNameWithoutExt + "_medium.jpg", + node = centralToolContentHandler.updateFile(node.getNodeId(), is, fileNameWithoutExt + "_medium.jpg", "image/jpeg"); is.close(); - log.debug("saved file with uuid: " + node.getUuid() + " and version: " + node.getVersion()); + log.debug("saved file with uuid: " + node.getNodeId() + " and version: " + node.getVersion()); //resize to the small size is = ResizePictureUtil.resize(file.getInputStream(), CommonConstants.PORTRAIT_LARGEST_DIMENSION_SMALL); - node = centralToolContentHandler.updateFile(node.getUuid(), is, fileNameWithoutExt + "_small.jpg", + node = centralToolContentHandler.updateFile(node.getNodeId(), is, fileNameWithoutExt + "_small.jpg", "image/jpeg"); is.close(); - log.debug("saved file with uuid: " + node.getUuid() + " and version: " + node.getVersion()); + log.debug("saved file with uuid: " + node.getNodeId() + " and version: " + node.getVersion()); } // delete old portrait file (we only want to keep the user's current portrait) if (user.getPortraitUuid() != null) { centralToolContentHandler.deleteFile(user.getPortraitUuid()); } - user.setPortraitUuid(UUID.fromString(originalFileNode.getPortraitUuid())); + user.setPortraitUuid(UUID.fromString(originalFileNode.getUuid())); userManagementService.saveUser(user); return "forward:/index.do?redirect=portrait"; Index: lams_central/web/WEB-INF/web.xml =================================================================== diff -u -r8dc918ce51ca8656b7cec6107826061a24f19832 -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_central/web/WEB-INF/web.xml (.../web.xml) (revision 8dc918ce51ca8656b7cec6107826061a24f19832) +++ lams_central/web/WEB-INF/web.xml (.../web.xml) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -584,6 +584,7 @@ General secure content /* + /ckeditor/filemanager/* GET POST @@ -667,9 +668,11 @@ - Add lesson + Monitor access /addLesson.jsp /lti/addLesson.jsp + /qb/collection/* + /qb/stats/* GET POST Index: lams_central/web/qb/stats.jsp =================================================================== diff -u -rad80b813ce57fb0277896d5ba213d15b559af004 -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_central/web/qb/stats.jsp (.../stats.jsp) (revision ad80b813ce57fb0277896d5ba213d15b559af004) +++ lams_central/web/qb/stats.jsp (.../stats.jsp) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -153,7 +153,7 @@
- +
"> Index: lams_common/src/java/org/lamsfoundation/lams/usermanagement/service/UserManagementService.java =================================================================== diff -u -r7e259d31f8894bbe8aa368bd503746db01ef05d1 -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_common/src/java/org/lamsfoundation/lams/usermanagement/service/UserManagementService.java (.../UserManagementService.java) (revision 7e259d31f8894bbe8aa368bd503746db01ef05d1) +++ lams_common/src/java/org/lamsfoundation/lams/usermanagement/service/UserManagementService.java (.../UserManagementService.java) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -1220,54 +1220,54 @@ FileInputStream is = new FileInputStream(portraitFile); String fileNameWithoutExt = login; NodeKey originalFileNode = centralToolContentHandler.uploadFile(is, - fileNameWithoutExt + "_original.jpg", "image/jpeg", true); + fileNameWithoutExt + "_original.jpg", "image/jpeg"); is.close(); - log.debug("Saved original portrait with uuid: " + originalFileNode.getUuid() + " and version: " + log.debug("Saved original portrait with uuid: " + originalFileNode.getNodeId() + " and version: " + originalFileNode.getVersion()); //resize to the large size is = new FileInputStream(portraitFile); InputStream modifiedPortraitInputStream = ResizePictureUtil.resize(is, CommonConstants.PORTRAIT_LARGEST_DIMENSION_LARGE); - NodeKey node = centralToolContentHandler.updateFile(originalFileNode.getUuid(), + NodeKey node = centralToolContentHandler.updateFile(originalFileNode.getNodeId(), modifiedPortraitInputStream, fileNameWithoutExt + "_large.jpg", "image/jpeg"); modifiedPortraitInputStream.close(); is.close(); if (log.isDebugEnabled()) { log.debug( - "Saved large portrait with uuid: " + node.getUuid() + " and version: " + node.getVersion()); + "Saved large portrait with uuid: " + node.getNodeId() + " and version: " + node.getVersion()); } //resize to the medium size is = new FileInputStream(portraitFile); modifiedPortraitInputStream = ResizePictureUtil.resize(is, CommonConstants.PORTRAIT_LARGEST_DIMENSION_MEDIUM); - node = centralToolContentHandler.updateFile(node.getUuid(), modifiedPortraitInputStream, + node = centralToolContentHandler.updateFile(node.getNodeId(), modifiedPortraitInputStream, fileNameWithoutExt + "_medium.jpg", "image/jpeg"); modifiedPortraitInputStream.close(); is.close(); if (log.isDebugEnabled()) { - log.debug("Saved medium portrait with uuid: " + node.getUuid() + " and version: " + log.debug("Saved medium portrait with uuid: " + node.getNodeId() + " and version: " + node.getVersion()); } //resize to the small size is = new FileInputStream(portraitFile); modifiedPortraitInputStream = ResizePictureUtil.resize(is, CommonConstants.PORTRAIT_LARGEST_DIMENSION_SMALL); - node = centralToolContentHandler.updateFile(node.getUuid(), modifiedPortraitInputStream, + node = centralToolContentHandler.updateFile(node.getNodeId(), modifiedPortraitInputStream, fileNameWithoutExt + "_small.jpg", "image/jpeg"); modifiedPortraitInputStream.close(); is.close(); if (log.isDebugEnabled()) { log.debug( - "Saved small portrait with uuid: " + node.getUuid() + " and version: " + node.getVersion()); + "Saved small portrait with uuid: " + node.getNodeId() + " and version: " + node.getVersion()); } // delete old portrait file (we only want to keep the user's current portrait) if (user.getPortraitUuid() != null) { centralToolContentHandler.deleteFile(user.getPortraitUuid()); } - user.setPortraitUuid(UUID.fromString(originalFileNode.getPortraitUuid())); + user.setPortraitUuid(UUID.fromString(originalFileNode.getUuid())); saveUser(user); log.info("Uploaded portrait for user " + userId + " with login \"" + login + "\""); Index: lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingController.java =================================================================== diff -u -r7538876b77a0bc0137cdfc9262501464b988061c -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingController.java (.../GroupingController.java) (revision 7538876b77a0bc0137cdfc9262501464b988061c) +++ lams_monitoring/src/java/org/lamsfoundation/lams/monitoring/web/GroupingController.java (.../GroupingController.java) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -48,8 +48,10 @@ import org.lamsfoundation.lams.lesson.service.LessonServiceException; import org.lamsfoundation.lams.monitoring.service.IMonitoringFullService; import org.lamsfoundation.lams.security.ISecurityService; +import org.lamsfoundation.lams.usermanagement.Organisation; import org.lamsfoundation.lams.usermanagement.OrganisationGroup; import org.lamsfoundation.lams.usermanagement.OrganisationGrouping; +import org.lamsfoundation.lams.usermanagement.OrganisationType; import org.lamsfoundation.lams.usermanagement.Role; import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; @@ -283,9 +285,15 @@ @ResponseBody public String saveAsCourseGrouping(HttpServletRequest request, HttpServletResponse response) throws IOException { + Integer organisationId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID); + Organisation organisation = (Organisation) userManagementService.findById(Organisation.class, organisationId); + // get course groupings from top-leve course + if (OrganisationType.CLASS_TYPE.equals(organisation.getOrganisationType().getOrganisationTypeId())) { + organisation = organisation.getParentOrganisation(); + organisationId = organisation.getOrganisationId(); + } HttpSession ss = SessionManager.getSession(); Integer userId = ((UserDTO) ss.getAttribute(AttributeNames.USER)).getUserID(); - Integer organisationId = WebUtil.readIntParam(request, AttributeNames.PARAM_ORGANISATION_ID); String newGroupingName = request.getParameter("name"); // check if user is allowed to view and edit groupings Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java =================================================================== diff -u -r4d39e9dca40fc4b974cb775f27284fbd582c3615 -rd6cc136dd301517f59c05b2ba254a4538dae65aa --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision 4d39e9dca40fc4b974cb775f27284fbd582c3615) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/service/ForumService.java (.../ForumService.java) (revision d6cc136dd301517f59c05b2ba254a4538dae65aa) @@ -322,7 +322,11 @@ @Override public Message getMessage(Long messageUid) throws PersistenceException { - return messageDao.getById(messageUid); + Message message = messageDao.getById(messageUid); + for (Attachment attachment : message.getAttachments()) { + attachment.setFileDisplayUuid(forumToolContentHandler.getFileUuid(attachment.getFileUuid())); + } + return message; } @Override @@ -405,9 +409,10 @@ NodeKey nodeKey = processFile(uploadFile); Attachment file = new Attachment(); - file.setFileUuid(nodeKey.getUuid()); + file.setFileUuid(nodeKey.getNodeId()); file.setFileVersionId(nodeKey.getVersion()); file.setFileName(uploadFile.getName()); + file.setFileDisplayUuid(nodeKey.getUuid()); return file; } @@ -564,6 +569,11 @@ if (topic.getToolSession() == null) { map.put(topic.getCreated(), topic); } + + for (Attachment attachment : topic.getAttachments()) { + attachment.setFileDisplayUuid(forumToolContentHandler.getFileUuid(attachment.getFileUuid())); + } + } return MessageDTO.getMessageDTO(new ArrayList<>(map.values())); } @@ -581,7 +591,11 @@ @Override public List getMessagesByUserUid(Long userId, Long sessionId) { List list = messageDao.getByUserAndSession(userId, sessionId); - + for (Message message : list) { + for (Attachment attachment : message.getAttachments()) { + attachment.setFileDisplayUuid(forumToolContentHandler.getFileUuid(attachment.getFileUuid())); + } + } return MessageDTO.getMessageDTO(list); } @@ -713,6 +727,9 @@ } private MessageDTO makeDTOSetRating(MessageSeq msgSeq, Message message) { + for (Attachment attachment : message.getAttachments()) { + attachment.setFileDisplayUuid(forumToolContentHandler.getFileUuid(attachment.getFileUuid())); + } MessageDTO dto = MessageDTO.getMessageDTO(message); dto.setLevel(msgSeq.getMessageLevel()); //set averageRating