private VelocityContainer createTabGroupManagement(UserRequest ureq) {
boolean hasOwners = flags.isEnabled(BGConfigFlags.GROUP_OWNERS);
boolean hasPartips = true;//
boolean hasWaitingList = currBusinessGroup.getWaitingListEnabled().booleanValue();
//
VelocityContainer tmp = createVelocityContainer("tab_bgGrpMngmnt");
// Member Display Form, allows to enable/disable that others partips see
// partips and/or owners
//
BusinessGroupPropertyManager bgpm = new BusinessGroupPropertyManager(currBusinessGroup);
// configure the form with checkboxes for owners and/or partips according
// the booleans
dmsForm = new DisplayMemberSwitchForm("dmsForm", getTranslator(), hasOwners, hasPartips, hasWaitingList);
// set if the checkboxes are checked or not.
if (hasOwners) dmsForm.setShowOwnersChecked(bgpm.showOwners());
if (hasPartips) dmsForm.setShowPartipsChecked(bgpm.showPartips());
if (hasWaitingList) dmsForm.setShowWaitingListChecked(bgpm.showWaitingList());
bgpm = null;
dmsForm.addListener(this);
tmp.put("displayMembers", dmsForm);
boolean enableTablePreferences = flags.isEnabled(BGConfigFlags.ADMIN_SEE_ALL_USER_DATA);
if (hasOwners) {
boolean requiresOwner = flags.isEnabled(BGConfigFlags.GROUP_OWNER_REQURED);
// groupcontroller which allows to remove all members depending on
// configuration.
ownerGrpCntrllr = new GroupController(ureq, getWindowControl(), true, requiresOwner, enableTablePreferences, currBusinessGroup
.getOwnerGroup());
listenTo(ownerGrpCntrllr);
// add mail templates used when adding and removing users
MailTemplate ownerAddUserMailTempl = BGMailHelper.createAddParticipantMailTemplate(currBusinessGroup, ureq.getIdentity());
ownerGrpCntrllr.setAddUserMailTempl(ownerAddUserMailTempl);
MailTemplate ownerAremoveUserMailTempl = BGMailHelper.createRemoveParticipantMailTemplate(currBusinessGroup, ureq.getIdentity());
ownerGrpCntrllr.setRemoveUserMailTempl(ownerAremoveUserMailTempl);
// expose to velocity
tmp.put("ownerGrpMngmnt", ownerGrpCntrllr.getInitialComponent());
tmp.contextPut("hasOwnerGrp", Boolean.TRUE);
} else {
tmp.contextPut("hasOwnerGrp", Boolean.FALSE);
}
// groupcontroller which allows to remove all members
partipGrpCntrllr = new GroupController(ureq, getWindowControl(), true, false, enableTablePreferences, currBusinessGroup
.getPartipiciantGroup());
listenTo(partipGrpCntrllr);
// add mail templates used when adding and removing users
MailTemplate partAddUserMailTempl = BGMailHelper.createAddParticipantMailTemplate(currBusinessGroup, ureq.getIdentity());
partipGrpCntrllr.setAddUserMailTempl(partAddUserMailTempl);
MailTemplate partAremoveUserMailTempl = BGMailHelper.createRemoveParticipantMailTemplate(currBusinessGroup, ureq.getIdentity());
partipGrpCntrllr.setRemoveUserMailTempl(partAremoveUserMailTempl);
// expose to velocity
tmp.put("partipGrpMngmnt", partipGrpCntrllr.getInitialComponent());
tmp.contextPut("type", this.currBusinessGroup.getType());
// Show waiting list only if enabled
if (hasWaitingList) {
// waitinglist-groupcontroller which allows to remove all members
SecurityGroup waitingList = currBusinessGroup.getWaitingGroup();
waitingGruppeController = new WaitingGroupController(ureq, getWindowControl(), true, false, enableTablePreferences, waitingList );
listenTo(waitingGruppeController);
// add mail templates used when adding and removing users
MailTemplate waitAddUserMailTempl = BGMailHelper.createAddWaitinglistMailTemplate(currBusinessGroup, ureq.getIdentity());
waitingGruppeController.setAddUserMailTempl(waitAddUserMailTempl);
MailTemplate waitRemoveUserMailTempl = BGMailHelper.createRemoveWaitinglistMailTemplate(currBusinessGroup, ureq.getIdentity());
waitingGruppeController.setRemoveUserMailTempl(waitRemoveUserMailTempl);
MailTemplate waitTransferUserMailTempl = BGMailHelper.createWaitinglistTransferMailTemplate(currBusinessGroup, ureq.getIdentity());
waitingGruppeController.setTransferUserMailTempl(waitTransferUserMailTempl);
// expose to velocity
tmp.put("waitingGrpMngmnt", waitingGruppeController.getInitialComponent());
tmp.contextPut("hasWaitingGrp", Boolean.TRUE);
} else {
tmp.contextPut("hasWaitingGrp", Boolean.FALSE);
}
return tmp;
}