コード例 #1
0
  public static void editDepartmentOfficeCreditsPeriod(
      ExecutionSemester executionSemester, DateTime begin, DateTime end) {
    TeacherCreditsFillingForDepartmentAdmOfficeCE creditsFillingCE =
        TeacherCreditsFillingForDepartmentAdmOfficeCE
            .getTeacherCreditsFillingForDepartmentAdmOffice(
                executionSemester.getAcademicInterval());

    if (creditsFillingCE == null) {

      AcademicCalendarEntry parentEntry =
          executionSemester.getAcademicInterval().getAcademicCalendarEntry();
      AcademicCalendarRootEntry rootEntry =
          executionSemester.getAcademicInterval().getAcademicCalendar();

      new TeacherCreditsFillingForDepartmentAdmOfficeCE(
          parentEntry,
          new MultiLanguageString(
              BundleUtil.getString(
                  Bundle.APPLICATION, "label.TeacherCreditsFillingCE.entry.title")),
          null,
          begin,
          end,
          rootEntry);

    } else {
      creditsFillingCE.edit(begin, end);
    }
  }
コード例 #2
0
 public static TeacherCreditsFillingCE getValidCreditsPeriod(
     ExecutionSemester executionSemester, User user) {
   if (org.fenixedu.bennu.core.groups.Group.parse("creditsManager").isMember(user)) {
     return TeacherCreditsFillingForDepartmentAdmOfficeCE
         .getTeacherCreditsFillingForDepartmentAdmOffice(executionSemester.getAcademicInterval());
   }
   if (RoleType.TEACHER.isMember(user)) {
     return TeacherCreditsFillingForTeacherCE.getTeacherCreditsFillingForTeacher(
         executionSemester.getAcademicInterval());
   }
   throw new DomainException("invalid.role.type");
 }