use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.
the class AppointmentsServiceImpl method removeTeamsMeeting.
@Override
public Appointment removeTeamsMeeting(Appointment appointment) {
Appointment updated = appointment;
TeamsMeeting meeting = appointment.getTeamsMeeting();
if (meeting != null) {
updated = appointmentDao.saveAppointment(appointment, appointment.getBBBMeeting(), null);
teamsService.deleteMeeting(meeting);
}
return updated;
}
use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.
the class TeamsCourseNode method cleanupOnDelete.
@Override
public void cleanupOnDelete(ICourse course) {
TeamsService teamsService = CoreSpringFactory.getImpl(TeamsService.class);
RepositoryEntry courseEntry = course.getCourseEnvironment().getCourseGroupManager().getCourseEntry();
List<TeamsMeeting> meetings = teamsService.getMeetings(courseEntry, getIdent(), null);
for (TeamsMeeting meeting : meetings) {
teamsService.deleteMeeting(meeting);
}
super.cleanupOnDelete(course);
}
use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.
the class TeamsMeetingsCalendarController method initForm.
@Override
protected void initForm(FormItemContainer formLayout, Controller listener, UserRequest ureq) {
Kalendar calendar = new Kalendar("Teams.OnlineMeetings", "Teams.OnlineMeetings");
KalendarRenderWrapper calendarWrapper = new KalendarRenderWrapper(calendar, "Teams Online-Meetings", "teams.calendar");
calendarWrapper.setPrivateEventsVisible(true);
calendarWrapper.setCssClass("o_cal_blue");
calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_ONLY);
List<TeamsMeeting> meetings = teamsService.getAllMeetings();
// Add events to the calendar
for (TeamsMeeting meeting : meetings) {
if (meeting.isPermanent()) {
continue;
}
// Create a calendar event with the room name as subject
String eventId = "teams.meeting." + meeting.getKey();
KalendarEvent newEvent = new KalendarEvent(eventId, null, meeting.getSubject(), meeting.getStartDate(), meeting.getEndDate());
newEvent.setDescription(meeting.getSubject());
calendar.addEvent(newEvent);
}
Translator calTrans = Util.createPackageTranslator(CalendarManager.class, getLocale(), getTranslator());
List<KalendarRenderWrapper> calendarWrappers = List.of(calendarWrapper);
FullCalendarElement calComp = new FullCalendarElement(ureq, "calComp", calendarWrappers, calTrans);
calComp.setView(FullCalendarViews.timeGridWeek);
formLayout.add(calComp);
}
use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.
the class TeamsMeetingsController method updateModel.
protected void updateModel() {
List<TeamsMeeting> meetings = teamsService.getMeetings(entry, subIdent, group);
Date now = new Date();
List<TeamsMeeting> pastMeetings = new ArrayList<>();
List<TeamsMeeting> upcomingMeetings = new ArrayList<>();
for (TeamsMeeting meeting : meetings) {
if (meeting.getStartDate() == null || meeting.getEndDate() == null || now.compareTo(meeting.getEndDate()) <= 0) {
upcomingMeetings.add(meeting);
} else {
pastMeetings.add(meeting);
}
}
upcomingTableModel.setObjects(upcomingMeetings);
upcomingTableEl.reset(true, true, true);
pastTableModel.setObjects(pastMeetings);
pastTableEl.reset(true, true, true);
pastTableEl.setVisible(!pastMeetings.isEmpty());
}
use of org.olat.modules.teams.TeamsMeeting in project OpenOLAT by OpenOLAT.
the class TeamsAdminMeetingsController method event.
@Override
protected void event(UserRequest ureq, Controller source, Event event) {
if (confirmDelete == source) {
if (DialogBoxUIFactory.isYesEvent(event) || DialogBoxUIFactory.isOkEvent(event)) {
TeamsMeeting meeting = (TeamsMeeting) confirmDelete.getUserObject();
doDelete(meeting);
}
cleanUp();
} else if (confirmBatchDelete == source) {
if (DialogBoxUIFactory.isYesEvent(event) || DialogBoxUIFactory.isOkEvent(event)) {
@SuppressWarnings("unchecked") List<TeamsMeeting> meetings = (List<TeamsMeeting>) confirmBatchDelete.getUserObject();
doDelete(meetings);
}
cleanUp();
} else if (cmc == source) {
cleanUp();
}
super.event(ureq, source, event);
}
Aggregations