diff --git a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/projects/DeliverableAction.java b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/projects/DeliverableAction.java index 768fd55605..9154250aae 100644 --- a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/projects/DeliverableAction.java +++ b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/projects/DeliverableAction.java @@ -81,6 +81,7 @@ import org.cgiar.ccafs.marlo.data.manager.RepositoryChannelManager; import org.cgiar.ccafs.marlo.data.manager.ShfrmPriorityActionManager; import org.cgiar.ccafs.marlo.data.manager.ShfrmSubActionManager; +import org.cgiar.ccafs.marlo.data.manager.SoilIndicatorManager; import org.cgiar.ccafs.marlo.data.manager.UserManager; import org.cgiar.ccafs.marlo.data.model.Activity; import org.cgiar.ccafs.marlo.data.model.CgiarCrossCuttingMarker; @@ -147,6 +148,7 @@ import org.cgiar.ccafs.marlo.data.model.RepositoryChannel; import org.cgiar.ccafs.marlo.data.model.ShfrmPriorityAction; import org.cgiar.ccafs.marlo.data.model.ShfrmSubAction; +import org.cgiar.ccafs.marlo.data.model.SoilIndicator; import org.cgiar.ccafs.marlo.data.model.User; import org.cgiar.ccafs.marlo.security.Permission; import org.cgiar.ccafs.marlo.utils.APConfig; @@ -261,6 +263,7 @@ public class DeliverableAction extends BaseAction { private ShfrmSubActionManager shfrmSubActionManager; private DeliverableShfrmPriorityActionManager deliverableShfrmPriorityActionManager; private DeliverableShfrmSubActionManager deliverableShfrmSubActionManager; + private SoilIndicatorManager soilIndicatorManager; // Variables private List answers; @@ -310,6 +313,7 @@ public class DeliverableAction extends BaseAction { private String DOI; private String handle; private String disseminationURL; + private String soilIndicatorsText; private List focusLevels; @@ -363,7 +367,7 @@ public DeliverableAction(APConfig config, DeliverableTypeManager deliverableType DeliverableTraineesIndicatorManager deliverableTraineesIndicatorManager, ShfrmPriorityActionManager shfrmPriorityActionManager, ShfrmSubActionManager shfrmSubActionManager, DeliverableShfrmPriorityActionManager deliverableShfrmPriorityActionManager, - DeliverableShfrmSubActionManager deliverableShfrmSubActionManager) { + DeliverableShfrmSubActionManager deliverableShfrmSubActionManager, SoilIndicatorManager soilIndicatorManager) { super(config); this.activityManager = activityManager; this.deliverableManager = deliverableManager; @@ -429,6 +433,7 @@ public DeliverableAction(APConfig config, DeliverableTypeManager deliverableType this.shfrmSubActionManager = shfrmSubActionManager; this.deliverableShfrmPriorityActionManager = deliverableShfrmPriorityActionManager; this.deliverableShfrmSubActionManager = deliverableShfrmSubActionManager; + this.soilIndicatorManager = soilIndicatorManager; } /** @@ -450,6 +455,7 @@ public DeliverableClusterParticipant actualDeliverableClusterParticipant() { } } + @Override public String cancel() { @@ -474,6 +480,7 @@ public String cancel() { return SUCCESS; } + public Boolean candEditExpectedYear(long deliverableID) { Deliverable deliverable = deliverableManager.getDeliverableById(deliverableID); @@ -680,6 +687,27 @@ public void fillClusterParticipantsList() { } } + public void fillSoilIndicatorsText() { + try { + soilIndicatorsText = null; + List soilIndicators = soilIndicatorManager.findAll(); + if (soilIndicators != null && !soilIndicators.isEmpty()) { + for (SoilIndicator soilIndicator : soilIndicators) { + if (soilIndicator != null && soilIndicator.getIndicatorName() != null) { + if (soilIndicatorsText == null) { + soilIndicatorsText = soilIndicator.getIndicatorName(); + } else { + soilIndicatorsText.concat(", " + soilIndicator.getIndicatorName()); + } + } + + } + } + } catch (Exception e) { + Log.info("error getting soil indicators " + e); + } + } + public void fillSubActionsGeneralList() { try { if (shfrmPriorityActions != null && !shfrmPriorityActions.isEmpty()) { @@ -762,7 +790,6 @@ public List getActivities() { return activities; } - /** * Get the ID of the clusterParticipantObject for this cluster in actual phase * @@ -784,15 +811,16 @@ public long getActualClusterParticipantID() { } } - public List getAnswers() { return answers; } + public List getAnswersDataDic() { return answersDataDic; } + private Path getAutoSaveFilePath() { // get the class simple name @@ -930,20 +958,20 @@ public GlobalUnit getLoggedCrp() { return loggedCrp; } - public List getMyProjects() { return myProjects; } - public List getPartnerInstitutions() { return partnerInstitutions; } + public List getPartnerPersons() { return partnerPersons; } + public List getPartners() { return partners; } @@ -1038,6 +1066,10 @@ public List getShfrmPriorityActions() { return shfrmPriorityActions; } + public String getSoilIndicatorsText() { + return soilIndicatorsText; + } + public Map getStatus() { return status; } @@ -1586,7 +1618,7 @@ public void prepare() throws Exception { } } - + this.fillSoilIndicatorsText(); } // Expected Study Geographic Regions List @@ -4429,6 +4461,10 @@ public void setShfrmPriorityActions(List shfrmPriorityActio this.shfrmPriorityActions = shfrmPriorityActions; } + public void setSoilIndicatorsText(String soilIndicatorsText) { + this.soilIndicatorsText = soilIndicatorsText; + } + public void setStatus(Map status) { this.status = status; } diff --git a/marlo-web/src/main/resources/custom/aicrra.properties b/marlo-web/src/main/resources/custom/aicrra.properties index 1b93d1f9ff..65de7a122e 100644 --- a/marlo-web/src/main/resources/custom/aicrra.properties +++ b/marlo-web/src/main/resources/custom/aicrra.properties @@ -951,6 +951,7 @@ deliverable.shfrmContribution.priorityAction=To which priority action of the SHF deliverable.shfrmContribution.priorityAction.help=Select a priority action deliverable.shfrmContribution.subAction=To which specific sub-action of the SHFRM is this deliverable contributing to? deliverable.shfrmContribution.subAction.help=Select sub-action(s) +deliverable.shfrmContribution.indicators.help=Soil Indicator(s): intellectualAsset.fillingType=Type of filling intellectualAsset.patentStatus=Patent status diff --git a/marlo-web/src/main/resources/database/migrations/V2_6_0_20240221_1043__UpdateDeliverableInfoTable.sql b/marlo-web/src/main/resources/database/migrations/V2_6_0_20240221_1043__UpdateDeliverableInfoTable.sql new file mode 100644 index 0000000000..2169a63679 --- /dev/null +++ b/marlo-web/src/main/resources/database/migrations/V2_6_0_20240221_1043__UpdateDeliverableInfoTable.sql @@ -0,0 +1 @@ +ALTER TABLE deliverables_info MODIFY COLUMN shfrm_contribution_narrative text CHARACTER SET utf8 COLLATE utf8_general_ci NULL; \ No newline at end of file diff --git a/marlo-web/src/main/resources/global.properties b/marlo-web/src/main/resources/global.properties index cae401006b..edbb641263 100644 --- a/marlo-web/src/main/resources/global.properties +++ b/marlo-web/src/main/resources/global.properties @@ -952,6 +952,7 @@ deliverable.shfrmContribution.priorityAction=To which priority action of the SHF deliverable.shfrmContribution.priorityAction.help=Select a priority action deliverable.shfrmContribution.subAction=To which specific sub-action of the SHFRM is this deliverable contributing to? deliverable.shfrmContribution.subAction.help=Select sub-action(s) +deliverable.shfrmContribution.indicators.help=Soil Indicator(s): intellectualAsset.fillingType=Type of filling intellectualAsset.patentStatus=Patent status diff --git a/marlo-web/src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl b/marlo-web/src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl index abb8b0f8ce..d92475a8f8 100644 --- a/marlo-web/src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl +++ b/marlo-web/src/main/webapp/WEB-INF/crp/views/projects/projectStudy.ftl @@ -3,7 +3,7 @@ [#assign currentSectionString = "project-${actionName?replace('/','-')}-${expectedID}-phase-${(actualPhase.id)!}" /] [#assign pageLibs = [ "select2", "blueimp-file-upload", "flag-icon-css", "components-font-awesome"] /] [#assign customJS = [ - "${baseUrlMedia}/js/projects/projectStudy.js?20240219", + "${baseUrlMedia}/js/projects/projectStudy.js?20240221", "${baseUrlCdn}/global/js/fieldsValidation.js", "${baseUrlCdn}/crp/js/feedback/feedbackAutoImplementation.js?20231017" ] diff --git a/marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl b/marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl index 04cc267db5..730123bd26 100644 --- a/marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl +++ b/marlo-web/src/main/webapp/WEB-INF/crp/views/studies/study.ftl @@ -3,7 +3,7 @@ [#assign currentSectionString = "${actionName?replace('/','-')}-${(expectedStudy.id)!}-phase-${(actualPhase.id)!}" /] [#assign pageLibs = ["select2" ,"blueimp-file-upload", "flag-icon-css" ] /] [#assign customJS = [ - "${baseUrlMedia}/js/projects/projectStudy.js?20240219", + "${baseUrlMedia}/js/projects/projectStudy.js?20240221", "${baseUrlCdn}/global/js/fieldsValidation.js" ] /] [#assign customCSS = [ diff --git a/marlo-web/src/main/webapp/crp/js/projects/projectStudy.js b/marlo-web/src/main/webapp/crp/js/projects/projectStudy.js index 7c15a29466..f9368ac517 100644 --- a/marlo-web/src/main/webapp/crp/js/projects/projectStudy.js +++ b/marlo-web/src/main/webapp/crp/js/projects/projectStudy.js @@ -246,7 +246,7 @@ function attachEvents() { var $element = $('#multiInput-references-template').clone(true).removeAttr("id"); var $listLength = $list.children().length; - if ($listLength <= 20) { + if ($listLength <= 30) { // Remove template tag $element.find('input, textarea').each(function (i, e) { e.name = (e.name).replace("_TEMPLATE_", "");