public ActionForward prepareCreateComplexSummaryInSummariesCalendarMode(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws FenixActionException {
Professorship loggedProfessorship = (Professorship) request.getAttribute("loggedTeacherProfessorship");
ExecutionCourse executionCourse = (ExecutionCourse) request.getAttribute("executionCourse");
NextPossibleSummaryLessonsAndDatesBean nextSummaryDateBean = getNextSummaryDateBeanFromParameter(request);
if (!executionCourse.getLessons().contains(nextSummaryDateBean.getLesson())) {
throw new FenixActionException();
}
DynaActionForm dynaActionForm = (DynaActionForm) form;
List<NextPossibleSummaryLessonsAndDatesBean> nextPossibleLessonsDates =
new ArrayList<NextPossibleSummaryLessonsAndDatesBean>();
nextPossibleLessonsDates.add(nextSummaryDateBean);
SummariesManagementBean bean =
new SummariesManagementBean(SummariesManagementBean.SummaryType.NORMAL_SUMMARY, executionCourse,
loggedProfessorship, nextPossibleLessonsDates);
Shift shift = nextSummaryDateBean.getLesson().getShift();
if (shift.getCourseLoadsSet().size() != 1) {
request.setAttribute("notShowLessonPlanningsAndSummaries", Boolean.TRUE);
} else {
nextSummaryDateBean.setLessonType(shift.getCourseLoadsSet().iterator().next().getType());
bean.setLessonType(nextSummaryDateBean.getLessonType());
}
request.setAttribute("summariesManagementBean", bean);
dynaActionForm.set("teacher", loggedProfessorship.getExternalId().toString());
return mapping.findForward("prepareInsertComplexSummary");