use of org.olat.admin.user.UserShortDescription in project OpenOLAT by OpenOLAT.
the class SingleParticipantCallController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
int numOfChecks = lectureBlock.getPlannedLecturesNumber();
List<Integer> absences = rollCall.getLecturesAbsentList();
for (int i = 0; i < numOfChecks; i++) {
String checkId = "check_" + i;
MultipleSelectionElement check = uifactory.addCheckboxesHorizontal(checkId, null, layoutCont, onKeys, onValues);
check.setDomReplacementWrapperRequired(false);
check.addActionListener(FormEvent.ONCHANGE);
if (absences.contains(i)) {
check.select(onKeys[0], true);
}
checks.add(check);
}
layoutCont.contextPut("checks", checks);
DisplayPortraitController portraitCtr = new DisplayPortraitController(ureq, getWindowControl(), calledIdentity, true, false);
listenTo(portraitCtr);
layoutCont.getFormItemComponent().put("portrait", portraitCtr.getInitialComponent());
UserShortDescription userDescr = new UserShortDescription(ureq, getWindowControl(), calledIdentity);
listenTo(userDescr);
layoutCont.getFormItemComponent().put("userDescr", userDescr.getInitialComponent());
}
if (autorizedAbsenceEnabled) {
authorizedAbsencedEl = uifactory.addCheckboxesHorizontal("authorized.absence", "authorized.absence", formLayout, onKeys, onValues);
authorizedAbsencedEl.setDomReplacementWrapperRequired(false);
authorizedAbsencedEl.addActionListener(FormEvent.ONCHANGE);
if (rollCall.getAbsenceAuthorized() != null && rollCall.getAbsenceAuthorized().booleanValue()) {
authorizedAbsencedEl.select(onKeys[0], true);
}
String reason = rollCall.getAbsenceReason();
absenceReasonEl = uifactory.addTextAreaElement("absence.reason", "authorized.absence.reason", 2000, 4, 36, false, reason, formLayout);
absenceReasonEl.setDomReplacementWrapperRequired(false);
absenceReasonEl.setPlaceholderKey("authorized.absence.reason", null);
absenceReasonEl.setVisible(authorizedAbsencedEl.isAtLeastSelected(1));
absenceReasonEl.setMandatory(!absenceDefaultAuthorized);
}
String comment = rollCall.getComment();
commentEl = uifactory.addTextAreaElement("comment", "rollcall.comment", 2000, 4, 36, false, comment, formLayout);
commentEl.setPlaceholderKey("rollcall.comment", null);
selectAllLink = uifactory.addFormLink("all", formLayout);
uifactory.addFormSubmitButton("save", "save.next", formLayout);
uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl());
}
use of org.olat.admin.user.UserShortDescription in project openolat by klemens.
the class AccessRightsEditController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (member != null && formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
Controller portraitCtr = new DisplayPortraitController(ureq, getWindowControl(), member, true, true);
layoutCont.getFormItemComponent().put("portrait", portraitCtr.getInitialComponent());
listenTo(portraitCtr);
Controller userShortDescrCtr = new UserShortDescription(ureq, getWindowControl(), member);
layoutCont.getFormItemComponent().put("userShortDescription", userShortDescrCtr.getInitialComponent());
listenTo(userShortDescrCtr);
}
selectAll = uifactory.addFormLink("form.checkall", "form.checkall", null, formLayout, Link.LINK);
selectAll.setIconLeftCSS("o_icon o_icon-sm o_icon_check_on");
deselectAll = uifactory.addFormLink("form.uncheckall", "form.uncheckall", null, formLayout, Link.LINK);
deselectAll.setIconLeftCSS("o_icon o_icon-sm o_icon_check_off");
// binder
MultipleSelectionElement coachEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
coachEl.addActionListener(FormEvent.ONCHANGE);
coachEl.setVisible(grading);
MultipleSelectionElement reviewerEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
reviewerEl.addActionListener(FormEvent.ONCHANGE);
binderRow = new BinderAccessRightsRow(coachEl, reviewerEl, binder);
coachEl.setUserObject(binderRow);
reviewerEl.setUserObject(binderRow);
// sections
List<Section> sections = portfolioService.getSections(binder);
Map<Long, SectionAccessRightsRow> sectionMap = new HashMap<>();
for (Section section : sections) {
MultipleSelectionElement sectionCoachEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
sectionCoachEl.addActionListener(FormEvent.ONCHANGE);
sectionCoachEl.setVisible(grading);
MultipleSelectionElement sectionReviewerEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
sectionReviewerEl.addActionListener(FormEvent.ONCHANGE);
SectionAccessRightsRow sectionRow = new SectionAccessRightsRow(sectionCoachEl, sectionReviewerEl, section, binderRow);
binderRow.getSections().add(sectionRow);
sectionMap.put(section.getKey(), sectionRow);
sectionCoachEl.setUserObject(sectionRow);
sectionReviewerEl.setUserObject(sectionRow);
}
// pages
List<Page> pages = portfolioService.getPages(binder, null);
for (Page page : pages) {
Section section = page.getSection();
SectionAccessRightsRow sectionRow = sectionMap.get(section.getKey());
MultipleSelectionElement pageCoachEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
pageCoachEl.addActionListener(FormEvent.ONCHANGE);
pageCoachEl.setVisible(grading);
MultipleSelectionElement pageReviewerEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
pageReviewerEl.addActionListener(FormEvent.ONCHANGE);
PortfolioElementAccessRightsRow pageRow = new PortfolioElementAccessRightsRow(pageCoachEl, pageReviewerEl, page, sectionRow);
sectionRow.getPages().add(pageRow);
pageCoachEl.setUserObject(pageRow);
pageReviewerEl.setUserObject(pageRow);
}
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut("binderRow", binderRow);
layoutCont.contextPut("grading", new Boolean(grading));
}
if (hasButtons) {
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add(buttonsCont);
buttonsCont.setRootForm(mainForm);
formLayout.add("buttons", buttonsCont);
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
removeLink = uifactory.addFormLink("remove", buttonsCont, Link.BUTTON);
if (canEdit) {
uifactory.addFormSubmitButton("save", buttonsCont);
}
}
}
use of org.olat.admin.user.UserShortDescription in project OpenOLAT by OpenOLAT.
the class AccessRightsEditController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (member != null && formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
Controller portraitCtr = new DisplayPortraitController(ureq, getWindowControl(), member, true, true);
layoutCont.getFormItemComponent().put("portrait", portraitCtr.getInitialComponent());
listenTo(portraitCtr);
Controller userShortDescrCtr = new UserShortDescription(ureq, getWindowControl(), member);
layoutCont.getFormItemComponent().put("userShortDescription", userShortDescrCtr.getInitialComponent());
listenTo(userShortDescrCtr);
}
selectAll = uifactory.addFormLink("form.checkall", "form.checkall", null, formLayout, Link.LINK);
selectAll.setIconLeftCSS("o_icon o_icon-sm o_icon_check_on");
deselectAll = uifactory.addFormLink("form.uncheckall", "form.uncheckall", null, formLayout, Link.LINK);
deselectAll.setIconLeftCSS("o_icon o_icon-sm o_icon_check_off");
// binder
MultipleSelectionElement coachEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
coachEl.addActionListener(FormEvent.ONCHANGE);
coachEl.setVisible(grading);
MultipleSelectionElement reviewerEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
reviewerEl.addActionListener(FormEvent.ONCHANGE);
binderRow = new BinderAccessRightsRow(coachEl, reviewerEl, binder);
coachEl.setUserObject(binderRow);
reviewerEl.setUserObject(binderRow);
// sections
List<Section> sections = portfolioService.getSections(binder);
Map<Long, SectionAccessRightsRow> sectionMap = new HashMap<>();
for (Section section : sections) {
MultipleSelectionElement sectionCoachEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
sectionCoachEl.addActionListener(FormEvent.ONCHANGE);
sectionCoachEl.setVisible(grading);
MultipleSelectionElement sectionReviewerEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
sectionReviewerEl.addActionListener(FormEvent.ONCHANGE);
SectionAccessRightsRow sectionRow = new SectionAccessRightsRow(sectionCoachEl, sectionReviewerEl, section, binderRow);
binderRow.getSections().add(sectionRow);
sectionMap.put(section.getKey(), sectionRow);
sectionCoachEl.setUserObject(sectionRow);
sectionReviewerEl.setUserObject(sectionRow);
}
// pages
List<Page> pages = portfolioService.getPages(binder, null);
for (Page page : pages) {
Section section = page.getSection();
SectionAccessRightsRow sectionRow = sectionMap.get(section.getKey());
MultipleSelectionElement pageCoachEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
pageCoachEl.addActionListener(FormEvent.ONCHANGE);
pageCoachEl.setVisible(grading);
MultipleSelectionElement pageReviewerEl = uifactory.addCheckboxesHorizontal("access-" + (counter++), null, formLayout, theKeys, theValues);
pageReviewerEl.addActionListener(FormEvent.ONCHANGE);
PortfolioElementAccessRightsRow pageRow = new PortfolioElementAccessRightsRow(pageCoachEl, pageReviewerEl, page, sectionRow);
sectionRow.getPages().add(pageRow);
pageCoachEl.setUserObject(pageRow);
pageReviewerEl.setUserObject(pageRow);
}
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
layoutCont.contextPut("binderRow", binderRow);
layoutCont.contextPut("grading", new Boolean(grading));
}
if (hasButtons) {
FormLayoutContainer buttonsCont = FormLayoutContainer.createButtonLayout("buttons", getTranslator());
formLayout.add(buttonsCont);
buttonsCont.setRootForm(mainForm);
formLayout.add("buttons", buttonsCont);
uifactory.addFormCancelButton("cancel", buttonsCont, ureq, getWindowControl());
removeLink = uifactory.addFormLink("remove", buttonsCont, Link.BUTTON);
if (canEdit) {
uifactory.addFormSubmitButton("save", buttonsCont);
}
}
}
use of org.olat.admin.user.UserShortDescription in project openolat by klemens.
the class SingleParticipantCallController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
if (formLayout instanceof FormLayoutContainer) {
FormLayoutContainer layoutCont = (FormLayoutContainer) formLayout;
int numOfChecks = lectureBlock.getPlannedLecturesNumber();
List<Integer> absences = rollCall.getLecturesAbsentList();
for (int i = 0; i < numOfChecks; i++) {
String checkId = "check_" + i;
MultipleSelectionElement check = uifactory.addCheckboxesHorizontal(checkId, null, layoutCont, onKeys, onValues);
check.setDomReplacementWrapperRequired(false);
check.addActionListener(FormEvent.ONCHANGE);
if (absences.contains(i)) {
check.select(onKeys[0], true);
}
checks.add(check);
}
layoutCont.contextPut("checks", checks);
DisplayPortraitController portraitCtr = new DisplayPortraitController(ureq, getWindowControl(), calledIdentity, true, false);
listenTo(portraitCtr);
layoutCont.getFormItemComponent().put("portrait", portraitCtr.getInitialComponent());
UserShortDescription userDescr = new UserShortDescription(ureq, getWindowControl(), calledIdentity);
listenTo(userDescr);
layoutCont.getFormItemComponent().put("userDescr", userDescr.getInitialComponent());
}
if (autorizedAbsenceEnabled) {
authorizedAbsencedEl = uifactory.addCheckboxesHorizontal("authorized.absence", "authorized.absence", formLayout, onKeys, onValues);
authorizedAbsencedEl.setDomReplacementWrapperRequired(false);
authorizedAbsencedEl.addActionListener(FormEvent.ONCHANGE);
if (rollCall.getAbsenceAuthorized() != null && rollCall.getAbsenceAuthorized().booleanValue()) {
authorizedAbsencedEl.select(onKeys[0], true);
}
String reason = rollCall.getAbsenceReason();
absenceReasonEl = uifactory.addTextAreaElement("absence.reason", "authorized.absence.reason", 2000, 4, 36, false, reason, formLayout);
absenceReasonEl.setDomReplacementWrapperRequired(false);
absenceReasonEl.setPlaceholderKey("authorized.absence.reason", null);
absenceReasonEl.setVisible(authorizedAbsencedEl.isAtLeastSelected(1));
absenceReasonEl.setMandatory(!absenceDefaultAuthorized);
}
String comment = rollCall.getComment();
commentEl = uifactory.addTextAreaElement("comment", "rollcall.comment", 2000, 4, 36, false, comment, formLayout);
commentEl.setPlaceholderKey("rollcall.comment", null);
selectAllLink = uifactory.addFormLink("all", formLayout);
uifactory.addFormSubmitButton("save", "save.next", formLayout);
uifactory.addFormCancelButton("cancel", formLayout, ureq, getWindowControl());
}
Aggregations