Examples of NextPossibleSummaryLessonsAndDatesBean


Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

    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");
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

            List<NextPossibleSummaryLessonsAndDatesBean> nextPossibleLessonsDates =
                    new ArrayList<NextPossibleSummaryLessonsAndDatesBean>();

            for (String lessonRepresentation : selectedLessons) {

                NextPossibleSummaryLessonsAndDatesBean nextLesson =
                        NextPossibleSummaryLessonsAndDatesBean.getNewInstance(lessonRepresentation);
                if (nextLesson.getLesson().getShift().getCourseLoadsSet().size() == 1) {
                    nextLesson.setLessonType(nextLesson.getLesson().getShift().getCourseLoadsSet().iterator().next().getType());
                }

                nextPossibleLessonsDates.add(nextLesson);

                ShiftType lessonType = null;
                if (nextLesson.getLesson().getShift().getCourseLoadsSet().size() == 1) {
                    lessonType = nextLesson.getLesson().getShift().getCourseLoadsSet().iterator().next().getType();
                    if (shiftType == null) {
                        shiftType = lessonType;
                    } else if (!shiftType.equals(lessonType)) {
                        request.setAttribute("notShowLessonPlanningsAndSummaries", Boolean.TRUE);
                        uniqueType = false;
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

        Set<Shift> associatedShifts = executionCourse.getAssociatedShifts();

        for (Shift shift : associatedShifts) {
            for (Lesson lesson : shift.getAssociatedLessonsSet()) {
                for (YearMonthDay lessonDate : lesson.getAllLessonDates()) {
                    summariesCalendar.add(new NextPossibleSummaryLessonsAndDatesBean(lesson, lessonDate));
                }
            }
            addExtraSummariesToSummariesCalendar(summariesCalendar, shift, summariesCalendarBean.getCalendarViewType());
        }
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

                                    new HourMinuteSecond(), lessonDate))
                            || (calendarViewType.equals(LessonCalendarViewType.PAST_LESSON_WITHOUT_SUMMARY) && lesson
                                    .getSummaryByDate(lessonDate) == null)
                            && lesson.isTimeValidToInsertSummary(new HourMinuteSecond(), lessonDate)) {

                        summariesCalendar.add(new NextPossibleSummaryLessonsAndDatesBean(lesson, lessonDate));
                    }
                }
            }
        }
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

            List<Summary> extraSummaries = shift.getExtraSummaries();
            for (Summary summary : extraSummaries) {
                if (calendarViewType.equals(LessonCalendarViewType.ALL_LESSONS)
                        || (calendarViewType.equals(LessonCalendarViewType.PAST_LESSON) && summary.getSummaryDateTime()
                                .isBeforeNow())) {
                    summariesCalendar.add(new NextPossibleSummaryLessonsAndDatesBean(shift, summary.getSummaryDateYearMonthDay(),
                            summary.getSummaryHourHourMinuteSecond(), summary.getRoom()));
                }
            }
        }
    }
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

                        NextPossibleSummaryLessonsAndDatesBean.COMPARATOR_BY_DATE_AND_HOUR);
        for (Shift shift : executionCourse.getAssociatedShifts()) {
            for (Lesson lesson : shift.getAssociatedLessonsSet()) {
                YearMonthDay nextPossibleSummaryDate = lesson.getNextPossibleSummaryDate();
                if (nextPossibleSummaryDate != null) {
                    possibleLessonsAndDates.add(new NextPossibleSummaryLessonsAndDatesBean(lesson, nextPossibleSummaryDate));
                }
            }
        }
        request.setAttribute("nextPossibleLessonsDates", possibleLessonsAndDates);
    }
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

        final Set<NextPossibleSummaryLessonsAndDatesBean> lessonDatesBean =
                new TreeSet<NextPossibleSummaryLessonsAndDatesBean>(
                        NextPossibleSummaryLessonsAndDatesBean.COMPARATOR_BY_DATE_AND_HOUR);

        for (final LessonInstance instance : infoLesson.getLesson().getLessonInstancesSet()) {
            final NextPossibleSummaryLessonsAndDatesBean bean =
                    new NextPossibleSummaryLessonsAndDatesBean(lesson, instance.getDay());
            bean.setRoom(instance.getRoom());
            bean.setTime(instance.getStartTime());
            lessonDatesBean.add(bean);
        }
        if (!lesson.wasFinished()) {
            for (final YearMonthDay yearMonthDay : lesson.getAllLessonDatesWithoutInstanceDates()) {
                final NextPossibleSummaryLessonsAndDatesBean bean =
                        new NextPossibleSummaryLessonsAndDatesBean(lesson, yearMonthDay);
                bean.setRoom(lesson.getSala());
                bean.setTime(lesson.getBeginHourMinuteSecond());
                lessonDatesBean.add(bean);
            }
        }

        request.setAttribute("lessonDates", lessonDatesBean);
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

    }

    public ActionForward deleteLessonInstance(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        NextPossibleSummaryLessonsAndDatesBean bean =
                NextPossibleSummaryLessonsAndDatesBean.getNewInstance(request.getParameter("lessonDate"));

        try {
            DeleteLessonInstance.run(bean.getLesson(), bean.getDate());
            ActionErrors actionErrors = new ActionErrors();
            actionErrors.add(null, new ActionError("message.deleteLesson", bean.getDate()));
            saveErrors(request, actionErrors);
        } catch (UnsupportedOperationException unsupportedOperationException) {
            ActionErrors actionErrors = new ActionErrors();
            actionErrors.add(unsupportedOperationException.getMessage(),
                    new ActionError("error.Lesson.not.instanced", bean.getDate()));
            saveErrors(request, actionErrors);
        } catch (DomainException domainException) {
            ActionErrors actionErrors = new ActionErrors();
            actionErrors.add(domainException.getMessage(), new ActionError(domainException.getMessage()));
            saveErrors(request, actionErrors);
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

public class LessonTypesToComplexSummariesManagementProvider implements DataProvider {

    @Override
    public Object provide(Object source, Object currentValue) {
        NextPossibleSummaryLessonsAndDatesBean bean = (NextPossibleSummaryLessonsAndDatesBean) source;
        if (bean.getLesson() != null) {
            return bean.getLesson().getShift().getTypes();
        }
        return new ArrayList<ShiftType>();
    }
View Full Code Here

Examples of org.fenixedu.academic.dto.teacher.executionCourse.NextPossibleSummaryLessonsAndDatesBean

        }
    }

    @Atomic
    public static void run(final SortedSet<NextPossibleSummaryLessonsAndDatesBean> set) {
        final NextPossibleSummaryLessonsAndDatesBean last = set.last();
        final Lesson lesson = last.getLesson();
        final YearMonthDay date = last.getDate();
        lesson.refreshPeriodAndInstancesInSummaryCreation(lesson.isBiWeeklyOffset() ? date.plusDays(8) : date.plusDays(1));
        for (final NextPossibleSummaryLessonsAndDatesBean n : set) {
            run(n.getLesson(), n.getDate());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.