51
51
import org .unitime .timetable .gwt .shared .EventInterface .NoteInterface ;
52
52
import org .unitime .timetable .gwt .shared .EventInterface .ResourceInterface ;
53
53
import org .unitime .timetable .gwt .shared .EventInterface .ResourceType ;
54
+ import org .unitime .timetable .gwt .shared .EventInterface .SessionInterface ;
54
55
import org .unitime .timetable .gwt .shared .EventInterface .SponsoringOrganizationInterface ;
55
56
import org .unitime .timetable .model .ClassEvent ;
56
57
import org .unitime .timetable .model .ClassInstructor ;
@@ -1613,6 +1614,7 @@ else if (request.getResourceExternalId() != null)
1613
1614
}
1614
1615
CourseOffering correctedOffering = clazz .getSchedulingSubpart ().getInstrOfferingConfig ().getInstructionalOffering ().getControllingCourseOffering ();
1615
1616
event .setDeptCode (correctedOffering .getDepartment ().getDeptCode ());
1617
+ event .setSession (toSessionInterface (correctedOffering .getInstructionalOffering ().getSession ()));
1616
1618
List <CourseOffering > courses = new ArrayList <CourseOffering >(clazz .getSchedulingSubpart ().getInstrOfferingConfig ().getInstructionalOffering ().getCourseOfferings ());
1617
1619
boolean instructing = false ;
1618
1620
if (request .getResourceType () == ResourceType .PERSON && request .getResourceExternalId () != null ) {
@@ -1708,6 +1710,7 @@ else if (request.getResourceExternalId() != null)
1708
1710
ExamEvent xe = ExamEventDAO .getInstance ().get (m .getEvent ().getUniqueId (), hibSession );
1709
1711
event .setEnrollment (xe .getExam ().countStudents ());
1710
1712
event .setMaxCapacity (xe .getExam ().getSize ());
1713
+ event .setSession (toSessionInterface (xe .getExam ().getSession ()));
1711
1714
if (groupEnrollments ) {
1712
1715
int enrl = 0 ;
1713
1716
Set <Long > studentIds = xe .getExam ().getStudentIds ();
@@ -1863,7 +1866,8 @@ else if (request.getResourceExternalId() != null)
1863
1866
break ;
1864
1867
}
1865
1868
}
1866
- }
1869
+ if (event .getSession () == null )
1870
+ event .setSession (toSessionInterface (owner .getCourse ().getInstructionalOffering ().getSession ())); }
1867
1871
event .setEnrollment (enrl );
1868
1872
event .setMaxCapacity (cap );
1869
1873
}
@@ -1932,6 +1936,8 @@ else if (request.getResourceExternalId() != null)
1932
1936
location .setPartitionParentId (m .getLocation ().getPartitionParentId ());
1933
1937
location .setEventEmail (m .getLocation ().getEventEmail ());
1934
1938
meeting .setLocation (location );
1939
+ if (event .getSession () == null )
1940
+ event .setSession (toSessionInterface (m .getLocation ().getSession ()));
1935
1941
}
1936
1942
if (request .getEventFilter ().hasOptions ("flag" ) && request .getEventFilter ().getOptions ("flag" ).contains ("Conflicts" )) {
1937
1943
if (m .getLocation () != null && m .getLocation ().getEventAvailability () != null && m .getLocation ().getEventAvailability ().length () == Constants .SLOTS_PER_DAY * Constants .DAY_CODES .length ) {
@@ -2761,6 +2767,7 @@ else if (request.getResourceExternalId() != null)
2761
2767
event .setClassId (clazz .getUniqueId ());
2762
2768
event .setSessionId (clazz .getSessionId ());
2763
2769
event .setDeptCode (correctedOffering .getDepartment ().getDeptCode ());
2770
+ event .setSession (toSessionInterface (correctedOffering .getInstructionalOffering ().getSession ()));
2764
2771
List <CourseOffering > courses = new ArrayList <CourseOffering >(clazz .getSchedulingSubpart ().getInstrOfferingConfig ().getInstructionalOffering ().getCourseOfferings ());
2765
2772
switch (request .getResourceType ()) {
2766
2773
case CURRICULUM :
@@ -2985,5 +2992,14 @@ public static TreeSet<MeetingInterface> generateUnavailabilityMeetings(Location
2985
2992
}
2986
2993
return ret ;
2987
2994
}
2995
+
2996
+ protected static SessionInterface toSessionInterface (Session session ) {
2997
+ SessionInterface ret = new SessionInterface ();
2998
+ ret .setId (session .getUniqueId ());
2999
+ ret .setTerm (session .getAcademicTerm ());
3000
+ ret .setYear (session .getAcademicYear ());
3001
+ ret .setInitiative (session .getAcademicInitiative ());
3002
+ return ret ;
3003
+ }
2988
3004
2989
3005
}
0 commit comments