|
28 | 28 | import org.springframework.beans.factory.annotation.Autowired; |
29 | 29 | import org.springframework.stereotype.Service; |
30 | 30 | import org.unitime.localization.impl.Localization; |
| 31 | +import org.unitime.localization.messages.CourseMessages; |
31 | 32 | import org.unitime.localization.messages.ExaminationMessages; |
| 33 | +import org.unitime.timetable.defaults.ApplicationProperty; |
32 | 34 | import org.unitime.timetable.export.CSVPrinter; |
33 | 35 | import org.unitime.timetable.export.ExportHelper; |
34 | 36 | import org.unitime.timetable.export.Exporter; |
|
56 | 58 | @Service("org.unitime.timetable.export.Exporter:offerings.csv") |
57 | 59 | public class OfferingsCSV implements Exporter { |
58 | 60 | protected static ExaminationMessages EXAM = Localization.create(ExaminationMessages.class); |
| 61 | + protected static CourseMessages COURSE = Localization.create(CourseMessages.class); |
59 | 62 |
|
60 | 63 | protected @Autowired AssignmentService<ClassAssignmentProxy> classAssignmentService; |
61 | 64 | protected @Autowired SolverService<ExamSolverProxy> examinationSolverService; |
@@ -153,15 +156,21 @@ protected List<TableInterface> getDistributions(ExportHelper helper) { |
153 | 156 | builder.setSimple(true); |
154 | 157 |
|
155 | 158 | Filter filter = new Filter(helper); |
156 | | - for (String subjectAreaId: helper.getParameter("subjectArea").split(",")) { |
157 | | - if (subjectAreaId.isEmpty()) continue; |
158 | | - SubjectArea area = SubjectAreaDAO.getInstance().get(Long.valueOf(subjectAreaId)); |
159 | | - if (area == null) continue; |
160 | | - TableInterface table = builder.getDistPrefsTableForFilter(filter, area.getUniqueId()); |
161 | | - table.setName(area.getLabel()); |
162 | | - table.setId(subjectAreaId); |
163 | | - response.add(table); |
164 | | - } |
| 159 | + if (ApplicationProperty.DistributionsSignleTable.isTrue()) { |
| 160 | + TableInterface table = builder.getDistPrefsTableForFilter(filter); |
| 161 | + table.setName(COURSE.sectionTitleDistributionPreferences()); |
| 162 | + response.add(table); |
| 163 | + } else { |
| 164 | + for (String subjectAreaId: helper.getParameter("subjectArea").split(",")) { |
| 165 | + if (subjectAreaId.isEmpty()) continue; |
| 166 | + SubjectArea area = SubjectAreaDAO.getInstance().get(Long.valueOf(subjectAreaId)); |
| 167 | + if (area == null) continue; |
| 168 | + TableInterface table = builder.getDistPrefsTableForFilter(filter, area.getUniqueId()); |
| 169 | + table.setName(area.getLabel()); |
| 170 | + table.setId(subjectAreaId); |
| 171 | + response.add(table); |
| 172 | + } |
| 173 | + } |
165 | 174 |
|
166 | 175 | return response; |
167 | 176 | } |
|
0 commit comments