diff --git a/marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java b/marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java index c56afb5bc7..c42d418a82 100644 --- a/marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java +++ b/marlo-data/src/main/java/org/cgiar/ccafs/marlo/data/dao/mysql/ExpectedStudyProjectMySQLDAO.java @@ -72,8 +72,8 @@ public List findAll() { @Override public List getByProjectAndPhase(long projectId, long phaseId) { - String query = - "select distinct esp from ExpectedStudyProject esp " + "where project.id = :projectId and phase.id = :phaseId"; + String query = "select distinct esp from ExpectedStudyProject esp " + + "where project.id = :projectId and phase.id = :phaseId and is_active = 1"; Query createQuery = this.getSessionFactory().getCurrentSession().createQuery(query); createQuery.setParameter("projectId", projectId); createQuery.setParameter("phaseId", phaseId); diff --git a/marlo-web/pom.xml b/marlo-web/pom.xml index ddeab2474f..9bfc58161c 100644 --- a/marlo-web/pom.xml +++ b/marlo-web/pom.xml @@ -555,7 +555,7 @@ minify - + + **/*.min.* @@ -578,6 +578,7 @@ minify + --> diff --git a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java index 0ae0209948..754319ceec 100644 --- a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java +++ b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/BaseAction.java @@ -3487,7 +3487,9 @@ public List getexpectedCrpOutcomes(Long id) { .collect(Collectors.toList()); if (filteredCrpOutcomes != null && !filteredCrpOutcomes.isEmpty()) { projectExpectedStudy.setCrpOutcomes(new ArrayList<>(filteredCrpOutcomes)); + if(!expectedStudies.contains(projectExpectedStudy)) { expectedStudies.add(projectExpectedStudy); + } } } } diff --git a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/json/project/DeliverablesByDisseminationURLHandleDOIAction.java b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/json/project/DeliverablesByDisseminationURLHandleDOIAction.java index e6a21026e8..2d5aaba8c0 100644 --- a/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/json/project/DeliverablesByDisseminationURLHandleDOIAction.java +++ b/marlo-web/src/main/java/org/cgiar/ccafs/marlo/action/json/project/DeliverablesByDisseminationURLHandleDOIAction.java @@ -84,18 +84,16 @@ public String execute() throws Exception { } if (deliverables != null && !deliverables.isEmpty() && phase != null) { - deliverables = deliverables.stream() - .filter(d -> d != null && d.isActive() && d.getId() != null && d.getId() != deliverableID - && d.getDeliverableInfo(phase).isActive()) + deliverables = deliverables.stream().filter(d -> d != null && d.getId() != deliverableID) .sorted(Comparator.comparing(Deliverable::getId)).collect(Collectors.toList()); if (deliverables != null && !deliverables.isEmpty()) { List deliverableDTOs = new ArrayList<>(); for (Deliverable deliverable : deliverables) { - if (deliverable != null && deliverable.getId() != null) { - deliverable = deliverableManager.getDeliverableById(deliverable.getId()); - } + + deliverable = deliverableManager.getDeliverableById(deliverable.getId()); + DeliverableDissemination deliverableDissemination = new DeliverableDissemination(); boolean isDOIDuplicated = false; boolean isDisseminationURLDuplicated = false; 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 f43bad3035..abb8b0f8ce 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?20230418", + "${baseUrlMedia}/js/projects/projectStudy.js?20240219", "${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 52d64f75dc..04cc267db5 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?20230413", + "${baseUrlMedia}/js/projects/projectStudy.js?20240219", "${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 c2aaf6e44a..7c15a29466 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 <= 10) { + if ($listLength <= 20) { // Remove template tag $element.find('input, textarea').each(function (i, e) { e.name = (e.name).replace("_TEMPLATE_", "");