use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class QuestionPoolAdminConfigurationController method doConfirmEnabled.
private void doConfirmEnabled(UserRequest ureq, boolean enable) {
if (!enable)
return;
reviewProcessActivationCtrl = new ReviewProcessActivationController(ureq, getWindowControl());
listenTo(reviewProcessActivationCtrl);
closeableModalCtrl = new CloseableModalController(getWindowControl(), null, reviewProcessActivationCtrl.getInitialComponent(), true, translate("review.process.confirm.enable.title"), false);
listenTo(closeableModalCtrl);
closeableModalCtrl.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class AuthorListController method doAddOwners.
private void doAddOwners(UserRequest ureq, List<AuthoringEntryRow> rows) {
if (userSearchCtr != null)
return;
Roles roles = ureq.getUserSession().getRoles();
List<AuthoringEntryRow> manageableRows = new ArrayList<>(rows.size());
for (AuthoringEntryRow row : rows) {
boolean managed = RepositoryEntryManagedFlag.isManaged(row.getManagedFlags(), RepositoryEntryManagedFlag.membersmanagement);
boolean canAddOwner = roles.isOLATAdmin() || repositoryService.hasRole(ureq.getIdentity(), row, GroupRoles.owner.name()) || repositoryManager.isInstitutionalRessourceManagerFor(getIdentity(), roles, row);
if (canAddOwner && !managed) {
manageableRows.add(row);
}
}
if (manageableRows.isEmpty()) {
showWarning("bulk.update.nothing.applicable.selected");
} else {
removeAsListenerAndDispose(userSearchCtr);
userSearchCtr = new UserSearchController(ureq, getWindowControl(), false, true, UserSearchController.ACTION_KEY_CHOOSE_FINISH);
userSearchCtr.setUserObject(manageableRows);
listenTo(userSearchCtr);
String title = translate("tools.add.owners");
cmc = new CloseableModalController(getWindowControl(), translate("close"), userSearchCtr.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class AuthorListController method doDelete.
private void doDelete(UserRequest ureq, List<AuthoringEntryRow> rows) {
Roles roles = ureq.getUserSession().getRoles();
List<Long> deleteableRowKeys = new ArrayList<>(rows.size());
for (AuthoringEntryRow row : rows) {
boolean managed = RepositoryEntryManagedFlag.isManaged(row.getManagedFlags(), RepositoryEntryManagedFlag.delete);
boolean canDelete = roles.isOLATAdmin() || repositoryService.hasRole(ureq.getIdentity(), row, GroupRoles.owner.name()) || repositoryManager.isInstitutionalRessourceManagerFor(getIdentity(), roles, row);
if (canDelete && !managed) {
deleteableRowKeys.add(row.getKey());
}
}
List<RepositoryEntry> entriesToDelete = repositoryManager.lookupRepositoryEntries(deleteableRowKeys);
if (entriesToDelete.isEmpty()) {
showWarning("bulk.update.nothing.applicable.selected");
} else {
removeAsListenerAndDispose(confirmDeleteCtrl);
removeAsListenerAndDispose(cmc);
confirmDeleteCtrl = new ConfirmDeleteSoftlyController(ureq, getWindowControl(), entriesToDelete, rows.size() != entriesToDelete.size());
listenTo(confirmDeleteCtrl);
String title = translate("details.delete");
cmc = new CloseableModalController(getWindowControl(), translate("close"), confirmDeleteCtrl.getInitialComponent(), true, title);
listenTo(cmc);
cmc.activate();
}
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class AuthorListController method doCreate.
private void doCreate(UserRequest ureq, RepositoryHandler handler) {
if (createCtrl != null)
return;
removeAsListenerAndDispose(createCtrl);
createCtrl = handler.createCreateRepositoryEntryController(ureq, getWindowControl());
listenTo(createCtrl);
removeAsListenerAndDispose(cmc);
String title = translate(handler.getCreateLabelI18nKey());
cmc = new CloseableModalController(getWindowControl(), translate("close"), createCtrl.getInitialComponent(), true, title);
cmc.setCustomWindowCSS("o_sel_author_create_popup");
listenTo(cmc);
cmc.activate();
}
use of org.olat.core.gui.control.generic.closablewrapper.CloseableModalController in project OpenOLAT by OpenOLAT.
the class CatalogNodeManagerController method doMoveCategory.
private void doMoveCategory(UserRequest ureq) {
removeAsListenerAndDispose(cmc);
removeAsListenerAndDispose(categoryMoveCtrl);
catModificationLock = CoordinatorManager.getInstance().getCoordinator().getLocker().acquireLock(lockRes, getIdentity(), LOCK_TOKEN);
if (catModificationLock.isSuccess()) {
categoryMoveCtrl = new CatalogEntryMoveController(getWindowControl(), ureq, catalogEntry, getTranslator());
listenTo(categoryMoveCtrl);
cmc = new CloseableModalController(getWindowControl(), "close", categoryMoveCtrl.getInitialComponent(), true, translate("tools.move.catalog.entry"));
listenTo(cmc);
cmc.activate();
} else {
String ownerName = userManager.getUserDisplayName(catModificationLock.getOwner());
showError("catalog.locked.by", ownerName);
}
}
Aggregations