Skip to content
Snippets Groups Projects
Commit e88200c9 authored by uhensler's avatar uhensler
Browse files

OO-2834: Remove the cancel button from the edit quota dialog

parent fc297fdd
No related branches found
No related tags found
No related merge requests found
Showing
with 54 additions and 64 deletions
...@@ -43,7 +43,6 @@ import org.olat.core.util.vfs.QuotaManager; ...@@ -43,7 +43,6 @@ import org.olat.core.util.vfs.QuotaManager;
* Description:<BR> * Description:<BR>
* Generic editor controller for quotas. Can be constructed from a quota or a * Generic editor controller for quotas. Can be constructed from a quota or a
* folder path. When finished the controller fires the following events:<BR> * folder path. When finished the controller fires the following events:<BR>
* Event.CANCELLED_EVENT
* Event.CHANGED_EVENT * Event.CHANGED_EVENT
* <p> * <p>
* Check with QuotaManager.hasQuotaEditRights if you are allowed to use this * Check with QuotaManager.hasQuotaEditRights if you are allowed to use this
...@@ -57,11 +56,9 @@ public class GenericQuotaEditController extends BasicController { ...@@ -57,11 +56,9 @@ public class GenericQuotaEditController extends BasicController {
private VelocityContainer myContent; private VelocityContainer myContent;
private QuotaForm quotaForm; private QuotaForm quotaForm;
private boolean modalMode;
private Quota currentQuota; private Quota currentQuota;
private Link delQuotaButton; private Link delQuotaButton;
private Link cancelButton;
/** /**
...@@ -73,12 +70,9 @@ public class GenericQuotaEditController extends BasicController { ...@@ -73,12 +70,9 @@ public class GenericQuotaEditController extends BasicController {
* @param ureq * @param ureq
* @param wControl * @param wControl
* @param quotaPath The path for which the quota should be edited * @param quotaPath The path for which the quota should be edited
* @param modalMode true: window will push to fullscreen and pop itself when finished. false: normal
* controller mode, get initial component using getInitialComponent()
*/ */
GenericQuotaEditController(UserRequest ureq, WindowControl wControl, String relPath, boolean modalMode) { GenericQuotaEditController(UserRequest ureq, WindowControl wControl, String relPath) {
super(ureq, wControl); super(ureq, wControl);
this.modalMode = modalMode;
// check if quota foqf.cannot.del.defaultr this path already exists // check if quota foqf.cannot.del.defaultr this path already exists
QuotaManager qm = QuotaManager.getInstance(); QuotaManager qm = QuotaManager.getInstance();
...@@ -103,7 +97,6 @@ public class GenericQuotaEditController extends BasicController { ...@@ -103,7 +97,6 @@ public class GenericQuotaEditController extends BasicController {
*/ */
public GenericQuotaEditController(UserRequest ureq, WindowControl wControl, Quota quota) { public GenericQuotaEditController(UserRequest ureq, WindowControl wControl, Quota quota) {
super(ureq, wControl); super(ureq, wControl);
this.modalMode = false;
initMyContent(ureq); initMyContent(ureq);
...@@ -119,6 +112,26 @@ public class GenericQuotaEditController extends BasicController { ...@@ -119,6 +112,26 @@ public class GenericQuotaEditController extends BasicController {
putInitialPanel(myContent); putInitialPanel(myContent);
} }
/**
* Constructor for the generic quota edit controller used when a new
* existing quota should be edited.
*
* @param ureq
* @param wControl
*/
public GenericQuotaEditController(UserRequest ureq, WindowControl wControl) {
super(ureq, wControl);
initMyContent(ureq);
// start with new quota
currentQuota = QuotaManager.getInstance().createQuota(null, null, null);
myContent.contextPut("isEmptyQuota", true);
initQuotaForm(ureq, currentQuota);
putInitialPanel(myContent);
}
private void initMyContent(UserRequest ureq) { private void initMyContent(UserRequest ureq) {
QuotaManager qm = QuotaManager.getInstance(); QuotaManager qm = QuotaManager.getInstance();
if (!qm.hasQuotaEditRights(ureq.getIdentity())) { if (!qm.hasQuotaEditRights(ureq.getIdentity())) {
...@@ -126,10 +139,8 @@ public class GenericQuotaEditController extends BasicController { ...@@ -126,10 +139,8 @@ public class GenericQuotaEditController extends BasicController {
} }
myContent = createVelocityContainer("edit"); myContent = createVelocityContainer("edit");
myContent.contextPut("modalMode", Boolean.valueOf(modalMode));
LinkFactory.createButtonSmall("qf.new", myContent, this); LinkFactory.createButtonSmall("qf.new", myContent, this);
delQuotaButton = LinkFactory.createButtonSmall("qf.del", myContent, this); delQuotaButton = LinkFactory.createButtonSmall("qf.del", myContent, this);
cancelButton = LinkFactory.createButtonSmall("cancel", myContent, this);
myContent.contextPut("users",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_USERS)); myContent.contextPut("users",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_USERS));
myContent.contextPut("powerusers",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER)); myContent.contextPut("powerusers",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER));
...@@ -151,9 +162,7 @@ public class GenericQuotaEditController extends BasicController { ...@@ -151,9 +162,7 @@ public class GenericQuotaEditController extends BasicController {
myContent.contextPut("editQuota", Boolean.TRUE); myContent.contextPut("editQuota", Boolean.TRUE);
} }
/** @Override
* @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)
*/
public void event(UserRequest ureq, Component source, Event event) { public void event(UserRequest ureq, Component source, Event event) {
initQuotaForm(ureq, currentQuota); initQuotaForm(ureq, currentQuota);
if (source == delQuotaButton){ if (source == delQuotaButton){
...@@ -166,14 +175,10 @@ public class GenericQuotaEditController extends BasicController { ...@@ -166,14 +175,10 @@ public class GenericQuotaEditController extends BasicController {
} else { } else {
showError("qf.cannot.del.default"); showError("qf.cannot.del.default");
} }
} else if(source == cancelButton){
fireEvent(ureq, Event.CANCELLED_EVENT);
} }
} }
/** @Override
* @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)
*/
public void event(UserRequest ureq, Controller source, Event event) { public void event(UserRequest ureq, Controller source, Event event) {
if (source == quotaForm) { if (source == quotaForm) {
if (event == Event.DONE_EVENT) { if (event == Event.DONE_EVENT) {
...@@ -184,17 +189,13 @@ public class GenericQuotaEditController extends BasicController { ...@@ -184,17 +189,13 @@ public class GenericQuotaEditController extends BasicController {
} }
} }
} }
/**
* @return Quota the edited quota
*/
public Quota getQuota() { public Quota getQuota() {
if (currentQuota == null) throw new AssertException("getQuota called but currentQuota is null"); if (currentQuota == null) throw new AssertException("getQuota called but currentQuota is null");
return currentQuota; return currentQuota;
} }
/** @Override
* @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
*/
protected void doDispose() { protected void doDispose() {
// //
} }
......
...@@ -44,7 +44,6 @@ public class GenericQuotaViewController extends BasicController { ...@@ -44,7 +44,6 @@ public class GenericQuotaViewController extends BasicController {
private VelocityContainer myContent; private VelocityContainer myContent;
private QuotaForm quotaForm; private QuotaForm quotaForm;
private boolean modalMode;
private Quota currentQuota; private Quota currentQuota;
...@@ -57,12 +56,9 @@ public class GenericQuotaViewController extends BasicController { ...@@ -57,12 +56,9 @@ public class GenericQuotaViewController extends BasicController {
* @param ureq * @param ureq
* @param wControl * @param wControl
* @param quotaPath The path for which the quota should be edited * @param quotaPath The path for which the quota should be edited
* @param modalMode true: window will push to fullscreen and pop itself when finished. false: normal
* controller mode, get initial component using getInitialComponent()
*/ */
GenericQuotaViewController(UserRequest ureq, WindowControl wControl, String relPath, boolean modalMode) { GenericQuotaViewController(UserRequest ureq, WindowControl wControl, String relPath) {
super(ureq, wControl); super(ureq, wControl);
this.modalMode = modalMode;
// check if quota foqf.cannot.del.defaultr this path already exists // check if quota foqf.cannot.del.defaultr this path already exists
QuotaManager qm = QuotaManager.getInstance(); QuotaManager qm = QuotaManager.getInstance();
...@@ -86,7 +82,6 @@ public class GenericQuotaViewController extends BasicController { ...@@ -86,7 +82,6 @@ public class GenericQuotaViewController extends BasicController {
QuotaManager qm = QuotaManager.getInstance(); QuotaManager qm = QuotaManager.getInstance();
myContent = createVelocityContainer("edit"); myContent = createVelocityContainer("edit");
myContent.contextPut("notEnoughPrivilege", Boolean.FALSE); myContent.contextPut("notEnoughPrivilege", Boolean.FALSE);
myContent.contextPut("modalMode", Boolean.valueOf(modalMode));
myContent.contextPut("users",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_USERS)); myContent.contextPut("users",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_USERS));
myContent.contextPut("powerusers",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER)); myContent.contextPut("powerusers",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_POWER));
myContent.contextPut("groups",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS)); myContent.contextPut("groups",qm.getDefaultQuota(QuotaConstants.IDENTIFIER_DEFAULT_GROUPS));
......
...@@ -99,24 +99,20 @@ public class QuotaController extends BasicController { ...@@ -99,24 +99,20 @@ public class QuotaController extends BasicController {
putInitialPanel(main); putInitialPanel(main);
} }
/** @Override
* @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)
*/
public void event(UserRequest ureq, Component source, Event event) { public void event(UserRequest ureq, Component source, Event event) {
if(source == addQuotaButton){ if(source == addQuotaButton){
// clean up old controller first // clean up old controller first
if (quotaEditCtr != null) removeAsListenerAndDispose(quotaEditCtr); if (quotaEditCtr != null) removeAsListenerAndDispose(quotaEditCtr);
// start edit workflow in dedicated quota edit controller // start edit workflow in dedicated quota edit controller
removeAsListenerAndDispose(quotaEditCtr); removeAsListenerAndDispose(quotaEditCtr);
quotaEditCtr = new GenericQuotaEditController(ureq, getWindowControl(), null); quotaEditCtr = new GenericQuotaEditController(ureq, getWindowControl());
listenTo(quotaEditCtr); listenTo(quotaEditCtr);
main.setContent(quotaEditCtr.getInitialComponent()); main.setContent(quotaEditCtr.getInitialComponent());
} }
} }
/** @Override
* @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)
*/
public void event(UserRequest ureq, Controller source, Event event) { public void event(UserRequest ureq, Controller source, Event event) {
if (source == quotaEditCtr) { if (source == quotaEditCtr) {
if (event == Event.CHANGED_EVENT) { if (event == Event.CHANGED_EVENT) {
...@@ -146,17 +142,14 @@ public class QuotaController extends BasicController { ...@@ -146,17 +142,14 @@ public class QuotaController extends BasicController {
tableCtr.setTableDataModel(quotaTableModel); tableCtr.setTableDataModel(quotaTableModel);
showInfo("qf.deleted", q.getPath()); showInfo("qf.deleted", q.getPath());
} else { } else {
// default quotas can not be qf.cannot.del.default")deleted // default quotas can not be deleted
showError("qf.cannot.del.default"); showError("qf.cannot.del.default");
} }
} }
} }
} }
/** @Override
*
* @see org.olat.core.gui.control.DefaultController#doDispose(boolean)
*/
protected void doDispose() { protected void doDispose() {
// //
} }
......
...@@ -86,6 +86,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -86,6 +86,7 @@ public class QuotaManagerImpl extends QuotaManager {
/** /**
* @see org.olat.core.util.vfs.QuotaManager#createQuota(java.lang.String, java.lang.Long, java.lang.Long) * @see org.olat.core.util.vfs.QuotaManager#createQuota(java.lang.String, java.lang.Long, java.lang.Long)
*/ */
@Override
public Quota createQuota(String path, Long quotaKB, Long ulLimitKB) { public Quota createQuota(String path, Long quotaKB, Long ulLimitKB) {
return new QuotaImpl(path, quotaKB, ulLimitKB); return new QuotaImpl(path, quotaKB, ulLimitKB);
} }
...@@ -94,6 +95,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -94,6 +95,7 @@ public class QuotaManagerImpl extends QuotaManager {
* [called by spring] * [called by spring]
* *
*/ */
@Override
public void init() { public void init() {
quotaResource = resourceManager.findOrPersistResourceable(OresHelper.lookupType(Quota.class)); quotaResource = resourceManager.findOrPersistResourceable(OresHelper.lookupType(Quota.class));
initDefaultQuotas(); // initialize default quotas initDefaultQuotas(); // initialize default quotas
...@@ -155,6 +157,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -155,6 +157,7 @@ public class QuotaManagerImpl extends QuotaManager {
* @param identifyer * @param identifyer
* @return * @return
*/ */
@Override
public Quota getDefaultQuota(String identifyer) { public Quota getDefaultQuota(String identifyer) {
if (defaultQuotas == null) { if (defaultQuotas == null) {
throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null); throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null);
...@@ -169,6 +172,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -169,6 +172,7 @@ public class QuotaManagerImpl extends QuotaManager {
* @param path * @param path
* @return Quota object. * @return Quota object.
*/ */
@Override
public Quota getCustomQuota(String path) { public Quota getCustomQuota(String path) {
if (defaultQuotas == null) { if (defaultQuotas == null) {
throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null); throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null);
...@@ -200,6 +204,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -200,6 +204,7 @@ public class QuotaManagerImpl extends QuotaManager {
* *
* @param quota * @param quota
*/ */
@Override
public void setCustomQuotaKB(Quota quota) { public void setCustomQuotaKB(Quota quota) {
if (defaultQuotas == null) { if (defaultQuotas == null) {
throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null); throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null);
...@@ -224,6 +229,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -224,6 +229,7 @@ public class QuotaManagerImpl extends QuotaManager {
* @return true if quota successfully deleted or no such quota, false if quota * @return true if quota successfully deleted or no such quota, false if quota
* not deleted because it was a default quota that can not be deleted * not deleted because it was a default quota that can not be deleted
*/ */
@Override
public boolean deleteCustomQuota(Quota quota) { public boolean deleteCustomQuota(Quota quota) {
if (defaultQuotas == null) { if (defaultQuotas == null) {
throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null); throw new OLATRuntimeException(QuotaManagerImpl.class, "Quota manager has not been initialized properly! Must call init() first.", null);
...@@ -299,6 +305,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -299,6 +305,7 @@ public class QuotaManagerImpl extends QuotaManager {
* @param identity * @param identity
* @return * @return
*/ */
@Override
public Quota getDefaultQuotaDependingOnRole(Identity identity) { public Quota getDefaultQuotaDependingOnRole(Identity identity) {
if (BaseSecurityManager.getInstance().isIdentityPermittedOnResourceable(identity, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR)) { return getDefaultQuotaPowerUsers(); } if (BaseSecurityManager.getInstance().isIdentityPermittedOnResourceable(identity, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_AUTHOR)) { return getDefaultQuotaPowerUsers(); }
if (BaseSecurityManager.getInstance().isIdentityPermittedOnResourceable(identity, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_ADMIN)) { return getDefaultQuotaPowerUsers(); } if (BaseSecurityManager.getInstance().isIdentityPermittedOnResourceable(identity, Constants.PERMISSION_HASROLE, Constants.ORESOURCE_ADMIN)) { return getDefaultQuotaPowerUsers(); }
...@@ -312,6 +319,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -312,6 +319,7 @@ public class QuotaManagerImpl extends QuotaManager {
* @param identity * @param identity
* @return custom quota or quota depending on role * @return custom quota or quota depending on role
*/ */
@Override
public Quota getCustomQuotaOrDefaultDependingOnRole(Identity identity, String relPath) { public Quota getCustomQuotaOrDefaultDependingOnRole(Identity identity, String relPath) {
Quota quota = getCustomQuota(relPath); Quota quota = getCustomQuota(relPath);
if (quota == null) { // no custom quota if (quota == null) { // no custom quota
...@@ -361,6 +369,7 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -361,6 +369,7 @@ public class QuotaManagerImpl extends QuotaManager {
* @param currentContainer2 Upload container (folder) * @param currentContainer2 Upload container (folder)
* @return Upload limit on KB * @return Upload limit on KB
*/ */
@Override
public int getUploadLimitKB(long quotaKB2, long uploadLimitKB2, VFSContainer currentContainer2) { public int getUploadLimitKB(long quotaKB2, long uploadLimitKB2, VFSContainer currentContainer2) {
if (quotaKB2 == Quota.UNLIMITED) { if (quotaKB2 == Quota.UNLIMITED) {
if (uploadLimitKB2 == Quota.UNLIMITED) { if (uploadLimitKB2 == Quota.UNLIMITED) {
...@@ -401,16 +410,13 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -401,16 +410,13 @@ public class QuotaManagerImpl extends QuotaManager {
return true; return true;
} }
/**
* @see org.olat.core.util.vfs.QuotaManager#getQuotaEditorInstance(org.olat.core.gui.UserRequest, org.olat.core.gui.control.WindowControl, java.lang.String, boolean)
*/
@Override @Override
public Controller getQuotaEditorInstance(UserRequest ureq, WindowControl wControl, String relPath, boolean modalMode) { public Controller getQuotaEditorInstance(UserRequest ureq, WindowControl wControl, String relPath) {
try { try {
return new GenericQuotaEditController(ureq, wControl, relPath, modalMode); return new GenericQuotaEditController(ureq, wControl, relPath);
} catch (OLATSecurityException e) { } catch (OLATSecurityException e) {
log.warn("Try to access the quota editor without enough privilege", e); log.warn("Try to access the quota editor without enough privilege", e);
GenericQuotaViewController viewCtrl = new GenericQuotaViewController(ureq, wControl, relPath, modalMode); GenericQuotaViewController viewCtrl = new GenericQuotaViewController(ureq, wControl, relPath);
viewCtrl.setNotEnoughPrivilegeMessage(); viewCtrl.setNotEnoughPrivilegeMessage();
return viewCtrl; return viewCtrl;
} }
...@@ -418,8 +424,8 @@ public class QuotaManagerImpl extends QuotaManager { ...@@ -418,8 +424,8 @@ public class QuotaManagerImpl extends QuotaManager {
@Override @Override
public Controller getQuotaViewInstance(UserRequest ureq, WindowControl wControl, String relPath, boolean modalMode) { public Controller getQuotaViewInstance(UserRequest ureq, WindowControl wControl, String relPath) {
return new GenericQuotaViewController(ureq, wControl, relPath, modalMode); return new GenericQuotaViewController(ureq, wControl, relPath);
} }
@Override @Override
......
...@@ -19,10 +19,6 @@ ...@@ -19,10 +19,6 @@
<div class="o_button_group o_button_group_right">$r.render("qf.new")</div> <div class="o_button_group o_button_group_right">$r.render("qf.new")</div>
#end #end
<div class="o_info">$r.translate("qf.noquota")</div> <div class="o_info">$r.translate("qf.noquota")</div>
#if ($modalMode)
&nbsp;
$r.render("cancel")
#end
</fieldset> </fieldset>
#end #end
<div class="panel panel-default"> <div class="panel panel-default">
......
...@@ -410,7 +410,7 @@ public class UserAdminController extends BasicController implements Activateable ...@@ -410,7 +410,7 @@ public class UserAdminController extends BasicController implements Activateable
@Override @Override
public Component create(UserRequest uureq) { public Component create(UserRequest uureq) {
String relPath = FolderConfig.getUserHomes() + "/" + identity.getName(); String relPath = FolderConfig.getUserHomes() + "/" + identity.getName();
quotaCtr = QuotaManager.getInstance().getQuotaEditorInstance(uureq, getWindowControl(), relPath, false); quotaCtr = QuotaManager.getInstance().getQuotaEditorInstance(uureq, getWindowControl(), relPath);
return quotaCtr.getInitialComponent(); return quotaCtr.getInitialComponent();
} }
}); });
......
...@@ -104,9 +104,9 @@ public class CollaborationToolsSettingsController extends BasicController { ...@@ -104,9 +104,9 @@ public class CollaborationToolsSettingsController extends BasicController {
if (ureq.getUserSession().getRoles().isOLATAdmin()) { if (ureq.getUserSession().getRoles().isOLATAdmin()) {
vc_collabtools.contextPut("isOlatAdmin", Boolean.TRUE); vc_collabtools.contextPut("isOlatAdmin", Boolean.TRUE);
if(managed) { if(managed) {
quotaCtr = QuotaManager.getInstance().getQuotaViewInstance(ureq, getWindowControl(), collabTools.getFolderRelPath(), false); quotaCtr = QuotaManager.getInstance().getQuotaViewInstance(ureq, getWindowControl(), collabTools.getFolderRelPath());
} else { } else {
quotaCtr = QuotaManager.getInstance().getQuotaEditorInstance(ureq, getWindowControl(), collabTools.getFolderRelPath(), false); quotaCtr = QuotaManager.getInstance().getQuotaEditorInstance(ureq, getWindowControl(), collabTools.getFolderRelPath());
} }
listenTo(quotaCtr); listenTo(quotaCtr);
} else { } else {
......
...@@ -63,7 +63,8 @@ public class CmdEditQuota extends DefaultController implements FolderCommand, Co ...@@ -63,7 +63,8 @@ public class CmdEditQuota extends DefaultController implements FolderCommand, Co
// cleanup old controller first // cleanup old controller first
if (quotaEditController != null) quotaEditController.dispose(); if (quotaEditController != null) quotaEditController.dispose();
// create a edit controller // create a edit controller
quotaEditController = QuotaManager.getInstance().getQuotaEditorInstance(ureq, wControl, currentSecCallback.getQuota().getPath(), true); quotaEditController.addControllerListener(this); quotaEditController = QuotaManager.getInstance().getQuotaEditorInstance(ureq, wControl, currentSecCallback.getQuota().getPath());
quotaEditController.addControllerListener(this);
if (quotaEditController != null) { if (quotaEditController != null) {
setInitialComponent(quotaEditController.getInitialComponent()); setInitialComponent(quotaEditController.getInitialComponent());
return this; return this;
......
...@@ -158,17 +158,15 @@ public abstract class QuotaManager { ...@@ -158,17 +158,15 @@ public abstract class QuotaManager {
* The controller must fire the following events: * The controller must fire the following events:
* <ul> * <ul>
* <li>Event.CANCELLED_EVENT</li> * <li>Event.CANCELLED_EVENT</li>
* <li>Event.CHANGED_EVENT</li>
* </ul> * </ul>
* @param ureq * @param ureq
* @param wControl * @param wControl
* @param relPath * @param relPath
* @param modalMode
* @return * @return
*/ */
public abstract Controller getQuotaEditorInstance(UserRequest ureq, WindowControl wControl, String relPath, boolean modalMode); public abstract Controller getQuotaEditorInstance(UserRequest ureq, WindowControl wControl, String relPath);
public abstract Controller getQuotaViewInstance(UserRequest ureq, WindowControl wControl, String relPath, boolean modalMode); public abstract Controller getQuotaViewInstance(UserRequest ureq, WindowControl wControl, String relPath);
/** /**
* Check if a user has the rights to launch the quota editor tool * Check if a user has the rights to launch the quota editor tool
......
...@@ -129,7 +129,7 @@ public class CPRuntimeController extends RepositoryEntryRuntimeController { ...@@ -129,7 +129,7 @@ public class CPRuntimeController extends RepositoryEntryRuntimeController {
OLATResource resource = entry.getOlatResource(); OLATResource resource = entry.getOlatResource();
OlatRootFolderImpl cpRoot = FileResourceManager.getInstance().unzipContainerResource(resource); OlatRootFolderImpl cpRoot = FileResourceManager.getInstance().unzipContainerResource(resource);
WindowControl bwControl = getSubWindowControl("Quota"); WindowControl bwControl = getSubWindowControl("Quota");
Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), cpRoot.getRelPath(), false); Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), cpRoot.getRelPath());
pushController(ureq, translate("tab.quota.edit"), quotaCtrl); pushController(ureq, translate("tab.quota.edit"), quotaCtrl);
setActiveTool(quotaLink); setActiveTool(quotaLink);
} }
......
...@@ -99,7 +99,7 @@ public class FeedRuntimeController extends RepositoryEntryRuntimeController { ...@@ -99,7 +99,7 @@ public class FeedRuntimeController extends RepositoryEntryRuntimeController {
RepositoryEntry entry = getRepositoryEntry(); RepositoryEntry entry = getRepositoryEntry();
OlatRootFolderImpl feedRoot = FileResourceManager.getInstance().getFileResourceRootImpl(entry.getOlatResource()); OlatRootFolderImpl feedRoot = FileResourceManager.getInstance().getFileResourceRootImpl(entry.getOlatResource());
WindowControl bwControl = getSubWindowControl("Quota"); WindowControl bwControl = getSubWindowControl("Quota");
Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), feedRoot.getRelPath(), false); Controller quotaCtrl = quotaManager.getQuotaEditorInstance(ureq, addToHistory(ureq, bwControl), feedRoot.getRelPath());
pushController(ureq, translate("tab.quota.edit"), quotaCtrl); pushController(ureq, translate("tab.quota.edit"), quotaCtrl);
setActiveTool(quotaLink); setActiveTool(quotaLink);
} }
......
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