From b22e155f0d769f632c960a2692dba40afd845a2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?In=C3=AAs=20Filipe?= Date: Mon, 17 Jun 2019 11:56:14 +0100 Subject: [PATCH] Add candidacy period title ACDM-1587 #resolve --- src/main/dml/fenixedu-academic.dml | 2 +- .../OutboundMobilityCandidacyPeriod.java | 16 ++++++---------- .../outbound/OutboundMobilityContextBean.java | 12 +++++++++++- .../resources/AcademicAdminOffice_en.properties | 1 + .../resources/AcademicAdminOffice_pt.properties | 1 + .../schemas/academicAdminOffice-schemas.xml | 1 + .../outbound/OutboundMobilityCandidacy.jsp | 10 +++++++++- .../webapp/student/erasmusOutboundManagement.jsp | 16 ++++++++++++++-- 8 files changed, 44 insertions(+), 15 deletions(-) diff --git a/src/main/dml/fenixedu-academic.dml b/src/main/dml/fenixedu-academic.dml index dffa283f709..eefdb6223a0 100644 --- a/src/main/dml/fenixedu-academic.dml +++ b/src/main/dml/fenixedu-academic.dml @@ -3502,6 +3502,7 @@ class caseHandling.ProcessLog { /* Candidacies */ class period.CandidacyPeriod { + LocalizedString title; DateTime start; DateTime end; } @@ -3541,7 +3542,6 @@ class period.CandidacyPeriod { class period.GenericApplicationPeriod extends period.CandidacyPeriod { Integer periodNumber; - LocalizedString title; LocalizedString description; } diff --git a/src/main/java/org/fenixedu/academic/domain/mobility/outbound/OutboundMobilityCandidacyPeriod.java b/src/main/java/org/fenixedu/academic/domain/mobility/outbound/OutboundMobilityCandidacyPeriod.java index 469c1755989..4e3c5db99c3 100644 --- a/src/main/java/org/fenixedu/academic/domain/mobility/outbound/OutboundMobilityCandidacyPeriod.java +++ b/src/main/java/org/fenixedu/academic/domain/mobility/outbound/OutboundMobilityCandidacyPeriod.java @@ -19,13 +19,7 @@ package org.fenixedu.academic.domain.mobility.outbound; import java.math.BigDecimal; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.SortedSet; -import java.util.TreeSet; +import java.util.*; import org.fenixedu.academic.domain.Country; import org.fenixedu.academic.domain.ExecutionDegree; @@ -43,6 +37,7 @@ import org.fenixedu.academic.util.Bundle; import org.fenixedu.bennu.core.domain.Bennu; import org.fenixedu.bennu.core.i18n.BundleUtil; +import org.fenixedu.commons.i18n.LocalizedString; import org.fenixedu.commons.spreadsheet.Spreadsheet; import org.fenixedu.commons.spreadsheet.Spreadsheet.Row; import org.joda.time.DateTime; @@ -53,9 +48,10 @@ public class OutboundMobilityCandidacyPeriod extends OutboundMobilityCandidacyPeriod_Base implements Comparable { - public OutboundMobilityCandidacyPeriod(final ExecutionInterval executionInterval, final DateTime start, final DateTime end) { + public OutboundMobilityCandidacyPeriod(final ExecutionInterval executionInterval, final LocalizedString title, final DateTime start, final DateTime end) { super(); init(executionInterval, start, end); + setTitle(title); final OutboundMobilityCandidacyPeriod previousPeriod = findPreviousPeriod(); for (final OutboundMobilityCandidacyContestGroup group : previousPeriod.getOutboundMobilityCandidacyContestGroupSet()) { @@ -80,9 +76,9 @@ public OutboundMobilityCandidacyPeriod(final ExecutionInterval executionInterval } @Atomic - public static OutboundMobilityCandidacyPeriod create(final ExecutionInterval executionInterval, final DateTime start, + public static OutboundMobilityCandidacyPeriod create(final ExecutionInterval executionInterval, final LocalizedString title, final DateTime start, final DateTime end) { - return new OutboundMobilityCandidacyPeriod(executionInterval, start, end); + return new OutboundMobilityCandidacyPeriod(executionInterval, title, start, end); } @Atomic diff --git a/src/main/java/org/fenixedu/academic/ui/struts/action/mobility/outbound/OutboundMobilityContextBean.java b/src/main/java/org/fenixedu/academic/ui/struts/action/mobility/outbound/OutboundMobilityContextBean.java index 8b8c35f401e..bb4ad387c61 100644 --- a/src/main/java/org/fenixedu/academic/ui/struts/action/mobility/outbound/OutboundMobilityContextBean.java +++ b/src/main/java/org/fenixedu/academic/ui/struts/action/mobility/outbound/OutboundMobilityContextBean.java @@ -33,6 +33,7 @@ import org.fenixedu.academic.domain.period.CandidacyPeriod_Base; import org.fenixedu.academic.util.Bundle; import org.fenixedu.bennu.core.i18n.BundleUtil; +import org.fenixedu.commons.i18n.LocalizedString; import org.joda.time.DateTime; import pt.ist.fenixframework.Atomic; import pt.ist.fenixframework.FenixFramework; @@ -52,6 +53,7 @@ public class OutboundMobilityContextBean implements Serializable { private SortedSet mobilityGroups = new TreeSet(); + private LocalizedString title; private DateTime startDateTime; private DateTime endDateTime; @@ -149,6 +151,14 @@ public void setMobilityProgramsAsList(List mobilityProgramsAsLi this.mobilityPrograms.addAll(mobilityProgramsAsList); } + public LocalizedString getTitle() { + return title; + } + + public void setTitle(LocalizedString title) { + this.title = title; + } + public DateTime getStartDateTime() { return startDateTime; } @@ -167,7 +177,7 @@ public void setEndDateTime(DateTime endDateTime) { public void createNewOutboundMobilityCandidacyPeriod() { final OutboundMobilityCandidacyPeriod candidacyPeriod = - OutboundMobilityCandidacyPeriod.create(getExecutionYear(), getStartDateTime(), getEndDateTime()); + OutboundMobilityCandidacyPeriod.create(getExecutionYear(), getTitle(), getStartDateTime(), getEndDateTime()); candidacyPeriods.add(candidacyPeriod); } diff --git a/src/main/resources/resources/AcademicAdminOffice_en.properties b/src/main/resources/resources/AcademicAdminOffice_en.properties index 03a84742405..ffe01b401b5 100644 --- a/src/main/resources/resources/AcademicAdminOffice_en.properties +++ b/src/main/resources/resources/AcademicAdminOffice_en.properties @@ -2138,6 +2138,7 @@ label.thirdCycle.conclusionDate = Conclusion Date (3rd Cycle) label.thirdCycle.conclusionYear = Year of Conclusion Process (3rd Cycle) label.thirdCycle.ects = ECTS completed (3rd cycle) label.thirdCycle.hasConclusionProcess = Calculated? (3rd cycle) +label.title = Title label.title.ExternalRegistrationData = Registration External Data label.title.RegistrationState = Registration State label.title.deleteActualInfo = Clear Registration diff --git a/src/main/resources/resources/AcademicAdminOffice_pt.properties b/src/main/resources/resources/AcademicAdminOffice_pt.properties index 78f5c116c2f..23f364385b2 100644 --- a/src/main/resources/resources/AcademicAdminOffice_pt.properties +++ b/src/main/resources/resources/AcademicAdminOffice_pt.properties @@ -2136,6 +2136,7 @@ label.thirdCycle.conclusionDate = Data de Conclusão (3º Ciclo) label.thirdCycle.conclusionYear = Ano do Apuramento (3º Ciclo) label.thirdCycle.ects = ECTS concluídos (3º Ciclo) label.thirdCycle.hasConclusionProcess = Apurado? (3º Ciclo) +label.title = Designação label.title.ExternalRegistrationData = Dados Externos da Matrícula label.title.RegistrationState = Estado da Matrícula label.title.deleteActualInfo = Limpar Matrícula diff --git a/src/main/webapp/WEB-INF/fenixedu-academic/schemas/academicAdminOffice-schemas.xml b/src/main/webapp/WEB-INF/fenixedu-academic/schemas/academicAdminOffice-schemas.xml index 0bc40769515..2cf5a6f3408 100644 --- a/src/main/webapp/WEB-INF/fenixedu-academic/schemas/academicAdminOffice-schemas.xml +++ b/src/main/webapp/WEB-INF/fenixedu-academic/schemas/academicAdminOffice-schemas.xml @@ -1829,6 +1829,7 @@ + diff --git a/src/main/webapp/mobility/outbound/OutboundMobilityCandidacy.jsp b/src/main/webapp/mobility/outbound/OutboundMobilityCandidacy.jsp index 063bca9133a..6025173a8c1 100644 --- a/src/main/webapp/mobility/outbound/OutboundMobilityCandidacy.jsp +++ b/src/main/webapp/mobility/outbound/OutboundMobilityCandidacy.jsp @@ -293,6 +293,8 @@ + + <% if (outboundMobilityContextBean.getCandidacyPeriods().size() > 1) { %> - <%= contest.getOutboundMobilityCandidacyPeriod().getIntervalAsString() %> + <% if (contest.getOutboundMobilityCandidacyPeriod().getTitle() == null) { %> + <%= contest.getOutboundMobilityCandidacyPeriod().getIntervalAsString() %> + <% } else { %> + <%= contest.getOutboundMobilityCandidacyPeriod().getTitle().getContent() + " – " + contest.getOutboundMobilityCandidacyPeriod().getIntervalAsString() %> + <% } %> <% } %> <% if (outboundMobilityContextBean.getMobilityGroups().size() > 1) { %> diff --git a/src/main/webapp/student/erasmusOutboundManagement.jsp b/src/main/webapp/student/erasmusOutboundManagement.jsp index 0f53ba72f24..f9078f2e928 100644 --- a/src/main/webapp/student/erasmusOutboundManagement.jsp +++ b/src/main/webapp/student/erasmusOutboundManagement.jsp @@ -101,7 +101,13 @@ + <% } else { %> + + <% } %> +
  • :
    • -
    • : <%= candidacyPeriod.getIntervalAsString() %>
    • +
    • : + <% if (candidacyPeriod.getTitle() == null) { %> + <%= candidacyPeriod.getIntervalAsString() %> + <% } else { %> + <%= candidacyPeriod.getTitle().getContent() + " – " + candidacyPeriod.getIntervalAsString() %> + <% } %> +
    • :
      @@ -219,7 +225,13 @@ : <%= ((ExecutionYear)candidacyPeriod.getExecutionInterval()).getNextYearsYearString() %>
        -
      • : <%= outboundMobilityCandidacyPeriod.getIntervalAsString() %>
      • +
      • : + <% if (outboundMobilityCandidacyPeriod.getTitle() == null) { %> +
    <%= outboundMobilityCandidacyPeriod.getIntervalAsString() %><%= outboundMobilityCandidacyPeriod.getTitle().getContent() + " – " + outboundMobilityCandidacyPeriod.getIntervalAsString() %>