Package org.fenixedu.academic.domain

Examples of org.fenixedu.academic.domain.Shift


            HttpServletResponse response) {

        String executionCourseID = request.getParameter("executionCourseID");
        String shiftID = request.getParameter("shiftID");

        Shift shift = FenixFramework.getDomainObject(shiftID);
        ExecutionCourse executionCourse = FenixFramework.getDomainObject(executionCourseID);

        for (Registration registration : shift.getStudentsSet()) {
            shift.removeAttendFromShift(registration, executionCourse);
        }

        request.setAttribute("shift", shift);
        request.setAttribute("executionCourseID", executionCourseID);
        request.setAttribute("registrations", shift.getStudentsSet());
        request.setAttribute("personBean", new PersonBean());

        return forward(request, "/teacher/executionCourse/editShift.jsp");
    }
View Full Code Here


            HttpServletResponse response) throws Exception {

        DynaActionForm manageLessonForm = (DynaActionForm) form;

        InfoShift infoShift = (InfoShift) request.getAttribute(PresentationConstants.SHIFT);
        Shift shift = FenixFramework.getDomainObject(infoShift.getExternalId());
        GenericPair<YearMonthDay, YearMonthDay> maxLessonsPeriod = shift.getExecutionCourse().getMaxLessonsPeriod();

        if (maxLessonsPeriod != null) {
            request.setAttribute("executionDegreeLessonsStartDate", maxLessonsPeriod.getLeft().toString("dd/MM/yyyy"));
            request.setAttribute("executionDegreeLessonsEndDate", maxLessonsPeriod.getRight().toString("dd/MM/yyyy"));
            manageLessonForm.set("newBeginDate", maxLessonsPeriod.getLeft().toString("dd/MM/yyyy"));
View Full Code Here

            InfoLesson infoLesson = (InfoLesson) request.getAttribute(PresentationConstants.LESSON);
            InfoShift infoShift = (InfoShift) request.getAttribute(PresentationConstants.SHIFT);

            String action = request.getParameter("action");

            final Shift shift;
            if (action != null && action.equals("edit")) {
                final Lesson lesson = FenixFramework.getDomainObject(infoLesson.getExternalId());
                shift = lesson.getShift();
            } else {
                shift = FenixFramework.getDomainObject(infoShift.getExternalId());
            }
            final GenericPair<YearMonthDay, YearMonthDay> maxLessonsPeriod = shift.getExecutionCourse().getMaxLessonsPeriod();

            YearMonthDay lessonNewBeginDate = getDateFromForm(manageLessonForm, "newBeginDate");
            YearMonthDay lessonEndDate = getDateFromForm(manageLessonForm, "newEndDate");

            List<InfoRoom> emptyRoomsList = null;
View Full Code Here

    }

    private List<Shift> readShiftsToEnrolFrom(SchoolClass schoolClass, List<String> shiftNames, List<String> errorLog) {
        final List<Shift> result = new ArrayList<Shift>();
        for (final String shiftName : shiftNames) {
            Shift shift = readShiftFrom(schoolClass, shiftName);
            if (shift == null) {
                errorLog.add(new StringBuilder("Não existe nenhum turno: '").append(shiftName).append("' associado à aula: '")
                        .append(schoolClass.getNome()).append("'.").toString());
                shift = readShiftByName(shiftName);
                if (shift == null) {
View Full Code Here

        final IViewState viewState = RenderUtils.getViewState();
        ShowSummariesBean bean = (ShowSummariesBean) viewState.getMetaObject().getObject();

        ExecutionCourse executionCourse = bean.getExecutionCourse();
        ShiftType shiftType = bean.getShiftType();
        Shift shift = bean.getShift();

        SummaryTeacherBean summaryTeacher = bean.getSummaryTeacher();
        Professorship teacher = (summaryTeacher != null) ? summaryTeacher.getProfessorship() : null;
        Boolean otherTeachers = (summaryTeacher != null) ? summaryTeacher.getOthers() : null;
        SummariesOrder summariesOrder = bean.getSummariesOrder();
View Full Code Here

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

        final IViewState viewState = RenderUtils.getViewState();
        SummariesCalendarBean bean = (SummariesCalendarBean) viewState.getMetaObject().getObject();

        ExecutionCourse executionCourse = bean.getExecutionCourse();
        Shift shift = bean.getShift();
        ShiftType shiftType = bean.getShiftType();
        LessonCalendarViewType calendarViewType = bean.getCalendarViewType();

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

        for (Lesson lesson : executionCourse.getLessons()) {

            boolean insert = true;
            if ((shift != null && !shift.getAssociatedLessonsSet().contains(lesson))
                    || (shiftType != null && !lesson.getShift().containsType(shiftType))) {
                insert = false;
            }

            if (insert) {
View Full Code Here

public class ShiftLessonsToSummariesManagementProvider implements DataProvider {

    @Override
    public Object provide(Object source, Object currentValue) {
        SummariesManagementBean bean = (SummariesManagementBean) source;
        Shift shift = bean.getShift();
        SummaryType summaryType = bean.getSummaryType();
        Set<Lesson> lessons = new TreeSet<Lesson>(Lesson.LESSON_COMPARATOR_BY_WEEKDAY_AND_STARTTIME);
        if (shift != null && summaryType != null && summaryType.equals(SummaryType.NORMAL_SUMMARY)) {
            lessons.addAll(shift.getAssociatedLessonsSet());
        }
        return lessons;
    }
View Full Code Here

        SortedSet<Shift> shifts = executionCourse.getShiftsOrderedByLessons();

        ArrayList<InfoShift> shiftsList = new ArrayList<InfoShift>();
        if (shifts.size() != 0) {
            InfoShift infoShift;
            Shift shift;
            Iterator<Shift> iter = shifts.iterator();

            while (iter.hasNext()) {
                shift = iter.next();
                if (shift.containsType(shiftType)) {
                    infoShift = new InfoShift(shift);
                    shiftsList.add(infoShift);
                }
            }
            return shiftsList;
View Full Code Here

        Grouping grouping = FenixFramework.getDomainObject(groupPropertiesCode);
        if (grouping == null) {
            return null;
        }

        Shift shift = FenixFramework.getDomainObject(shiftCode);

        List<InfoSiteGroupsByShift> infoSiteGroupsByShiftList = new ArrayList<InfoSiteGroupsByShift>();
        InfoSiteShift infoSiteShift = new InfoSiteShift();
        infoSiteShift.setInfoShift(InfoShift.newInfoFromDomain(shift));

        List allStudentGroups = grouping.readAllStudentGroupsBy(shift);

        if (grouping.getDifferentiatedCapacity()) {
            Integer vagas = shift.getShiftGroupingProperties().getCapacity();
            infoSiteShift.setNrOfGroups(vagas);
        } else {
            if (grouping.getGroupMaximumNumber() != null) {
                int vagas = grouping.getGroupMaximumNumber().intValue() - allStudentGroups.size();
                infoSiteShift.setNrOfGroups(Integer.valueOf(vagas));
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.domain.Shift

Copyright © 2018 www.massapicom. 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.