Skip to content

Commit

Permalink
Scheduling Subpart Detail: Classes
Browse files Browse the repository at this point in the history
- show External Id column when there is at least one classes with an external id filled in
  (instead of showing the column when there is a class with a timetable)
- show Student Schedule Note when there is at least one class with a note
  (instead of always showing the column)

Instructional Offering Detail: Configuration
- show Timetable column when there is at least one class with a timetable
  (instead of always showing the Timetable columns)
  - the checking code was there, but the results were always overidden by enabling the columns
- show External Id column when there is at least one classes with an external id filled in
  (instead of always showing the column)
- show Student Schedule Note when there is at least one class with a note
  (instead of never showing the column)
  • Loading branch information
tomas-muller committed May 6, 2024
1 parent 76d16b5 commit b456b1d
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,30 @@ public void htmlTableForClasses(ClassAssignmentProxy classAssignment, ExamAssign
columnList.add(MSG.columnPreferences());
columnList.add(MSG.columnInstructor());
columnList.add(MSG.columnTimetable());
columnList.add(MSG.columnSchedulePrintNote());
// columnList.add(MSG.columnSchedulePrintNote());
if (LearningManagementSystemInfo.isLmsInfoDefinedForSession(co.getInstructionalOffering().getSessionId())) {
columnList.add(MSG.columnLms());
}
setVisibleColumns(columnList);

// Show the External Id column when there is at least one class with an external id filled in
for (Iterator i=classes.iterator();i.hasNext();) {
Class_ clazz = (Class_)i.next();
String divSec = (isShowOriginalDivSecs() ? clazz.getClassSuffix() : clazz.getClassSuffix(co));
if (divSec != null && !divSec.isEmpty()) {
setShowDivSec(true);
break;
}
}

// Show schedule print note when there is a class with a note filled in
for (Iterator i=classes.iterator();i.hasNext();) {
Class_ clazz = (Class_)i.next();
if (clazz.getSchedulePrintNote() != null && !clazz.getSchedulePrintNote().trim().isEmpty()) {
setShowSchedulePrintNote(true);
break;
}
}

if (isShowTimetable()) {
boolean hasTimetable = false;
Expand All @@ -235,7 +254,6 @@ public void htmlTableForClasses(ClassAssignmentProxy classAssignment, ExamAssign
} catch (Exception e) {}
}
setDisplayTimetable(hasTimetable);
setShowDivSec(hasTimetable);
}
setUserSettings(context.getUser());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,37 +179,6 @@ private void htmlTableForInstructionalOfferingConfig(

this.setDisplayDistributionPrefs(false);

if (isShowTimetable()) {
boolean hasTimetable = false;
if (context.hasPermission(Right.ClassAssignments) && classAssignment != null) {
try {
if (classAssignment instanceof CachedClassAssignmentProxy) {
Vector allClasses = new Vector();
for (Iterator k=ioc.getSchedulingSubparts().iterator();!hasTimetable && k.hasNext();) {
SchedulingSubpart ss = (SchedulingSubpart)k.next();
for (Iterator l=ss.getClasses().iterator();l.hasNext();) {
Class_ clazz = (Class_)l.next();
allClasses.add(clazz);
}
}
((CachedClassAssignmentProxy)classAssignment).setCache(allClasses);
hasTimetable = !classAssignment.getAssignmentTable(allClasses).isEmpty();
} else {
for (Iterator k=ioc.getSchedulingSubparts().iterator();!hasTimetable && k.hasNext();) {
SchedulingSubpart ss = (SchedulingSubpart)k.next();
for (Iterator l=ss.getClasses().iterator();l.hasNext();) {
Class_ clazz = (Class_)l.next();
if (classAssignment.getAssignment(clazz)!=null) {
hasTimetable = true; break;
}
}
}
}
} catch (Exception e) {}
}
setDisplayTimetable(hasTimetable);
}

if (getDisplayConfigOpButtons()) {
try {
outputStream.write(this.buttonsTable(ioc, context));
Expand Down Expand Up @@ -244,13 +213,57 @@ private void htmlTableForInstructionalOfferingConfig(
}
}
setVisibleColumns(columnList);

if (isShowTimetable()) {
boolean hasTimetable = false;
if (context.hasPermission(Right.ClassAssignments) && classAssignment != null) {
try {
if (classAssignment instanceof CachedClassAssignmentProxy) {
Vector allClasses = new Vector();
for (Iterator k=ioc.getSchedulingSubparts().iterator();!hasTimetable && k.hasNext();) {
SchedulingSubpart ss = (SchedulingSubpart)k.next();
for (Iterator l=ss.getClasses().iterator();l.hasNext();) {
Class_ clazz = (Class_)l.next();
allClasses.add(clazz);
}
}
((CachedClassAssignmentProxy)classAssignment).setCache(allClasses);
hasTimetable = !classAssignment.getAssignmentTable(allClasses).isEmpty();
} else {
for (Iterator k=ioc.getSchedulingSubparts().iterator();!hasTimetable && k.hasNext();) {
SchedulingSubpart ss = (SchedulingSubpart)k.next();
for (Iterator l=ss.getClasses().iterator();l.hasNext();) {
Class_ clazz = (Class_)l.next();
if (classAssignment.getAssignment(clazz)!=null) {
hasTimetable = true; break;
}
}
}
}
} catch (Exception e) {}
}
setDisplayTimetable(hasTimetable);
}

// Show the External Id column when there is at least one class with an external id filled in
// Show schedule print note when there is a class with a note filled in
boolean hasDivSec = false;
boolean hasSchedulePrintNote = false;
boolean hasInstructorAssignments = false;
ss: for (SchedulingSubpart ss: ioc.getSchedulingSubparts()) {
if (ss.isInstructorAssignmentNeeded()) { hasInstructorAssignments = true; break; }
for (Class_ c: ss.getClasses())
if (c.isInstructorAssignmentNeeded()) { hasInstructorAssignments = true; break ss; }
CourseOffering co = ioc.getInstructionalOffering().getControllingCourseOffering();
for (SchedulingSubpart ss: ioc.getSchedulingSubparts()) {
if (ss.isInstructorAssignmentNeeded()) hasInstructorAssignments = true;
for (Class_ c: ss.getClasses()) {
String divSec = (isShowOriginalDivSecs() ? c.getClassSuffix() : c.getClassSuffix(co));
if (divSec != null && !divSec.isEmpty()) hasDivSec = true;
if (c.getSchedulePrintNote() != null && !c.getSchedulePrintNote().trim().isEmpty()) hasSchedulePrintNote = true;
if (c.isInstructorAssignmentNeeded()) hasInstructorAssignments = true;
}
}
setShowDivSec(hasDivSec);
setShowSchedulePrintNote(hasSchedulePrintNote);
setShowInstructorAssignment(hasInstructorAssignments);

setDisplayInstructorPrefs(false);
ClassDurationType dtype = ioc.getEffectiveDurationType();
TableStream configTable = this.initTable(outputStream, context.getUser().getCurrentAcademicSessionId(), dtype == null ? MSG.columnMinPerWk() : dtype.getLabel());
Expand Down
20 changes: 20 additions & 0 deletions WebContent/help/Release-Notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,26 @@
</line>
</description>
</item>
<item>
<name>Scheduling Subpart Detail: Classes</name>
<description>
<line>Show External Id column when there is at least one classes with an external id filled in
(instead of showing the column when there is a class with a timetable).</line>
<line>Show Student Schedule Note when there is at least one class with a note
(instead of always showing the column).</line>
</description>
</item>
<item>
<name>Instructional Offering Detail: Configuration</name>
<description>
<line>Show Timetable column when there is at least one class with a timetable
(instead of always showing the Timetable columns).</line>
<line>Show External Id column when there is at least one classes with an external id filled in
(instead of always showing the column).</line>
<line>Show Student Schedule Note when there is at least one class with a note
(instead of never showing the column).</line>
</description>
</item>
</category>
<category>
<title>Student Scheduling</title>
Expand Down

0 comments on commit b456b1d

Please sign in to comment.