public ActionForward showExecutionDegrees(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    DynaValidatorForm personExecutionCourseForm = (DynaValidatorForm) form;

    String personId = (String) personExecutionCourseForm.get("teacherId");
    Person person = Person.readPersonByUsername(personId);
    setChoosedExecutionPeriod(
        request, ReadNotClosedExecutionPeriods.run(), personExecutionCourseForm);
    InfoExecutionPeriod infoExecutionPeriod =
        (InfoExecutionPeriod) request.getAttribute("infoExecutionPeriod");
    final ExecutionSemester executionPeriod = infoExecutionPeriod.getExecutionPeriod();
    if (executionPeriod.getSemester().intValue() == 2
        && executionPeriod.getExecutionYear().getYear().equals("2010/2011")) {
    } else {
      if (person.getTeacher() == null
          || (person.getTeacher().getTeacherAuthorization(executionPeriod) == null
              && !person.hasRole(RoleType.TEACHER))) {
        request.setAttribute("notAuth", true);
        return showExecutionYearExecutionPeriods(
            mapping, personExecutionCourseForm, request, response);
      }
    }

    prepareSecondStep(personExecutionCourseForm, request);
    personExecutionCourseForm.set("page", new Integer(2));
    return mapping.findForward("second-step");
  }
Пример #2
0
  @Atomic
  public static InfoDepartment run(String username) throws FenixServiceException {
    InfoDepartment infoDepartment = null;

    final Person person = Person.readPersonByUsername(username);
    final Collection<Department> departmentList = person.getManageableDepartmentCredits();
    if (!departmentList.isEmpty()) {
      infoDepartment = InfoDepartment.newInfoFromDomain(departmentList.iterator().next());
    }
    return infoDepartment;
  }
 public Person getPerson(DynaActionForm personExecutionCourseForm) {
   String id = (String) personExecutionCourseForm.get("teacherId");
   Person person = Person.readPersonByUsername(id);
   return person;
 }