Skip to content

Commit

Permalink
Add candidacy period title ACDM-1587 #resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
inesfilipe committed Jun 17, 2019
1 parent acc0332 commit b22e155
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/main/dml/fenixedu-academic.dml
Original file line number Diff line number Diff line change
Expand Up @@ -3502,6 +3502,7 @@ class caseHandling.ProcessLog {
/* Candidacies */

class period.CandidacyPeriod {
LocalizedString title;
DateTime start;
DateTime end;
}
Expand Down Expand Up @@ -3541,7 +3542,6 @@ class period.CandidacyPeriod {

class period.GenericApplicationPeriod extends period.CandidacyPeriod {
Integer periodNumber;
LocalizedString title;
LocalizedString description;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -53,9 +48,10 @@

public class OutboundMobilityCandidacyPeriod extends OutboundMobilityCandidacyPeriod_Base implements Comparable<CandidacyPeriod> {

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()) {
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -52,6 +53,7 @@ public class OutboundMobilityContextBean implements Serializable {
private SortedSet<OutboundMobilityCandidacyContestGroup> mobilityGroups =
new TreeSet<OutboundMobilityCandidacyContestGroup>();

private LocalizedString title;
private DateTime startDateTime;
private DateTime endDateTime;

Expand Down Expand Up @@ -149,6 +151,14 @@ public void setMobilityProgramsAsList(List<MobilityProgram> mobilityProgramsAsLi
this.mobilityPrograms.addAll(mobilityProgramsAsList);
}

public LocalizedString getTitle() {
return title;
}

public void setTitle(LocalizedString title) {
this.title = title;
}

public DateTime getStartDateTime() {
return startDateTime;
}
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1829,6 +1829,7 @@
</schema>

<schema name="org.fenixedu.academic.domain.mobility.outbound.OutboundMobilityCandidacyPeriod.interval" type="org.fenixedu.academic.domain.mobility.outbound.OutboundMobilityCandidacyPeriod">
<slot name="title"/>
<slot name="intervalAsString"/>
</schema>

Expand Down
10 changes: 9 additions & 1 deletion src/main/webapp/mobility/outbound/OutboundMobilityCandidacy.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@
<fr:edit id="outboundMobilityContextBeanCreateCandidacyPeriod" name="outboundMobilityContextBean"
action="/outboundMobilityCandidacy.do?method=createNewOutboundMobilityCandidacyPeriod">
<fr:schema type="org.fenixedu.academic.ui.struts.action.mobility.outbound.OutboundMobilityContextBean" bundle="ACADEMIC_OFFICE_RESOURCES">
<fr:slot name="title" bundle="ACADEMIC_OFFICE_RESOURCES" key="label.title"
validator="pt.ist.fenixWebFramework.renderers.validators.RequiredValidator"/>
<fr:slot name="startDateTime" bundle="ACADEMIC_OFFICE_RESOURCES" key="label.startDate"
validator="pt.ist.fenixWebFramework.renderers.validators.RequiredValidator"/>
<fr:slot name="endDateTime" bundle="ACADEMIC_OFFICE_RESOURCES" key="label.endDate"
Expand Down Expand Up @@ -388,6 +390,8 @@
<h3><bean:message bundle="ACADEMIC_OFFICE_RESOURCES" key="label.mobility.outbound.edit.period"/></h3>
<fr:edit id="editCandidacyPeriod" name="candidacyPeriod" action="/outboundMobilityCandidacy.do?method=editCandidacyPeriod">
<fr:schema type="org.fenixedu.academic.domain.mobility.outbound.OutboundMobilityCandidacyPeriod" bundle="ACADEMIC_OFFICE_RESOURCES">
<fr:slot name="title" bundle="ACADEMIC_OFFICE_RESOURCES" key="label.title"
validator="pt.ist.fenixWebFramework.renderers.validators.RequiredValidator"/>
<fr:slot name="start" bundle="ACADEMIC_OFFICE_RESOURCES" key="label.startDate"
validator="pt.ist.fenixWebFramework.renderers.validators.RequiredValidator"/>
<fr:slot name="end" bundle="ACADEMIC_OFFICE_RESOURCES" key="label.endDate"
Expand Down Expand Up @@ -582,7 +586,11 @@
%>
<tr>
<% if (outboundMobilityContextBean.getCandidacyPeriods().size() > 1) { %>
<td><%= contest.getOutboundMobilityCandidacyPeriod().getIntervalAsString() %></td>
<% if (contest.getOutboundMobilityCandidacyPeriod().getTitle() == null) { %>
<td><%= contest.getOutboundMobilityCandidacyPeriod().getIntervalAsString() %></td>
<% } else { %>
<td><%= contest.getOutboundMobilityCandidacyPeriod().getTitle().getContent() + "" + contest.getOutboundMobilityCandidacyPeriod().getIntervalAsString() %></td>
<% } %>
<% } %>
<% if (outboundMobilityContextBean.getMobilityGroups().size() > 1) { %>
<td>
Expand Down
16 changes: 14 additions & 2 deletions src/main/webapp/student/erasmusOutboundManagement.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,13 @@
<table style="width: 100%;"><tr>
<td>
<ul>
<li><bean:message key="label.candidacy.period"/>: <strong><%= candidacyPeriod.getIntervalAsString() %></strong></li>
<li><bean:message key="label.candidacy.period"/>: <strong>
<% if (candidacyPeriod.getTitle() == null) { %>
<%= candidacyPeriod.getIntervalAsString() %>
<% } else { %>
<%= candidacyPeriod.getTitle().getContent() + "" + candidacyPeriod.getIntervalAsString() %>
<% } %>
</strong></li>
<li>
<bean:message key="label.submitted.candidacies"/>:
<div style="margin-top: 10px; margin-left: 15px;">
Expand Down Expand Up @@ -219,7 +225,13 @@
<bean:message key="label.execution.year"/>: <%= ((ExecutionYear)candidacyPeriod.getExecutionInterval()).getNextYearsYearString() %>
</h3>
<ul>
<li><bean:message key="label.candidacy.period"/>: <%= outboundMobilityCandidacyPeriod.getIntervalAsString() %></li>
<li><bean:message key="label.candidacy.period"/>:
<% if (outboundMobilityCandidacyPeriod.getTitle() == null) { %>
<td><%= outboundMobilityCandidacyPeriod.getIntervalAsString() %></td>
<% } else { %>
<td><%= outboundMobilityCandidacyPeriod.getTitle().getContent() + "" + outboundMobilityCandidacyPeriod.getIntervalAsString() %></td>
<% } %>
</li>
<li>
<bean:message key="label.available.candidacies"/>:
<div style="margin-top: 10px; margin-left: 15px; width: 1050px;">
Expand Down

0 comments on commit b22e155

Please sign in to comment.