Search in sources :

Example 16 with QuestionStatus

use of org.olat.modules.qpool.QuestionStatus in project OpenOLAT by OpenOLAT.

the class QuestionListController method doSetSourceStatus.

private void doSetSourceStatus(FormLink link) {
    if (getSource().isStatusFilterEnabled()) {
        QuestionStatus status = (QuestionStatus) link.getUserObject();
        getSource().setStatusFilter(status);
        getItemsTable().reset(true, true, true);
        removeSelectionCssClass(statusDraftLink);
        removeSelectionCssClass(statusReviewLink);
        removeSelectionCssClass(statusRevisedLink);
        removeSelectionCssClass(statusFinalLink);
        removeSelectionCssClass(statusEndOfLifeLink);
        setSelectionCssClass(link);
    }
}
Also used : QuestionStatus(org.olat.modules.qpool.QuestionStatus)

Example 17 with QuestionStatus

use of org.olat.modules.qpool.QuestionStatus in project OpenOLAT by OpenOLAT.

the class QuestionListController method initButtons.

@Override
protected void initButtons(UserRequest ureq, FormItemContainer formLayout) {
    if (getSource().isStatusFilterEnabled()) {
        QuestionStatus statusFilter = getSource().getStatusFilter();
        statusDraftLink = uifactory.addFormLink("source.status.draft", "source.status.draft", null, formLayout, Link.BUTTON);
        statusDraftLink.setUserObject(QuestionStatus.draft);
        statusDraftLink.setElementCssClass("btn-arrow-right o_qpool_qitem_draft");
        statusDraftLink.setIconLeftCSS("o_icon o_icon-lg o_icon_qitem_draft");
        if (QuestionStatus.draft.equals(statusFilter))
            setSelectionCssClass(statusDraftLink);
        statusReviewLink = uifactory.addFormLink("source.status.review", "source.status.review", null, formLayout, Link.BUTTON);
        statusReviewLink.setUserObject(QuestionStatus.review);
        statusReviewLink.setElementCssClass("btn-arrow-right o_qpool_qitem_review");
        statusReviewLink.setIconLeftCSS("o_icon o_icon-lg o_icon_qitem_review");
        if (QuestionStatus.review.equals(statusFilter))
            setSelectionCssClass(statusReviewLink);
        statusRevisedLink = uifactory.addFormLink("source.status.revised", "source.status.revised", null, formLayout, Link.BUTTON);
        statusRevisedLink.setUserObject(QuestionStatus.revised);
        statusRevisedLink.setElementCssClass("btn-arrow-right o_qpool_qitem_revised");
        statusRevisedLink.setIconLeftCSS("o_icon o_icon-lg o_icon_qitem_revised");
        if (QuestionStatus.revised.equals(statusFilter))
            setSelectionCssClass(statusRevisedLink);
        statusFinalLink = uifactory.addFormLink("source.status.finalVersion", "source.status.finalVersion", null, formLayout, Link.BUTTON);
        statusFinalLink.setUserObject(QuestionStatus.finalVersion);
        statusFinalLink.setElementCssClass("btn-arrow-right o_qpool_qitem_final");
        statusFinalLink.setIconLeftCSS("o_icon o_icon-lg o_icon_qitem_finalVersion");
        if (QuestionStatus.finalVersion.equals(statusFilter))
            setSelectionCssClass(statusFinalLink);
        statusEndOfLifeLink = uifactory.addFormLink("source.status.endOfLife", "source.status.endOfLife", null, formLayout, Link.BUTTON);
        statusEndOfLifeLink.setUserObject(QuestionStatus.endOfLife);
        statusEndOfLifeLink.setElementCssClass("btn-arrow-right o_qpool_qitem_end_of_life");
        statusEndOfLifeLink.setIconLeftCSS("o_icon o_icon-lg o_icon_qitem_endOfLife");
        if (QuestionStatus.endOfLife.equals(statusFilter))
            setSelectionCssClass(statusEndOfLifeLink);
        updateStatusFilter();
    }
    if (getSource().isCreateEnabled()) {
        newItem = uifactory.addFormLink("new.item", formLayout, Link.BUTTON);
        newItem.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_new");
    }
    importItem = uifactory.addFormLink("import.item", formLayout, Link.BUTTON);
    importItem.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_import");
    if (getSecurityCallback().canUseCollections()) {
        list = uifactory.addFormLink("list", formLayout, Link.BUTTON);
    }
    if (getSecurityCallback().canCreateTest()) {
        createTest = uifactory.addFormLink("create.test", formLayout, Link.BUTTON);
    }
    exportItem = uifactory.addFormLink("export.item", formLayout, Link.BUTTON);
    if (getSecurityCallback().canUsePools() || getSecurityCallback().canUseGroups()) {
        shareItem = uifactory.addFormLink("share.item", formLayout, Link.BUTTON);
    }
    if (getSource().isRemoveEnabled()) {
        removeItem = uifactory.addFormLink("unshare.item", formLayout, Link.BUTTON);
    }
    if (getSource().isCopyEnabled()) {
        copyItem = uifactory.addFormLink("copy", formLayout, Link.BUTTON);
    }
    if (getSource().isImportEnabled()) {
        convertItem = uifactory.addFormLink("convert.item", formLayout, Link.BUTTON);
    }
    if (getSource().isAuthorRightsEnable()) {
        authorItem = uifactory.addFormLink("author.item", formLayout, Link.BUTTON);
    }
    if (getSource().isDeleteEnabled()) {
        deleteItem = uifactory.addFormLink("delete.item", formLayout, Link.BUTTON);
    }
    if (getSource().isBulkChangeEnabled()) {
        bulkChange = uifactory.addFormLink("bulk.change", formLayout, Link.BUTTON);
    }
}
Also used : QuestionStatus(org.olat.modules.qpool.QuestionStatus)

