use of org.olat.modules.portfolio.PageStatus in project OpenOLAT by OpenOLAT.
the class PageMetadataController method initStatus.
private void initStatus() {
if (page.getSection() != null && page.getSection().getBinder() != null) {
mainVC.contextPut("statusEnabled", Boolean.TRUE);
PageStatus pageStatus = page.getPageStatus();
if (pageStatus == null) {
pageStatus = PageStatus.draft;
}
String status = translate("status." + pageStatus.name());
mainVC.contextPut("pageStatus", status);
if (secCallback.canPublish(page)) {
publishButton = LinkFactory.createButtonSmall("publish", mainVC, this);
publishButton.setIconLeftCSS("o_icon o_icon_publish o_icon-fw");
publishButton.setElementCssClass("o_sel_pf_publish_entry");
}
if (secCallback.canRevision(page)) {
revisionButton = LinkFactory.createButtonSmall("revision.page", mainVC, this);
revisionButton.setIconLeftCSS("o_icon o_icon_rejected o_icon-fw");
revisionButton.setElementCssClass("o_sel_pf_revision_entry");
revisionButton.setTitle("revision.page.title");
}
if (secCallback.canClose(page)) {
closeButton = LinkFactory.createButtonSmall("close.page", mainVC, this);
closeButton.setIconLeftCSS("o_icon o_icon_status_done o_icon-fw");
closeButton.setElementCssClass("o_sel_pf_close_entry");
closeButton.setTitle("close.page.title");
}
if (secCallback.canReopen(page)) {
reopenButton = LinkFactory.createButtonSmall("reopen.page", mainVC, this);
reopenButton.setIconLeftCSS("o_icon o_icon_redo o_icon-fw");
reopenButton.setElementCssClass("o_sel_pf_reopen_entry");
}
}
}
use of org.olat.modules.portfolio.PageStatus in project OpenOLAT by OpenOLAT.
the class SharedItemsOverviewController method doOpenPages.
private SharedPagesController doOpenPages(UserRequest ureq) {
if (pagesCtrl == null) {
SearchSharePagesParameters searchParams = new SearchSharePagesParameters();
searchParams.setBookmarkOnly(false);
searchParams.addExcludedPageStatus(PageStatus.closed, PageStatus.deleted);
searchParams.addExcludedPageUserStatus(PageUserStatus.done);
List<PageStatus> filters = new ArrayList<>(5);
filters.add(PageStatus.draft);
filters.add(PageStatus.inRevision);
filters.add(PageStatus.published);
WindowControl swControl = addToHistory(ureq, OresHelper.createOLATResourceableInstance("Pages", 0l), null);
pagesCtrl = new SharedPagesController(ureq, swControl, stackPanel, searchParams, filters, PageStatus.published);
listenTo(pagesCtrl);
} else {
pagesCtrl.loadModel();
addToHistory(ureq, pagesCtrl);
}
mainVC.put("segmentCmp", pagesCtrl.getInitialComponent());
return pagesCtrl;
}
use of org.olat.modules.portfolio.PageStatus in project OpenOLAT by OpenOLAT.
the class SharedItemsOverviewController method doOpenMark.
private SharedPagesController doOpenMark(UserRequest ureq) {
if (bookmarkedPagesCtrl == null) {
SearchSharePagesParameters searchParams = new SearchSharePagesParameters();
searchParams.setBookmarkOnly(true);
searchParams.addExcludedPageStatus(PageStatus.deleted);
List<PageStatus> filters = new ArrayList<>(5);
filters.add(PageStatus.draft);
filters.add(PageStatus.inRevision);
filters.add(PageStatus.published);
filters.add(PageStatus.closed);
WindowControl swControl = addToHistory(ureq, OresHelper.createOLATResourceableInstance("Favorits", 0l), null);
bookmarkedPagesCtrl = new SharedPagesController(ureq, swControl, stackPanel, searchParams, filters, null);
listenTo(bookmarkedPagesCtrl);
} else {
bookmarkedPagesCtrl.loadModel();
addToHistory(ureq, bookmarkedPagesCtrl);
}
mainVC.put("segmentCmp", bookmarkedPagesCtrl.getInitialComponent());
return bookmarkedPagesCtrl;
}
use of org.olat.modules.portfolio.PageStatus in project OpenOLAT by OpenOLAT.
the class StatusCellRenderer method render.
@Override
public void render(Renderer renderer, StringOutput target, Object cellValue, int row, FlexiTableComponent source, URLBuilder ubu, Translator trans) {
if (cellValue instanceof PageStatus) {
PageStatus status = (PageStatus) cellValue;
String tip = translator.translate(status.i18nKey());
target.append("<i class='o_icon ").append(status.cssClass()).append(" o_icon-fw' title='").append(tip).append("'> </i>");
} else if (cellValue instanceof SectionStatus) {
SectionStatus status = (SectionStatus) cellValue;
String tip = translator.translate(status.i18nKey());
target.append("<i class='o_icon ").append(status.cssClass()).append(" o_icon-fw' title='").append(tip).append("'> </i>");
}
}
use of org.olat.modules.portfolio.PageStatus in project openolat by klemens.
the class PortfolioServiceImpl method changePageStatus.
@Override
public Page changePageStatus(Page page, PageStatus status, Identity identity, Role by) {
PageStatus currentStatus = page.getPageStatus();
Page reloadedPage = pageDao.loadByKey(page.getKey());
((PageImpl) reloadedPage).setPageStatus(status);
if (status == PageStatus.published) {
Date now = new Date();
if (reloadedPage.getInitialPublicationDate() == null) {
((PageImpl) reloadedPage).setInitialPublicationDate(now);
}
((PageImpl) reloadedPage).setLastPublicationDate(now);
Section section = reloadedPage.getSection();
// auto update the status of the evaluation form of the authors of the binder
changeAssignmentStatus(page, section, EvaluationFormSessionStatus.done);
if (section != null) {
SectionStatus sectionStatus = section.getSectionStatus();
if (currentStatus == PageStatus.closed) {
if (sectionStatus == SectionStatus.closed) {
((SectionImpl) section).setSectionStatus(SectionStatus.inProgress);
binderDao.updateSection(section);
}
} else if (sectionStatus == null || sectionStatus == SectionStatus.notStarted || sectionStatus == SectionStatus.closed) {
((SectionImpl) section).setSectionStatus(SectionStatus.inProgress);
binderDao.updateSection(section);
}
}
} else if (status == PageStatus.inRevision) {
Section section = reloadedPage.getSection();
changeAssignmentStatus(page, section, EvaluationFormSessionStatus.inProgress);
if (section != null) {
SectionStatus sectionStatus = section.getSectionStatus();
if (sectionStatus == null || sectionStatus == SectionStatus.notStarted || sectionStatus == SectionStatus.closed) {
if (sectionStatus == SectionStatus.closed) {
((SectionImpl) section).setSectionStatus(SectionStatus.inProgress);
binderDao.updateSection(section);
}
}
}
pageUserInfosDao.updateStatus(reloadedPage, PageUserStatus.inProcess, PageUserStatus.done);
} else if (status == PageStatus.closed) {
// set user informations to done
pageUserInfosDao.updateStatus(reloadedPage, PageUserStatus.done);
}
if (reloadedPage.getSection() != null && reloadedPage.getSection().getBinder() != null) {
Binder binder = reloadedPage.getSection().getBinder();
updateAssessmentEntryLastModification(binder, identity, by);
}
return pageDao.updatePage(reloadedPage);
}
Aggregations