use of org.olat.course.nodes.gta.TaskHelper.FilesLocked in project OpenOLAT by OpenOLAT.
the class GTACoachController method doConfirmCollectTask.
private void doConfirmCollectTask(UserRequest ureq, Task assignedTask) {
String toName = null;
if (assessedGroup != null) {
toName = assessedGroup.getName();
} else if (assessedIdentity != null) {
toName = userManager.getUserDisplayName(assessedIdentity);
}
File[] submittedDocuments;
VFSContainer documentsContainer;
if (GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, assessedGroup);
File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
} else {
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, getIdentity());
File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, getIdentity());
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
}
FilesLocked lockedBy = TaskHelper.getDocumentsLocked(documentsContainer, submittedDocuments);
if (lockedBy != null) {
showWarning("warning.submit.documents.edited", new String[] { lockedBy.getLockedBy(), lockedBy.getLockedFiles() });
} else {
String title = translate("coach.collect.confirm.title");
String text = translate("coach.collect.confirm.text", new String[] { toName });
text = "<div class='o_warning'>" + text + "</div>";
confirmCollectCtrl = activateOkCancelDialog(ureq, title, text, confirmCollectCtrl);
confirmCollectCtrl.setUserObject(assignedTask);
listenTo(confirmCollectCtrl);
}
}
use of org.olat.course.nodes.gta.TaskHelper.FilesLocked in project OpenOLAT by OpenOLAT.
the class GTAParticipantController method doConfirmSubmit.
private void doConfirmSubmit(UserRequest ureq, Task task) {
String title = translate("run.submit.button");
String text;
File[] submittedDocuments;
VFSContainer documentsContainer;
if (GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, assessedGroup);
File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
if (submittedDocuments.length == 0) {
text = "<div class='o_warning'>" + translate("run.submit.confirm.warning.group", new String[] { StringHelper.escapeHtml(assessedGroup.getName()) }) + "</div>";
} else {
text = translate("run.submit.confirm.group", new String[] { StringHelper.escapeHtml(assessedGroup.getName()) });
}
} else {
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, getIdentity());
File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, getIdentity());
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
if (submittedDocuments.length == 0) {
text = "<div class='o_warning'>" + translate("run.submit.confirm.warning") + "</div>";
} else {
text = translate("run.submit.confirm");
}
}
FilesLocked lockedBy = TaskHelper.getDocumentsLocked(documentsContainer, submittedDocuments);
if (lockedBy != null) {
showWarning("warning.submit.documents.edited", new String[] { lockedBy.getLockedBy(), lockedBy.getLockedFiles() });
} else {
confirmSubmitDialog = activateOkCancelDialog(ureq, title, text, confirmSubmitDialog);
confirmSubmitDialog.setUserObject(task);
}
}
use of org.olat.course.nodes.gta.TaskHelper.FilesLocked in project openolat by klemens.
the class GTACoachController method doConfirmCollectTask.
private void doConfirmCollectTask(UserRequest ureq, Task assignedTask) {
String toName = null;
if (assessedGroup != null) {
toName = assessedGroup.getName();
} else if (assessedIdentity != null) {
toName = userManager.getUserDisplayName(assessedIdentity);
}
File[] submittedDocuments;
VFSContainer documentsContainer;
if (GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, assessedGroup);
File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup);
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
} else {
documentsContainer = gtaManager.getSubmitContainer(courseEnv, gtaNode, getIdentity());
File documentsDir = gtaManager.getSubmitDirectory(courseEnv, gtaNode, getIdentity());
submittedDocuments = documentsDir.listFiles(new SystemFilenameFilter(true, false));
}
FilesLocked lockedBy = TaskHelper.getDocumentsLocked(documentsContainer, submittedDocuments);
if (lockedBy != null) {
showWarning("warning.submit.documents.edited", new String[] { lockedBy.getLockedBy(), lockedBy.getLockedFiles() });
} else {
String title = translate("coach.collect.confirm.title");
String text = translate("coach.collect.confirm.text", new String[] { toName });
text = "<div class='o_warning'>" + text + "</div>";
confirmCollectCtrl = activateOkCancelDialog(ureq, title, text, confirmCollectCtrl);
confirmCollectCtrl.setUserObject(assignedTask);
listenTo(confirmCollectCtrl);
}
}
Aggregations