use of org.olat.core.gui.components.form.flexible.elements.FormLink in project OpenOLAT by OpenOLAT.
the class PublishStep01AccessForm method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
super.formInnerEvent(ureq, source, event);
if (source == authorsSwitch) {
if (authorsSwitch.getSelectedKey().equals(YES_KEY)) {
authorConfigLayout.setVisible(true);
} else {
authorConfigLayout.setVisible(false);
if (!publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY)) {
usersSwitch.select(NO_KEY, false);
userConfigLayout.setVisible(false);
}
}
} else if (source == usersSwitch || source == publishedForUsers) {
if (usersSwitch.getSelectedKey().equals(YES_KEY)) {
userConfigLayout.setVisible(true);
accessLayout.setVisible(true);
if (publishedForUsers.getSelectedKey().equals(MEMBERSONLY_KEY)) {
authorConfigLayout.setVisible(false);
authorsSwitch.select(NO_KEY, false);
authorsSwitch.setEnabled(false);
} else {
authorsSwitch.select(YES_KEY, false);
authorsSwitch.setEnabled(true);
authorConfigLayout.setVisible(true);
}
} else {
userConfigLayout.setVisible(false);
accessLayout.setVisible(false);
authorsSwitch.setEnabled(true);
}
} else if (addMethods.contains(source)) {
AccessMethod method = (AccessMethod) source.getUserObject();
addMethod(ureq, method);
} else if (confirmationEmailEl == source) {
for (AccessInfo info : confControllers) {
if (!offerAccess.contains(info.getLink())) {
offerAccess.add(info.getLink());
}
}
} else if (source instanceof FormLink) {
FormLink button = (FormLink) source;
String cmd = button.getCmd();
if ("delete".equals(cmd)) {
AccessInfo infos = (AccessInfo) source.getUserObject();
OfferAccess deleteOffer = infos.getLink();
offerAccess.remove(deleteOffer);
if (deleteOffer.getKey() != null) {
deletedOfferAccess.add(deleteOffer);
}
confControllers.remove(infos);
updateConfirmationEmail();
fireEvent(ureq, Event.CHANGED_EVENT);
} else if ("edit".equals(cmd)) {
AccessInfo infos = (AccessInfo) source.getUserObject();
editMethod(ureq, infos);
}
}
}
use of org.olat.core.gui.components.form.flexible.elements.FormLink in project OpenOLAT by OpenOLAT.
the class AbstractMemberListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (source == membersTable) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
MemberView row = memberListModel.getObject(se.getIndex());
if (TABLE_ACTION_IM.equals(cmd)) {
doIm(ureq, row);
} else if (TABLE_ACTION_EDIT.equals(cmd)) {
openEdit(ureq, row);
}
} else if (event instanceof FlexiTableSearchEvent) {
String cmd = event.getCommand();
if (FlexiTableSearchEvent.SEARCH.equals(event.getCommand())) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
String search = se.getSearch();
doSearch(search);
} else if (FlexiTableSearchEvent.QUICK_SEARCH.equals(event.getCommand())) {
FlexiTableSearchEvent se = (FlexiTableSearchEvent) event;
String search = se.getSearch();
doSearch(search);
} else if (FlexiTableSearchEvent.RESET.getCommand().equals(cmd)) {
doResetSearch();
}
}
} else if (editButton == source) {
List<MemberView> selectedItems = getMultiSelectedRows();
openEdit(ureq, selectedItems);
} else if (mailButton == source) {
List<MemberView> selectedItems = getMultiSelectedRows();
doSendMail(ureq, selectedItems);
} else if (removeButton == source) {
List<MemberView> selectedItems = getMultiSelectedRows();
confirmDelete(ureq, selectedItems);
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
String cmd = link.getCmd();
if ("tools".equals(cmd)) {
MemberView row = (MemberView) link.getUserObject();
doOpenTools(ureq, row, link);
} else if ("im".equals(cmd)) {
MemberView row = (MemberView) link.getUserObject();
doIm(ureq, row);
}
}
super.formInnerEvent(ureq, source, event);
}
use of org.olat.core.gui.components.form.flexible.elements.FormLink in project OpenOLAT by OpenOLAT.
the class AbstractSelectBusinessGroupListController method searchTableItems.
@Override
protected List<BGTableItem> searchTableItems(BusinessGroupQueryParams params) {
List<StatisticsBusinessGroupRow> rows = businessGroupService.findBusinessGroupsForSelection(params, getIdentity());
List<BGTableItem> items = new ArrayList<>(rows.size());
for (StatisticsBusinessGroupRow row : rows) {
FormLink markLink = uifactory.addFormLink("mark_" + row.getKey(), "mark", "", null, null, Link.NONTRANSLATED);
markLink.setIconLeftCSS(row.isMarked() ? Mark.MARK_CSS_LARGE : Mark.MARK_ADD_CSS_LARGE);
BGTableItem item = new BGTableItem(row, markLink, Boolean.FALSE, Boolean.FALSE);
item.setNumOfOwners(row.getNumOfCoaches());
item.setNumOfParticipants(row.getNumOfParticipants());
item.setNumWaiting(row.getNumWaiting());
item.setNumOfPendings(row.getNumPending());
items.add(item);
}
return items;
}
use of org.olat.core.gui.components.form.flexible.elements.FormLink in project OpenOLAT by OpenOLAT.
the class AbstractMemberListController method forgeLinks.
protected void forgeLinks(MemberView row) {
FormLink toolsLink = uifactory.addFormLink("tools_" + counter.incrementAndGet(), "tools", "", null, null, Link.NONTRANSLATED);
toolsLink.setIconLeftCSS("o_icon o_icon_actions o_icon-lg");
toolsLink.setUserObject(row);
row.setToolsLink(toolsLink);
FormLink chatLink = uifactory.addFormLink("tools_" + counter.incrementAndGet(), "im", "", null, null, Link.NONTRANSLATED);
chatLink.setIconLeftCSS("o_icon o_icon_status_unavailable");
chatLink.setUserObject(row);
row.setChatLink(chatLink);
}
use of org.olat.core.gui.components.form.flexible.elements.FormLink in project OpenOLAT by OpenOLAT.
the class CorrectionAssessmentItemListController method formInnerEvent.
@Override
protected void formInnerEvent(UserRequest ureq, FormItem source, FormEvent event) {
if (tableEl == source) {
if (event instanceof SelectionEvent) {
SelectionEvent se = (SelectionEvent) event;
String cmd = se.getCommand();
CorrectionAssessmentItemRow row = tableModel.getObject(se.getIndex());
if ("select".equals(cmd)) {
// accept all
doSelect(ureq, row, r -> true);
} else if ("answered".equals(cmd)) {
// accept all
doSelect(ureq, row, new ResponsedPredicate(row, true));
} else if ("notAnswered".equals(cmd)) {
// accept all
doSelect(ureq, row, new ResponsedPredicate(row, false));
} else if ("autoCorrected".equals(cmd)) {
doSelect(ureq, row, entry -> !row.isManualCorrection() && entry.getManualScore() == null);
} else if ("corrected".equals(cmd)) {
doSelect(ureq, row, entry -> entry.getManualScore() != null);
} else if ("notCorrected".equals(cmd)) {
doSelect(ureq, row, entry -> row.isManualCorrection() && entry.getManualScore() == null);
} else if ("toReview".equals(cmd)) {
doSelect(ureq, row, AssessmentItemListEntry::isToReview);
}
}
} else if (saveTestsButton == source) {
doConfirmSaveTests(ureq);
} else if (source instanceof FormLink) {
FormLink link = (FormLink) source;
if ("tools".equals(link.getCmd())) {
doOpenTools(ureq, (CorrectionAssessmentItemRow) link.getUserObject(), link);
}
}
super.formInnerEvent(ureq, source, event);
}
Aggregations