use of org.olat.commons.calendar.ui.WeeklyCalendarController in project OpenOLAT by OpenOLAT.
the class CollaborationTools method createCalendarController.
/**
* Creates a calendar controller
* @param ureq
* @param wControl
* @param resourceableId
* @return Configured WeeklyCalendarController
*/
public CalendarController createCalendarController(UserRequest ureq, WindowControl wControl, BusinessGroup businessGroup, boolean isAdmin, boolean isMember) {
CollaborationManager collaborationManager = CoreSpringFactory.getImpl(CollaborationManager.class);
KalendarRenderWrapper calRenderWrapper = collaborationManager.getCalendar(businessGroup, ureq, isAdmin);
calRenderWrapper.setPrivateEventsVisible(isAdmin || isMember);
// add linking
List<RepositoryEntry> repoEntries = CoreSpringFactory.getImpl(BusinessGroupService.class).findRepositoryEntries(Collections.singleton(businessGroup), 0, -1);
List<ICourse> courses = new ArrayList<>(repoEntries.size());
for (RepositoryEntry repoEntry : repoEntries) {
if (repoEntry.getOlatResource().getResourceableTypeName().equals(CourseModule.getCourseTypeName())) {
ICourse course = CourseFactory.loadCourse(repoEntry);
courses.add(course);
}
}
if (!courses.isEmpty()) {
CourseLinkProviderController clp = new CourseLinkProviderController(null, courses, ureq, wControl);
calRenderWrapper.setLinkProvider(clp);
}
List<KalendarRenderWrapper> calendars = new ArrayList<>();
calendars.add(calRenderWrapper);
return new WeeklyCalendarController(ureq, wControl, calendars, WeeklyCalendarController.CALLER_COLLAB, businessGroup, false);
}
use of org.olat.commons.calendar.ui.WeeklyCalendarController in project OpenOLAT by OpenOLAT.
the class UserInfoMainController method doOpenCalendar.
private WeeklyCalendarController doOpenCalendar(UserRequest ureq) {
removeAsListenerAndDispose(calendarController);
KalendarRenderWrapper calendarWrapper = calendarManager.getPersonalCalendar(chosenIdentity);
CalendarUserConfiguration config = calendarManager.findCalendarConfigForIdentity(calendarWrapper.getKalendar(), getIdentity());
if (config != null) {
calendarWrapper.setConfiguration(config);
}
calendarWrapper.setPrivateEventsVisible(chosenIdentity.equals(ureq.getIdentity()));
if (chosenIdentity.equals(ureq.getIdentity())) {
calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_WRITE);
} else {
calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_ONLY);
}
List<KalendarRenderWrapper> calendars = new ArrayList<KalendarRenderWrapper>();
calendars.add(calendarWrapper);
OLATResourceable ores = OresHelper.createOLATResourceableType(CMD_CALENDAR);
WindowControl bwControl = addToHistory(ureq, ores, null);
OLATResourceable callerOres = OresHelper.createOLATResourceableInstance(chosenIdentity.getName(), chosenIdentity.getKey());
calendarController = new WeeklyCalendarController(ureq, bwControl, calendars, WeeklyCalendarController.CALLER_PROFILE, callerOres, false);
listenTo(calendarController);
return calendarController;
}
use of org.olat.commons.calendar.ui.WeeklyCalendarController in project OpenOLAT by OpenOLAT.
the class GroupInfoMainController method getCalendarController.
private WeeklyCalendarController getCalendarController(UserRequest ureq) {
if (calendarController == null) {
OLATResourceable ores = OresHelper.createOLATResourceableInstance("Calendar", 0l);
WindowControl bwControl = BusinessControlFactory.getInstance().createBusinessWindowControl(ores, null, getWindowControl());
List<KalendarRenderWrapper> calendarWrappers = new ArrayList<>(2);
KalendarRenderWrapper groupCalendar = calendarManager.getGroupCalendar(businessGroup);
groupCalendar.setPrivateEventsVisible(false);
calendarWrappers.add(groupCalendar);
calendarController = new WeeklyCalendarController(ureq, bwControl, calendarWrappers, WeeklyCalendarController.CALLER_COLLAB, businessGroup, false);
listenTo(calendarController);
}
layoutController.setCol3(calendarController.getInitialComponent());
addToHistory(ureq, calendarController);
return calendarController;
}
use of org.olat.commons.calendar.ui.WeeklyCalendarController in project openolat by klemens.
the class CollaborationTools method createCalendarController.
/**
* Creates a calendar controller
* @param ureq
* @param wControl
* @param resourceableId
* @return Configured WeeklyCalendarController
*/
public CalendarController createCalendarController(UserRequest ureq, WindowControl wControl, BusinessGroup businessGroup, boolean isAdmin, boolean isMember) {
CollaborationManager collaborationManager = CoreSpringFactory.getImpl(CollaborationManager.class);
KalendarRenderWrapper calRenderWrapper = collaborationManager.getCalendar(businessGroup, ureq, isAdmin);
calRenderWrapper.setPrivateEventsVisible(isAdmin || isMember);
// add linking
List<RepositoryEntry> repoEntries = CoreSpringFactory.getImpl(BusinessGroupService.class).findRepositoryEntries(Collections.singleton(businessGroup), 0, -1);
List<ICourse> courses = new ArrayList<>(repoEntries.size());
for (RepositoryEntry repoEntry : repoEntries) {
if (repoEntry.getOlatResource().getResourceableTypeName().equals(CourseModule.getCourseTypeName())) {
ICourse course = CourseFactory.loadCourse(repoEntry);
courses.add(course);
}
}
if (!courses.isEmpty()) {
CourseLinkProviderController clp = new CourseLinkProviderController(null, courses, ureq, wControl);
calRenderWrapper.setLinkProvider(clp);
}
List<KalendarRenderWrapper> calendars = new ArrayList<>();
calendars.add(calRenderWrapper);
return new WeeklyCalendarController(ureq, wControl, calendars, WeeklyCalendarController.CALLER_COLLAB, businessGroup, false);
}
use of org.olat.commons.calendar.ui.WeeklyCalendarController in project openolat by klemens.
the class UserInfoMainController method doOpenCalendar.
private WeeklyCalendarController doOpenCalendar(UserRequest ureq) {
removeAsListenerAndDispose(calendarController);
KalendarRenderWrapper calendarWrapper = calendarManager.getPersonalCalendar(chosenIdentity);
CalendarUserConfiguration config = calendarManager.findCalendarConfigForIdentity(calendarWrapper.getKalendar(), getIdentity());
if (config != null) {
calendarWrapper.setConfiguration(config);
}
calendarWrapper.setPrivateEventsVisible(chosenIdentity.equals(ureq.getIdentity()));
if (chosenIdentity.equals(ureq.getIdentity())) {
calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_WRITE);
} else {
calendarWrapper.setAccess(KalendarRenderWrapper.ACCESS_READ_ONLY);
}
List<KalendarRenderWrapper> calendars = new ArrayList<KalendarRenderWrapper>();
calendars.add(calendarWrapper);
OLATResourceable ores = OresHelper.createOLATResourceableType(CMD_CALENDAR);
WindowControl bwControl = addToHistory(ureq, ores, null);
OLATResourceable callerOres = OresHelper.createOLATResourceableInstance(chosenIdentity.getName(), chosenIdentity.getKey());
calendarController = new WeeklyCalendarController(ureq, bwControl, calendars, WeeklyCalendarController.CALLER_PROFILE, callerOres, false);
listenTo(calendarController);
return calendarController;
}
Aggregations