Example #1
0
  @Atomic
  public static void remove(final ThesisEvaluationParticipant thesisEvaluationParticipant) {
    final Thesis thesis = thesisEvaluationParticipant.getThesis();
    if (!AccessControl.getPerson().hasRole(RoleType.SCIENTIFIC_COUNCIL)) {
      thesis.checkIsScientificCommission();
    }
    final ThesisParticipationType type = thesisEvaluationParticipant.getType();
    thesisEvaluationParticipant.delete();

    if (!thesis.isCreditsDistributionNeeded()) {
      thesis.setCoorientatorCreditsDistribution(null);
    }
  }
Example #2
0
  @Override
  protected Collection<Person> getReceivers(Thesis thesis) {
    Person student = thesis.getStudent().getPerson();
    Person orientator = thesis.getOrientator().getPerson();
    Person coorientator = getPerson(thesis.getCoorientator());
    Person president = getPerson(thesis.getPresident());

    Set<Person> persons = personSet(student, orientator, coorientator, president);
    for (ThesisEvaluationParticipant participant : thesis.getVowels()) {
      persons.add(participant.getPerson());
    }

    // also send proposal approval to the contact team
    ExecutionYear executionYear = thesis.getEnrolment().getExecutionYear();
    for (ScientificCommission member :
        thesis.getDegree().getScientificCommissionMembers(executionYear)) {
      if (member.isContact()) {
        persons.add(member.getPerson());
      }
    }

    return persons;
  }
Example #3
0
 private String affiliation(ThesisEvaluationParticipant participant) {
   return participant == null ? null : participant.getAffiliation();
 }
Example #4
0
 private String name(ThesisEvaluationParticipant participant) {
   return participant == null ? null : participant.getPersonName();
 }
Example #5
0
  protected Set<Teacher> getTeachers(List<ExecutionSemester> executionSemesters) {
    Set<Teacher> teachers = new HashSet<Teacher>();
    ExecutionYear previousExecutionYear =
        executionSemester.getExecutionYear().getPreviousExecutionYear();
    for (final DegreeCurricularPlan degreeCurricularPlan : degree.getDegreeCurricularPlansSet()) {
      for (final CurricularCourse course : degreeCurricularPlan.getCurricularCourses()) {
        for (final ExecutionCourse executionCourse : course.getAssociatedExecutionCourses()) {
          if (executionSemesters.contains(executionCourse.getExecutionPeriod())) {
            for (Professorship professorhip : executionCourse.getProfessorshipsSet()) {
              if (professorhip
                  .getPerson()
                  .getTeacher()
                  .isActiveOrHasAuthorizationForSemester(executionCourse.getExecutionPeriod())) {
                teachers.add(professorhip.getPerson().getTeacher());
              }
            }
          }
          if (previousExecutionYear.equals(
              executionCourse.getExecutionPeriod().getExecutionYear())) {
            if (executionCourse.isDissertation()) {
              for (Attends attends : executionCourse.getAttends()) {
                if (attends.hasEnrolment() && attends.getEnrolment().getThesis() != null) {
                  for (ThesisEvaluationParticipant thesisEvaluationParticipant :
                      attends.getEnrolment().getThesis().getOrientation()) {
                    if (thesisEvaluationParticipant.getPerson().getTeacher() != null
                        && thesisEvaluationParticipant
                            .getPerson()
                            .getTeacher()
                            .isActiveOrHasAuthorizationForSemester(
                                executionCourse.getExecutionPeriod())) {
                      teachers.add(thesisEvaluationParticipant.getPerson().getTeacher());
                    }
                  }
                }
              }
            }
          }
        }
      }
    }

    PhdProgram phdProgram = degree.getPhdProgram();
    if (phdProgram != null) {
      for (PhdIndividualProgramProcess phdIndividualProgramProcess :
          phdProgram.getIndividualProgramProcesses()) {
        for (ExecutionSemester executionSemester : executionSemesters) {
          if (phdIndividualProgramProcess.isActive(
              executionSemester.getAcademicInterval().toInterval())) {
            for (PhdParticipant phdParticipant : phdIndividualProgramProcess.getParticipants()) {
              if (phdParticipant instanceof InternalPhdParticipant) {
                InternalPhdParticipant internalPhdParticipant =
                    (InternalPhdParticipant) phdParticipant;
                if (internalPhdParticipant.isGuidingOrAssistantGuiding()
                    && internalPhdParticipant.getPerson().getTeacher() != null
                    && internalPhdParticipant
                        .getPerson()
                        .getTeacher()
                        .isActiveOrHasAuthorizationForSemester(executionSemester)) {
                  teachers.add(internalPhdParticipant.getPerson().getTeacher());
                }
              }
            }
          }
        }
      }
    }
    return teachers;
  }
Example #6
0
  private String getTeachersAndTeachingHours(CurricularCourse course, boolean responsibleTeacher) {
    Map<Teacher, Double> responsiblesMap = new HashMap<Teacher, Double>();
    List<ExecutionSemester> executionSemesters = getSelectedExecutionSemesters();
    for (final ExecutionCourse executionCourse : course.getAssociatedExecutionCourses()) {
      if (executionSemesters.contains(executionCourse.getExecutionPeriod())) {
        for (Professorship professorhip : executionCourse.getProfessorshipsSet()) {
          if (professorhip.isResponsibleFor() == responsibleTeacher
              && professorhip
                  .getPerson()
                  .getTeacher()
                  .isActiveOrHasAuthorizationForSemester(executionCourse.getExecutionPeriod())) {
            Double hours = responsiblesMap.get(professorhip.getTeacher());
            if (hours == null) {
              hours = 0.0;
            }
            hours = hours + getHours(professorhip);
            responsiblesMap.put(professorhip.getTeacher(), hours);
          }
        }
      }
    }
    int counter = 1000;
    List<String> responsibles = new ArrayList<String>();
    for (Teacher teacher : responsiblesMap.keySet()) {
      String responsible =
          teacher.getPerson().getName() + " (" + responsiblesMap.get(teacher) + ")";
      counter -= JSONObject.escape(responsible + ", ").getBytes().length;
      responsibles.add(responsible);
    }

    if (!responsibleTeacher && course.isDissertation()) {
      Set<Teacher> teachers = new HashSet<Teacher>();
      for (ExecutionCourse executionCourse : course.getAssociatedExecutionCoursesSet()) {
        if (executionCourse
            .getExecutionPeriod()
            .getExecutionYear()
            .equals(executionSemester.getExecutionYear().getPreviousExecutionYear())) {
          for (Attends attends : executionCourse.getAttends()) {
            if (attends.hasEnrolment() && attends.getEnrolment().getThesis() != null) {
              for (ThesisEvaluationParticipant thesisEvaluationParticipant :
                  attends.getEnrolment().getThesis().getOrientation()) {
                if (thesisEvaluationParticipant.getPerson().getTeacher() != null
                    && thesisEvaluationParticipant
                        .getPerson()
                        .getTeacher()
                        .isActiveOrHasAuthorizationForSemester(
                            executionCourse.getExecutionPeriod())) {
                  teachers.add(thesisEvaluationParticipant.getPerson().getTeacher());
                }
              }
            }
          }
        }
      }
      for (Teacher teacher : teachers) {
        String responsible = teacher.getPerson().getName() + " (0.0)";
        if (counter - JSONObject.escape(responsible).getBytes().length < 0) {
          break;
        }
        if (!responsiblesMap.containsKey(teacher)) {
          counter -= JSONObject.escape(responsible + ", ").getBytes().length;
          responsibles.add(responsible);
        }
      }
    }

    return StringUtils.join(responsibles, ", ");
  }