use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class GTACoachController method doOpenMailForm.
private void doOpenMailForm(UserRequest ureq) {
// build recipient list
ContactList contactList = null;
if (assessedGroup != null) {
String toName = assessedGroup.getName();
contactList = new ContactList(toName);
List<Identity> memberList = businessGroupService.getMembers(assessedGroup, GroupRoles.participant.name());
contactList.addAllIdentites(memberList);
} else if (assessedIdentity != null) {
String toName = userManager.getUserDisplayName(assessedIdentity);
contactList = new ContactList(toName);
contactList.add(assessedIdentity);
}
// open dialog with mail form
if (contactList != null && contactList.getEmailsAsStrings().size() > 0) {
removeAsListenerAndDispose(emailController);
ContactMessage cmsg = new ContactMessage(ureq.getIdentity());
cmsg.addEmailTo(contactList);
emailController = new ContactFormController(ureq, getWindowControl(), true, false, false, cmsg);
listenTo(emailController);
removeAsListenerAndDispose(cmc);
// same title as link button
String title = translate(emailLink.getI18n());
cmc = new CloseableModalController(getWindowControl(), translate("close"), emailController.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class GTACoachRevisionAndCorrectionsController method doConfirmReturnToRevisions.
private void doConfirmReturnToRevisions(UserRequest ureq) {
if (confirmReturnToRevisionsCtrl != null)
return;
confirmReturnToRevisionsCtrl = new ConfirmRevisionsController(ureq, getWindowControl(), assignedTask, assessedIdentity, assessedGroup, gtaNode, courseEnv);
listenTo(confirmReturnToRevisionsCtrl);
// same title as link button
String title = translate("coach.revisions.confirm.title");
cmc = new CloseableModalController(getWindowControl(), translate("close"), confirmReturnToRevisionsCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class GTACoachedGroupGradingController method doOpenAssessmentForm.
private void doOpenAssessmentForm(UserRequest ureq) {
removeAsListenerAndDispose(assessmentCtrl);
RepositoryEntry courseEntry = courseEnv.getCourseGroupManager().getCourseEntry();
assessmentCtrl = new GroupAssessmentController(ureq, getWindowControl(), courseEntry, gtaNode, assessedGroup);
listenTo(assessmentCtrl);
String title = translate("grading");
cmc = new CloseableModalController(getWindowControl(), "close", assessmentCtrl.getInitialComponent(), true, title, true);
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class TaskFolderCallback method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest,
* org.olat.core.gui.control.Controller, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest urequest, Controller source, Event event) {
if (source == modulesForm) {
boolean onoff = event.getCommand().endsWith("true");
if (event.getCommand().startsWith("task")) {
config.set(TACourseNode.CONF_TASK_ENABLED, new Boolean(onoff));
myTabbedPane.setEnabled(taskTabPosition, onoff);
if (onoff) {
accessabilityVC.put("taskCondition", taskConditionC.getInitialComponent());
} else {
accessabilityVC.remove(taskConditionC.getInitialComponent());
}
} else if (event.getCommand().startsWith("dropbox")) {
config.set(TACourseNode.CONF_DROPBOX_ENABLED, new Boolean(onoff));
myTabbedPane.setEnabled(dropboxTabPosition, onoff);
if (onoff) {
accessabilityVC.put("dropCondition", dropConditionC.getInitialComponent());
} else {
accessabilityVC.remove(dropConditionC.getInitialComponent());
}
} else if (event.getCommand().startsWith("returnbox")) {
config.set(TACourseNode.CONF_RETURNBOX_ENABLED, new Boolean(onoff));
if (onoff) {
accessabilityVC.put("returnboxCondition", returnboxConditionC.getInitialComponent());
} else {
accessabilityVC.remove(returnboxConditionC.getInitialComponent());
}
} else if (event.getCommand().startsWith("scoring")) {
config.set(TACourseNode.CONF_SCORING_ENABLED, new Boolean(onoff));
myTabbedPane.setEnabled(scoringTabPosition, onoff);
if (onoff) {
accessabilityVC.put("scoringCondition", scoringConditionC.getInitialComponent());
} else {
accessabilityVC.remove(scoringConditionC.getInitialComponent());
}
} else if (event.getCommand().startsWith("solution")) {
config.set(TACourseNode.CONF_SOLUTION_ENABLED, new Boolean(onoff));
myTabbedPane.setEnabled(solutionTabPosition, onoff);
if (onoff) {
accessabilityVC.put("solutionCondition", solutionConditionC.getInitialComponent());
} else {
accessabilityVC.remove(solutionConditionC.getInitialComponent());
}
}
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
return;
} else if (source == taskConditionC) {
if (event == Event.CHANGED_EVENT) {
node.setConditionTask(taskConditionC.getCondition());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == dropConditionC) {
if (event == Event.CHANGED_EVENT) {
node.setConditionDrop(dropConditionC.getCondition());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == returnboxConditionC) {
if (event == Event.CHANGED_EVENT) {
node.setConditionReturnbox(returnboxConditionC.getCondition());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == scoringConditionC) {
if (event == Event.CHANGED_EVENT) {
node.setConditionScoring(scoringConditionC.getCondition());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == solutionConditionC) {
if (event == Event.CHANGED_EVENT) {
node.setConditionSolution(solutionConditionC.getCondition());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == dialogBoxController) {
if (DialogBoxUIFactory.isOkEvent(event)) {
// ok: open task folder
String relPath = TACourseNode.getTaskFolderPathRelToFolderRoot(course, node);
OlatRootFolderImpl rootFolder = new OlatRootFolderImpl(relPath, null);
OlatNamedContainerImpl namedFolder = new OlatNamedContainerImpl(translate("taskfolder"), rootFolder);
namedFolder.setLocalSecurityCallback(getTaskFolderSecCallback(relPath));
frc = new FolderRunController(namedFolder, false, urequest, getWindowControl());
listenTo(frc);
CloseableModalController cmc = new CloseableModalController(getWindowControl(), translate("folder.close"), frc.getInitialComponent());
cmc.activate();
fireEvent(urequest, Event.CHANGED_EVENT);
}
} else if (source == taskController) {
if (event == Event.CANCELLED_EVENT) {
return;
} else if (event == Event.DONE_EVENT) {
config.set(TACourseNode.CONF_TASK_TYPE, taskController.getTaskType());
config.set(TACourseNode.CONF_TASK_TEXT, taskController.getOptionalText());
config.set(TACourseNode.CONF_TASK_SAMPLING_WITH_REPLACEMENT, new Boolean(taskController.getIsSamplingWithReplacement()));
config.setBooleanEntry(TACourseNode.CONF_TASK_PREVIEW, taskController.isTaskPreviewMode());
config.setBooleanEntry(TACourseNode.CONF_TASK_DESELECT, taskController.isTaskDeselectMode());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
return;
}
} else if (source == scoringController) {
if (event == Event.CANCELLED_EVENT) {
if (hasLogEntries) {
scoringController.setDisplayOnly(true);
}
editScoring.contextPut("isOverwriting", new Boolean(false));
return;
} else if (event == Event.DONE_EVENT) {
scoringController.updateModuleConfiguration(config);
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
}
} else if (source == dropboxForm) {
if (event == Event.CANCELLED_EVENT) {
return;
} else if (event == Event.DONE_EVENT) {
config.set(TACourseNode.CONF_DROPBOX_ENABLEMAIL, new Boolean(dropboxForm.mailEnabled()));
config.set(TACourseNode.CONF_DROPBOX_CONFIRMATION, dropboxForm.getConfirmation());
fireEvent(urequest, NodeEditController.NODECONFIG_CHANGED_EVENT);
return;
}
} else if (source == frc && (event instanceof FolderEvent) && event.getCommand().equals(FolderEvent.DELETE_EVENT)) {
String deletedTaskFile = getFileListAsComaSeparated(((FolderEvent) event).getFilename());
// cancel task assignment
identitiesToBeNotified = removeAssignedTask(course, deletedTaskFile);
if (identitiesToBeNotified.size() > 0) {
// prepare mailTemplate if they are any identities to be notified
removeAsListenerAndDispose(mailCtr);
RepositoryEntry repositoryEntry = RepositoryManager.getInstance().lookupRepositoryEntry(course, true);
String courseURL = Settings.getServerContextPathURI() + "/url/RepositoryEntry/" + repositoryEntry.getKey();
MailTemplate mailTemplate = this.createTaskDeletedMailTemplate(urequest, course.getCourseTitle(), courseURL, deletedTaskFile);
mailCtr = new MailNotificationEditController(getWindowControl(), urequest, mailTemplate, true, false, true);
listenTo(mailCtr);
cmc = new CloseableModalController(getWindowControl(), translate("close"), mailCtr.getInitialComponent());
listenTo(cmc);
cmc.activate();
}
} else if (source == mailCtr) {
if (event == Event.DONE_EVENT) {
cmc.deactivate();
if (identitiesToBeNotified != null && identitiesToBeNotified.size() > 0) {
// sent email to all identities that used to have the deleted task assigned
sendNotificationEmail(urequest, mailCtr.getMailTemplate(), identitiesToBeNotified);
}
} else if (event == Event.CANCELLED_EVENT) {
cmc.deactivate();
}
} else {
log.warn("Can not handle event in TACourseNodeEditController source=" + source + " " + event.toString());
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class ReturnboxFullAccessCallback method event.
/**
* @see org.olat.core.gui.control.DefaultController#event(org.olat.core.gui.UserRequest, org.olat.core.gui.components.Component, org.olat.core.gui.control.Event)
*/
@Override
public void event(UserRequest ureq, Component source, Event event) {
if (source == taskLaunchButton) {
File fTaskfolder = new File(FolderConfig.getCanonicalRoot() + TACourseNode.getTaskFolderPathRelToFolderRoot(userCourseEnv.getCourseEnvironment(), node));
if (assignedTask.toLowerCase().endsWith(".html") || assignedTask.toLowerCase().endsWith(".htm") || assignedTask.toLowerCase().endsWith(".txt")) {
// render content for other users always in iframe
removeAsListenerAndDispose(iFrameCtr);
iFrameCtr = new IFrameDisplayController(ureq, getWindowControl(), fTaskfolder);
listenTo(iFrameCtr);
iFrameCtr.setCurrentURI(assignedTask);
removeAsListenerAndDispose(cmc);
cmc = new CloseableModalController(getWindowControl(), translate("close"), iFrameCtr.getInitialComponent());
listenTo(cmc);
cmc.activate();
} else {
ureq.getDispatchResult().setResultingMediaResource(new FileMediaResource(new File(fTaskfolder, assignedTask)));
}
} else if (source == cancelTaskButton) {
// confirm cancel task assignment
dialogBoxController = this.activateYesNoDialog(ureq, "", translate("task.cancel.reassign"), dialogBoxController);
}
}
Aggregations