Skip to content

Commit

Permalink
Merge branch 'aiccra-shfrm-contribution-functionality' into aiccra-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjitm committed Feb 22, 2024
2 parents 4d3483b + 719018e commit b363cfb
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,19 @@ public void deleteDeliverableShfrmPriorityActionPhase(Phase next, long deliverab
Phase phase = phaseDAO.find(next.getId());

DeliverableShfrmPriorityAction deliverableShfrmPriorityActionDelete = new DeliverableShfrmPriorityAction();
deliverableShfrmPriorityActionDelete =
deliverableShfrmPriorityActionDAO.findByDeliverableAndPhase(deliverableId, phase.getId()).stream()

try {
deliverableShfrmPriorityActionDelete = deliverableShfrmPriorityActionDAO
.findByDeliverableAndPhase(deliverableId, phase.getId()).stream()
.filter(d -> d != null && deliverableShfrmPriorityAction != null
&& deliverableShfrmPriorityAction.getShfrmPriorityAction() != null
&& deliverableShfrmPriorityAction.getShfrmPriorityAction().getId() != null
&& d.getShfrmPriorityAction() != null && d.getShfrmPriorityAction().getId() != null
&& d.getShfrmPriorityAction().getId().equals(deliverableShfrmPriorityAction.getShfrmPriorityAction().getId()))
.collect(Collectors.toList()).get(0);
} catch (Exception e) {
logger.info("No priority actions " + e);
}

if (deliverableShfrmPriorityActionDelete != null) {
deliverableShfrmPriorityActionDAO
Expand Down Expand Up @@ -157,18 +162,24 @@ public void saveDeliverableShfrmPriorityActionPhase(Phase next, long deliverable
logger.error("error getting deliverableShfrmPriorityActionPhase: " + e);
}

if (deliverableShfrmPriorityActionPhase != null) {
DeliverableShfrmPriorityAction deliverableShfrmPriorityActionAdd = deliverableShfrmPriorityActionPhase;
deliverableShfrmPriorityActionAdd.setDeliverable(deliverableShfrmPriorityAction.getDeliverable());
deliverableShfrmPriorityActionAdd.setPhase(phase);
deliverableShfrmPriorityActionAdd.setShfrmPriorityAction(deliverableShfrmPriorityAction.getShfrmPriorityAction());
deliverableShfrmPriorityActionDAO.save(deliverableShfrmPriorityActionAdd);
} else {
DeliverableShfrmPriorityAction deliverableShfrmPriorityActionAdd = new DeliverableShfrmPriorityAction();
deliverableShfrmPriorityActionAdd.setDeliverable(deliverableShfrmPriorityAction.getDeliverable());
deliverableShfrmPriorityActionAdd.setPhase(phase);
deliverableShfrmPriorityActionAdd.setShfrmPriorityAction(deliverableShfrmPriorityAction.getShfrmPriorityAction());
deliverableShfrmPriorityActionDAO.save(deliverableShfrmPriorityActionAdd);
try {
if (deliverableShfrmPriorityActionPhase != null) {
DeliverableShfrmPriorityAction deliverableShfrmPriorityActionAdd = deliverableShfrmPriorityActionPhase;
deliverableShfrmPriorityActionAdd.setDeliverable(deliverableShfrmPriorityAction.getDeliverable());
deliverableShfrmPriorityActionAdd.setPhase(phase);
deliverableShfrmPriorityActionAdd
.setShfrmPriorityAction(deliverableShfrmPriorityAction.getShfrmPriorityAction());
deliverableShfrmPriorityActionDAO.save(deliverableShfrmPriorityActionAdd);
} else {
DeliverableShfrmPriorityAction deliverableShfrmPriorityActionAdd = new DeliverableShfrmPriorityAction();
deliverableShfrmPriorityActionAdd.setDeliverable(deliverableShfrmPriorityAction.getDeliverable());
deliverableShfrmPriorityActionAdd.setPhase(phase);
deliverableShfrmPriorityActionAdd
.setShfrmPriorityAction(deliverableShfrmPriorityAction.getShfrmPriorityAction());
deliverableShfrmPriorityActionDAO.save(deliverableShfrmPriorityActionAdd);
}
} catch (Exception e) {
logger.error("error saving replication in DeliverableShfrmPriorityActionManagerImpl " + e);
}
if (phase.getNext() != null) {
this.saveDeliverableShfrmPriorityActionPhase(phase.getNext(), deliverableId, deliverableShfrmPriorityAction);
Expand Down
4 changes: 2 additions & 2 deletions marlo-web/src/main/resources/custom/aicrra.properties
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ deliverable.shfrmContribution.question.help=If you select yes, please make sure
deliverable.shfrmContribution.narrative.reporting=Provide a short narrative on the contribution of this deliverable to the SHFRM
deliverable.shfrmContribution.narrative.planning=Provide a short narrative on the expected contribution of this deliverable to the SHFRM
deliverable.shfrmContribution.priorityAction=To which priority action of the SHFRM is this deliverable contributing to?
deliverable.shfrmContribution.priorityAction.help=Select a priority action
deliverable.shfrmContribution.priorityAction.help=Select a priority action and sub-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):
Expand Down Expand Up @@ -2703,7 +2703,7 @@ project.deliverable.generalInformation.year=Year of expected completion
project.deliverable.generalInformation.justification=Status justification
project.deliverable.generalInformation.outcome=Outcome
project.deliverable.generalInformation.keyOutput=Performance Indicators
project.deliverable.generalInformation.keyOutput.help=If you select yes in SHFRM question, please make sure to select the SHFRM indicator
project.deliverable.generalInformation.keyOutput.help=If you select yes in SHFRM question, please make sure to select at least one SHFRM indicator
project.deliverable.generalInformation.keyOutputNotice=If the indicator you are looking for is not listed, please ensure the indicator is mapped to this cluster by clicking here
project.deliverable.generalInformation.keyOutputNotList1=Remember that you must to add cluster of activities
project.deliverable.generalInformation.keyOutputNotList2=, then you will be able to select key outputs.
Expand Down
4 changes: 2 additions & 2 deletions marlo-web/src/main/resources/global.properties
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ deliverable.shfrmContribution.question.help=If you select yes, please make sure
deliverable.shfrmContribution.narrative.reporting=Provide a short narrative on the contribution of this deliverable the SHFRM
deliverable.shfrmContribution.narrative.planing=Provide a short narrative on the expected contribution of this deliverable the SHFRM
deliverable.shfrmContribution.priorityAction=To which priority action of the SHFRM is this deliverable contributing to?
deliverable.shfrmContribution.priorityAction.help=Select a priority action
deliverable.shfrmContribution.priorityAction.help=Select a priority action and sub-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):
Expand Down Expand Up @@ -2785,7 +2785,7 @@ project.deliverable.generalInformation.year=Year of expected completion
project.deliverable.generalInformation.justification=Status justification
project.deliverable.generalInformation.outcome=Outcome
project.deliverable.generalInformation.keyOutput=Key Output
project.deliverable.generalInformation.keyOutput.help=If you select yes in SHFRM question, please make sure to select the SHFRM indicator
project.deliverable.generalInformation.keyOutput.help=If you select yes in SHFRM question, please make sure to select at least one SHFRM indicator
project.deliverable.generalInformation.keyOutputNotice=Click here to add or edit the list of contribution to performance indicators
project.deliverable.generalInformation.keyOutputNotList1=Remember that you must to add cluster of activities
project.deliverable.generalInformation.keyOutputNotList2=, then you will be able to select key outputs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@
<input class="id" type="hidden" name="${deliverableCustomName}.shfrmSubAction.id" value="${(subActionItem.shfrmSubAction.id)!-1}" />
<input class="name" type="hidden" name="${deliverableCustomName}.shfrmSubAction.name" value="${(subActionItem.shfrmSubAction.name)!'null'}" />
[#-- <input class="idTable" type="hidden" name="${deliverableCustomName}.id" value="${(subActionItem.id)!-1}" /> --]
<span class="name">${(subActionItem.shfrmSubAction.name)!'null'}</span>
<span class="name">${(subActionItem.shfrmSubAction.composedName)!'null'}</span>
<div class="clearfix"></div>
</div>
[/#macro]
Expand Down

0 comments on commit b363cfb

Please sign in to comment.