Skip to content

Commit

Permalink
Merge branch 'A2-1144-RFC-Innovations-Section' into aiccra-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
MetalPrime committed Feb 7, 2025
2 parents 412ded2 + e648647 commit 24c7b12
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,25 @@ public String getComposedNameLoc() {
return this.getName();
}

public String getComposedNameType() {
if (this.getAcronym() != null) {
if (this.getAcronym().length() != 0) {
try {
String type = "";
if (this.getInstitutionType() != null && this.getInstitutionType().getName() != null) {
type = " (" + this.getInstitutionType().getName() + ")";
}
return this.getAcronym() + " - " + this.getName() + type;
} catch (Exception e) {
return this.getName();
}

}
}
return this.getName();

}

public Set<CrpPpaPartner> getCrpPpaPartners() {
return crpPpaPartners;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import org.cgiar.ccafs.marlo.data.model.Project;
import org.cgiar.ccafs.marlo.data.model.ProjectInnovation;
import org.cgiar.ccafs.marlo.data.model.ProjectInnovationActor;
import org.cgiar.ccafs.marlo.data.model.ProjectInnovationAllianceOrganization;
import org.cgiar.ccafs.marlo.data.model.ProjectInnovationCenter;
import org.cgiar.ccafs.marlo.data.model.ProjectInnovationGeographicScope;
import org.cgiar.ccafs.marlo.data.model.ProjectInnovationInfo;
Expand Down Expand Up @@ -637,20 +636,22 @@ public void validateGeneralInformation(BaseAction action, Project project, Proje
try {
if (projectInnovation.getAllianceOrganizations() != null
&& !projectInnovation.getAllianceOrganizations().isEmpty()) {
int count = 0;
for (ProjectInnovationAllianceOrganization allianceOrganizations : projectInnovation
.getAllianceOrganizations()) {
if (allianceOrganizations.getInstitutionType() == null
|| allianceOrganizations.getInstitutionType().getId() == null
|| allianceOrganizations.getInstitutionType().getId() == -1) {
action.addMessage(action.getText("innovation.allianceOrganizations[" + count + "].institutionType.id"));
action.addMissingField("innovation.allianceOrganizations[" + count + "].institutionType.id");
action.getInvalidFields().put("list-innovation.allianceOrganizations[" + count + "].institutionType.id",
action.getText(InvalidFieldsMessages.EMPTYLIST, new String[] {"actors"}));
}
count++;

}
// Removed 07/02/2025
/*
* int count = 0;
* for (ProjectInnovationAllianceOrganization allianceOrganizations : projectInnovation
* .getAllianceOrganizations()) {
* if (allianceOrganizations.getInstitutionType() == null
* || allianceOrganizations.getInstitutionType().getId() == null
* || allianceOrganizations.getInstitutionType().getId() == -1) {
* action.addMessage(action.getText("innovation.allianceOrganizations[" + count + "].institutionType.id"));
* action.addMissingField("innovation.allianceOrganizations[" + count + "].institutionType.id");
* action.getInvalidFields().put("list-innovation.allianceOrganizations[" + count + "].institutionType.id",
* action.getText(InvalidFieldsMessages.EMPTYLIST, new String[] {"actors"}));
* }
* count++;
* }
*/
}
} catch (Exception e) {
Log.error("error validating actors " + e);
Expand Down
1 change: 1 addition & 0 deletions marlo-web/src/main/resources/custom/aicrra.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4693,6 +4693,7 @@ projectInnovations.anticipatedUsers.actors=Actors
projectInnovations.anticipatedUsers.actors.readText=Actors
projectInnovations.anticipatedUsers.actors.help=In the context of One CGIAR, <b>youth</b> are those between 15 and 24 years old, considered key to innovation and transformation in agricultural systems.
projectInnovations.anticipatedUsers.actors.help.readText=In the context of One CGIAR, <b>youth</b> are those between 15 and 24 years old, considered key to innovation and transformation in agricultural systems.
projectInnovations.anticipatedUsers.actors.typeActor=Type of actor
projectInnovations.anticipatedUsers.actors.women=Women
projectInnovations.anticipatedUsers.actors.women.readText=Women
projectInnovations.anticipatedUsers.actors.men=Men
Expand Down
1 change: 1 addition & 0 deletions marlo-web/src/main/resources/global.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4786,6 +4786,7 @@ projectInnovations.anticipatedUsers.actors=Actors
projectInnovations.anticipatedUsers.actors.readText=Actors
projectInnovations.anticipatedUsers.actors.help=In the context of One CGIAR, <b>youth</b> are those between 15 and 24 years old, considered key to innovation and transformation in agricultural systems.
projectInnovations.anticipatedUsers.actors.help.readText=In the context of One CGIAR, <b>youth</b> are those between 15 and 24 years old, considered key to innovation and transformation in agricultural systems.
projectInnovations.anticipatedUsers.actors.typeActor=Type of actor
projectInnovations.anticipatedUsers.actors.women=Women
projectInnovations.anticipatedUsers.actors.women.readText=Women
projectInnovations.anticipatedUsers.actors.men=Men
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@
[#-- Organizations --]
<div class="col-md-6 organizationsBlock">
<label for="innovation.allianceOrganizations">[@s.text name="projectInnovations.anticipatedUsers.organizations" /]:[@customForm.req required=true /]</label>
<label class="note--2">
<p>[@s.text name="study.generalInformation.ppapartner.note"][@s.param] <a href="[@s.url namespace="/projects" action='${crpSession}/partners'][@s.param name='projectID']${(projectID)!}[/@s.param][#include "/WEB-INF/global/pages/urlGlobalParams.ftl" /][/@s.url]" target="__BLANK">&nbsp;clicking here</a>[/@][/@]</p>
</label>
[#-- list of items --]
<div class="organizationsList">
[#list (element.allianceOrganizations)![] as organization]
Expand Down Expand Up @@ -753,7 +756,7 @@
[@customForm.input name="${customName}.id" value=((element.id)?string)!"" editable=false display=false /]
[#-- Dropdown Actors - Type --]
<div class="col-md-12">
[@customForm.select name="${customName}.actor.id" showTitle=false i18nkey="projectInnovations.actors" listName="actorList" keyFieldName="id" displayFieldName="name" required=false editable=true /]
[@customForm.select name="${customName}.actor.id" i18nkey="projectInnovations.anticipatedUsers.actors.typeActor" listName="actorList" keyFieldName="id" displayFieldName="name" required=false editable=true /]
</div>

[#local sexAgeNotApply = ((element.sexAgeNotApply??) && (element.sexAgeNotApply == true))! /]
Expand Down Expand Up @@ -798,14 +801,15 @@
<div id="organizationsInnovation-${(template?string('template', ''))}" class="organizationsInnovation form-group grayBlueBox ${class}">
[#-- Hidden not saved - id --]
[@customForm.input name="${customName}.id" className="indexTag" value=((element.id)?string)!"" editable=false display=false /]
[#-- "Dropdown Organizations - Type --]
[#-- "Dropdown Organizations - Type
<div class="col-md-12">
[@customForm.select name="${customName}.institutionType.id" showTitle=false i18nkey="projectInnovations.organizations" listName="institutionTypeList" keyFieldName="id" displayFieldName="name" required=false editable=true /]
</div>
--]
[#-- Input Organization name --]
<div class="col-md-12">
<label>[@s.text name="projectInnovations.anticipatedUsers.organizations.name" /]:</label>
[@customForm.select name="${customName}.institution.id" showTitle=false i18nkey="projectInnovations.anticipatedUsers.organizations" listName="institutions" keyFieldName="id" displayFieldName="name" required=false editable=true /]
[@customForm.select name="${customName}.institution.id" showTitle=false i18nkey="projectInnovations.anticipatedUsers.organizations" listName="institutions" keyFieldName="id" displayFieldName="composedNameType" required=false editable=true /]
</div>
[#-- Checkbox - is a co-development --]
<div class="col-md-12">
Expand Down

0 comments on commit 24c7b12

Please sign in to comment.