Example 18 with QuestionStatus

use of org.olat.modules.qpool.QuestionStatus in project OpenOLAT by OpenOLAT.

the class QuestionListController method reloadStatusFilterTitle.

private void reloadStatusFilterTitle(FormLink link, String i18n) {
    QuestionStatus linkStatus = (QuestionStatus) link.getUserObject();
    getSource().setStatusFilter(linkStatus);
    int numItems = getSource().getNumOfItems();
    link.setI18nKey(i18n, new String[] { Integer.toString(numItems) });
    link.getComponent().setDirty(true);
}
Also used : QuestionStatus(org.olat.modules.qpool.QuestionStatus)

Example 19 with QuestionStatus

use of org.olat.modules.qpool.QuestionStatus in project openolat by klemens.

the class QuestionItemDetailsController method buildStatusDrowdown.

private Dropdown buildStatusDrowdown() {
    QuestionStatus actualStatus = metadatasCtrl.getItem().getQuestionStatus();
    Dropdown statusDropdown = new Dropdown("process.states", "lifecycle.status." + actualStatus.name(), false, getTranslator());
    statusDropdown.setElementCssClass("o_qpool_tools_status o_qpool_status_" + actualStatus.name());
    statusDropdown.setIconCSS("o_icon o_icon-fw o_icon_qitem_" + actualStatus.name());
    statusDropdown.setOrientation(DropdownOrientation.normal);
    statusDraftLink = LinkFactory.createToolLink("lifecycle.status.draft", translate("lifecycle.status.draft"), this);
    statusDraftLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_draft");
    statusDraftLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_draft");
    statusDraftLink.setVisible(qItemSecurityCallback.canSetDraft() && !QuestionStatus.draft.equals(actualStatus));
    statusDropdown.addComponent(statusDraftLink);
    statusRevisedLink = LinkFactory.createToolLink("lifecycle.status.revised", translate("lifecycle.status.revised"), this);
    statusRevisedLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_revised");
    statusRevisedLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_revised");
    statusRevisedLink.setVisible(qItemSecurityCallback.canSetRevised() && !QuestionStatus.revised.equals(actualStatus));
    statusDropdown.addComponent(statusRevisedLink);
    statusReviewLink = LinkFactory.createToolLink("lifecycle.status.review", translate("lifecycle.status.review"), this);
    statusReviewLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_review");
    statusReviewLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_review");
    statusReviewLink.setVisible(qItemSecurityCallback.canSetReview() && !QuestionStatus.review.equals(actualStatus));
    statusDropdown.addComponent(statusReviewLink);
    statusFinalLink = LinkFactory.createToolLink("lifecycle.status.finalVersion", translate("lifecycle.status.finalVersion"), this);
    statusFinalLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_finalVersion");
    statusFinalLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_finalVersion");
    statusFinalLink.setVisible(qItemSecurityCallback.canSetFinal() && !QuestionStatus.finalVersion.equals(actualStatus));
    statusDropdown.addComponent(statusFinalLink);
    statusEndOfLifeLink = LinkFactory.createToolLink("lifecycle.status.endOfLife", translate("lifecycle.status.endOfLife"), this);
    statusEndOfLifeLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_endOfLife");
    statusEndOfLifeLink.setElementCssClass("o_labeled o_qpool_status o_qpool_status_endOfLife");
    statusEndOfLifeLink.setVisible(qItemSecurityCallback.canSetEndOfLife() && !QuestionStatus.endOfLife.equals(actualStatus));
    statusDropdown.addComponent(statusEndOfLifeLink);
    return statusDropdown;
}
Also used : QuestionStatus(org.olat.modules.qpool.QuestionStatus) Dropdown(org.olat.core.gui.components.dropdown.Dropdown)

Example 20 with QuestionStatus

use of org.olat.modules.qpool.QuestionStatus in project openolat by klemens.

the class QuestionItemDetailsController method buildStatusLink.

private Component buildStatusLink() {
    QuestionStatus actualStatus = metadatasCtrl.getItem().getQuestionStatus();
    Link statusLink = LinkFactory.createToolLink("status.link", translate("lifecycle.status." + actualStatus.name()), this);
    statusLink.setElementCssClass("o_qpool_tools_status o_qpool_status_" + actualStatus.name());
    statusLink.setIconLeftCSS("o_icon o_icon-fw o_icon_qitem_" + actualStatus.name());
    return statusLink;
}
Also used : QuestionStatus(org.olat.modules.qpool.QuestionStatus) Link(org.olat.core.gui.components.link.Link)

Aggregations

QuestionStatus (org.olat.modules.qpool.QuestionStatus)20 Test (org.junit.Test)6 QuestionItem (org.olat.modules.qpool.QuestionItem)4 QuestionItemImpl (org.olat.modules.qpool.model.QuestionItemImpl)4 ReviewDecision (org.olat.modules.qpool.model.ReviewDecision)4 Date (java.util.Date)2 Dropdown (org.olat.core.gui.components.dropdown.Dropdown)2 Link (org.olat.core.gui.components.link.Link)2 QuestionItemView (org.olat.modules.qpool.QuestionItemView)2 SearchQuestionItemParams (org.olat.modules.qpool.model.SearchQuestionItemParams)2