Skip to content
Snippets Groups Projects
Commit a1cecbc1 authored by Dirk Furrer's avatar Dirk Furrer
Browse files

OO-1404: added subscriptionContext to the DropboxScoringViewController,...

OO-1404: added subscriptionContext to the DropboxScoringViewController, changed the init function in the ProjectBrokerDropboxScoringViewController
parent f731068d
No related branches found
No related tags found
No related merge requests found
......@@ -68,7 +68,8 @@ public class ProjectBrokerDropboxScoringViewController extends DropboxScoringVie
Translator fallbackTranslator = Util.createPackageTranslator(this.getClass(), ureq.getLocale());
Translator myTranslator = Util.createPackageTranslator(DropboxScoringViewController.class, ureq.getLocale(), fallbackTranslator);
setTranslator(myTranslator);
init(ureq);
boolean hasNotification = ( userCourseEnv.getCourseEnvironment().getCourseGroupManager().isIdentityCourseAdministrator(ureq.getIdentity())) || userCourseEnv.getCourseEnvironment().getCourseGroupManager().isIdentityCourseCoach(ureq.getIdentity());
init(ureq, hasNotification);
}
protected String getDropboxFilePath(String assesseeName) {
......
......@@ -36,6 +36,7 @@ import org.olat.core.commons.modules.bc.FolderRunController;
import org.olat.core.commons.modules.bc.vfs.OlatNamedContainerImpl;
import org.olat.core.commons.modules.bc.vfs.OlatRootFolderImpl;
import org.olat.core.commons.services.notifications.SubscriptionContext;
import org.olat.core.commons.services.notifications.ui.ContextualSubscriptionController;
import org.olat.core.gui.UserRequest;
import org.olat.core.gui.components.Component;
import org.olat.core.gui.components.link.Link;
......@@ -99,6 +100,9 @@ public class DropboxScoringViewController extends BasicController {
private CloseableModalController cmc;
private IFrameDisplayController iFrameCtr;
private DialogBoxController dialogBoxController;
private boolean hasNotification = false;
private SubscriptionContext subsContext;
private ContextualSubscriptionController contextualSubscriptionCtr;
/**
* Scoring view of the dropbox.
......@@ -129,6 +133,11 @@ public class DropboxScoringViewController extends BasicController {
init(ureq);
}
}
protected void init(UserRequest ureq, boolean hasNotification){
this.hasNotification = hasNotification;
init(ureq);
}
protected void init(UserRequest ureq) {
myContent = createVelocityContainer("dropboxscoring");
......@@ -152,6 +161,19 @@ public class DropboxScoringViewController extends BasicController {
UserManager userManager = CoreSpringFactory.getImpl(UserManager.class);
String assesseeFullName = StringHelper.escapeHtml(userManager.getUserDisplayName(assessee));
// notification
if (hasNotification) {
subsContext = DropboxFileUploadNotificationHandler.getSubscriptionContext(userCourseEnv.getCourseEnvironment(), node);
if (subsContext != null) {
String path = DropboxController.getDropboxPathRelToFolderRoot(userCourseEnv.getCourseEnvironment(), node);
contextualSubscriptionCtr = AbstractTaskNotificationHandler.createContextualSubscriptionController(ureq, this.getWindowControl(), path, subsContext, DropboxController.class);
myContent.put("subscription", contextualSubscriptionCtr.getInitialComponent());
myContent.contextPut("hasNotification", Boolean.TRUE);
}
} else {
myContent.contextPut("hasNotification", Boolean.FALSE);
}
OlatRootFolderImpl rootDropbox = new OlatRootFolderImpl(getDropboxFilePath(assesseeName), null);
rootDropbox.setLocalSecurityCallback( getDropboxVfsSecurityCallback());
OlatNamedContainerImpl namedDropbox = new OlatNamedContainerImpl(assesseeFullName, rootDropbox);
......
......@@ -28,6 +28,11 @@
<h4 class="panel-title">$r.translate("dropbox.title")</h4>
</div>
<div id="collapseDropbox" class="panel-collapse collapse in">
<div class="panel-body">
#if($hasNotification == true)
$r.render("subscription")
#end
</div>
<div class="panel-body">
$r.render("dropbox")
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment