Search in sources :

Example 36 with QPoolEvent

use of org.olat.modules.qpool.ui.events.QPoolEvent in project openolat by klemens.

the class QuestionItemDetailsController method doShareItemsWithGroup.

private void doShareItemsWithGroup(UserRequest ureq, QuestionItemShort item, List<BusinessGroup> groups) {
    qpoolService.shareItemsWithGroups(Collections.singletonList(item), groups, false);
    fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_SHARED));
}
Also used : QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent)

Example 37 with QPoolEvent

use of org.olat.modules.qpool.ui.events.QPoolEvent in project openolat by klemens.

the class QuestionItemDetailsController method doChangeQuestionStatus.

private void doChangeQuestionStatus(UserRequest ureq, QuestionItem item, QuestionStatus newStatus) {
    if (!newStatus.equals(item.getQuestionStatus()) && item instanceof QuestionItemImpl) {
        QuestionItemImpl itemImpl = (QuestionItemImpl) item;
        QuestionItemAuditLogBuilder builder = qpoolService.createAuditLogBuilder(getIdentity(), Action.STATUS_CHANGED);
        builder.withBefore(itemImpl);
        builder.withMessage("New status: " + newStatus);
        itemImpl.setQuestionStatus(newStatus);
        qpoolService.updateItem(itemImpl);
        builder.withAfter(item);
        qpoolService.persist(builder.create());
        fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_STATUS_CHANGED, item.getKey()));
    }
    reloadData(ureq);
}
Also used : QuestionItemAuditLogBuilder(org.olat.modules.qpool.QuestionItemAuditLogBuilder) QuestionItemImpl(org.olat.modules.qpool.model.QuestionItemImpl) QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent)

Example 38 with QPoolEvent

use of org.olat.modules.qpool.ui.events.QPoolEvent in project openolat by klemens.

the class QuestionItemDetailsController method doRate.

private void doRate(UserRequest ureq, float rating, String comment) {
    QuestionItem item = metadatasCtrl.getItem();
    qpoolService.rateItemInReview(item, getIdentity(), rating, comment);
    reloadData(ureq);
    setCommentsController(ureq);
    fireEvent(ureq, new QPoolEvent(QPoolEvent.ITEM_STATUS_CHANGED, item.getKey()));
}
Also used : QPoolEvent(org.olat.modules.qpool.ui.events.QPoolEvent) QuestionItem(org.olat.modules.qpool.QuestionItem)

Aggregations

QPoolEvent (org.olat.modules.qpool.ui.events.QPoolEvent)38 QuestionItem (org.olat.modules.qpool.QuestionItem)6 QuestionItemAuditLogBuilder (org.olat.modules.qpool.QuestionItemAuditLogBuilder)6 QuestionItemShort (org.olat.modules.qpool.QuestionItemShort)6 List (java.util.List)4 QuestionItemImpl (org.olat.modules.qpool.model.QuestionItemImpl)4 QItemsProcessedEvent (org.olat.modules.qpool.ui.events.QItemsProcessedEvent)4 ArrayList (java.util.ArrayList)2 IdentitiesAddEvent (org.olat.admin.securitygroup.gui.IdentitiesAddEvent)2 IdentitiesRemoveEvent (org.olat.admin.securitygroup.gui.IdentitiesRemoveEvent)2 PopEvent (org.olat.core.gui.components.stack.PopEvent)2 Controller (org.olat.core.gui.control.Controller)2 CloseableCalloutWindowController (org.olat.core.gui.control.generic.closablewrapper.CloseableCalloutWindowController)2 CloseableModalController (org.olat.core.gui.control.generic.closablewrapper.CloseableModalController)2 DialogBoxController (org.olat.core.gui.control.generic.modal.DialogBoxController)2 StepsMainRunController (org.olat.core.gui.control.generic.wizard.StepsMainRunController)2 StepsRunContext (org.olat.core.gui.control.generic.wizard.StepsRunContext)2 Identity (org.olat.core.id.Identity)2 BusinessGroup (org.olat.group.BusinessGroup)2 BusinessGroupSelectionEvent (org.olat.group.model.BusinessGroupSelectionEvent)2