use of org.olat.core.util.mail.ContactList in project OpenOLAT by OpenOLAT.
the class CORunController method retrieveParticipantsFromAreas.
private ContactList retrieveParticipantsFromAreas(List<Long> areaKeys) {
List<Identity> participiants = cgm.getParticipantsFromAreas(areaKeys);
ContactList cl = new ContactList(translate("form.message.chckbx.partips"));
cl.addAllIdentites(participiants);
return cl;
}
use of org.olat.core.util.mail.ContactList in project OpenOLAT by OpenOLAT.
the class CORunController method retrieveCoachesFromGroups.
private ContactList retrieveCoachesFromGroups(List<Long> groupKeys) {
List<Identity> coaches = new ArrayList<Identity>(new HashSet<Identity>(cgm.getCoachesFromBusinessGroups(groupKeys)));
ContactList cl = new ContactList(translate("form.message.chckbx.coaches"));
cl.addAllIdentites(coaches);
return cl;
}
use of org.olat.core.util.mail.ContactList in project OpenOLAT by OpenOLAT.
the class CORunController method retrieveCoachesFromAreas.
private ContactList retrieveCoachesFromAreas(List<Long> areaKeys) {
List<Identity> coaches = cgm.getCoachesFromAreas(areaKeys);
Set<Identity> coachesWithoutDuplicates = new HashSet<Identity>(coaches);
coaches = new ArrayList<Identity>(coachesWithoutDuplicates);
ContactList cl = new ContactList(translate("form.message.chckbx.coaches"));
cl.addAllIdentites(coaches);
return cl;
}
use of org.olat.core.util.mail.ContactList in project OpenOLAT by OpenOLAT.
the class CORunController method retrieveOwnersFromCourse.
private ContactList retrieveOwnersFromCourse() {
;
List<Identity> ownerList = repositoryService.getMembers(cgm.getCourseEntry(), GroupRoles.owner.name());
ContactList cl = new ContactList(translate("form.message.chckbx.owners"));
cl.addAllIdentites(ownerList);
return cl;
}
use of org.olat.core.util.mail.ContactList in project OpenOLAT by OpenOLAT.
the class BGEmailCompositionStepController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
StringBuilder groupNames = new StringBuilder();
for (int i = 0; i < 5 && i < groups.size(); i++) {
if (groupNames.length() > 0)
groupNames.append(" - ");
groupNames.append(groups.get(i).getName());
}
String contactsName;
if (groups.size() > 5) {
String otherGroups = Integer.toString(groups.size() - 5);
contactsName = translate("email.other.groups", new String[] { groupNames.toString(), otherGroups });
} else {
contactsName = groupNames.toString();
}
ContactList contacts = new ContactList(contactsName);
Boolean sendToTutorObj = (Boolean) getFromRunContext("tutors");
boolean sendToTutors = sendToTutorObj == null ? false : sendToTutorObj.booleanValue();
if (sendToTutors) {
List<Identity> coaches = businessGroupService.getMembers(groups, GroupRoles.coach.name());
contacts.addAllIdentites(coaches);
}
Boolean sendToParticipantObj = (Boolean) getFromRunContext("participants");
boolean sendToParticipants = sendToParticipantObj == null ? false : sendToParticipantObj.booleanValue();
if (sendToParticipants) {
List<Identity> participants = businessGroupService.getMembers(groups, GroupRoles.participant.name());
contacts.addAllIdentites(participants);
}
contactForm = new ContactForm(ureq, getWindowControl(), mainForm, getIdentity(), false, false, false, false);
contactForm.addEmailTo(contacts);
formLayout.add("wrapped", contactForm.getInitialFormItem());
}
Aggregations