Search in sources :

Example 86 with CloseableModalController

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();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 87 with CloseableModalController

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();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ArrayList(java.util.ArrayList) Roles(org.olat.core.id.Roles) GroupRoles(org.olat.basesecurity.GroupRoles) UserSearchController(org.olat.admin.user.UserSearchController)

Example 88 with CloseableModalController

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();
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController) ArrayList(java.util.ArrayList) Roles(org.olat.core.id.Roles) GroupRoles(org.olat.basesecurity.GroupRoles) RepositoryEntry(org.olat.repository.RepositoryEntry)

Example 89 with CloseableModalController

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();
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Example 90 with CloseableModalController

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);
    }
}
Also used : CloseableModalController(org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)

Aggregations

CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)789 RepositoryEntry (org.olat.repository.RepositoryEntry)52 ArrayList (java.util.ArrayList)48 Identity (org.olat.core.id.Identity)42 ReferencableEntriesSearchController (org.olat.repository.controllers.ReferencableEntriesSearchController)38 VFSContainer (org.olat.core.util.vfs.VFSContainer)24 Component (org.olat.core.gui.components.Component)20 ContactMessage (org.olat.core.util.mail.ContactMessage)20 ContactFormController (org.olat.modules.co.ContactFormController)20 File (java.io.File)17 List (java.util.List)16 UserSearchController (org.olat.admin.user.UserSearchController)16 TableEvent (org.olat.core.gui.components.table.TableEvent)16 TableMultiSelectEvent (org.olat.core.gui.components.table.TableMultiSelectEvent)16 ContactList (org.olat.core.util.mail.ContactList)16 MailTemplate (org.olat.core.util.mail.MailTemplate)14 OLATResourceable (org.olat.core.id.OLATResourceable)12 MailNotificationEditController (org.olat.core.util.mail.MailNotificationEditController)12 OLATSecurityException (org.olat.core.logging.OLATSecurityException)10 Roles (org.olat.core.id.Roles)8