Skip to content

Commit

Permalink
Merge branch 'aiccra-staging' into aiccra-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjitm committed Apr 22, 2024
2 parents efe468d + af6847f commit a8375f1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,14 @@ public void remove(CrpProgramOutcomeIndicator originalCrpOutcomeIndicator, Phase
List<CrpProgramOutcome> outcomes = crpProgramOutcomeManager.getAllCrpProgramOutcomesByComposedIdFromPhase(
originalCrpOutcomeIndicator.getCrpProgramOutcome().getComposeID(), initialPhase.getId());

if (outcomes != null) {
if (outcomes != null && !outcomes.isEmpty()) {
for (CrpProgramOutcome crpProgramOutcome : outcomes) {

if (this.getCrpProgramOutcomeIndicatorByOutcomeAndIndicator(originalCrpOutcomeIndicator.getIndicator(),
crpProgramOutcome) != null
|| (!this.getCrpProgramOutcomeIndicatorByOutcomeAndIndicator(originalCrpOutcomeIndicator.getIndicator(),
crpProgramOutcome).isEmpty())) {
List<CrpProgramOutcomeIndicator> indicators =
new ArrayList<>(this.getCrpProgramOutcomeIndicatorByOutcomeAndIndicator(
originalCrpOutcomeIndicator.getIndicator(), crpProgramOutcome));
List<CrpProgramOutcomeIndicator> result = this.getCrpProgramOutcomeIndicatorByOutcomeAndIndicator(
originalCrpOutcomeIndicator.getIndicator(), crpProgramOutcome);

if (result != null && !result.isEmpty()) {
List<CrpProgramOutcomeIndicator> indicators = new ArrayList<>(result);

for (CrpProgramOutcomeIndicator indicator : indicators) {
if (indicator != null && indicator.getId() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,11 @@ public void saveIndicators(CrpProgramOutcome crpProgramOutcomeDB, CrpProgramOutc
if (crpProgramOutcomeIndicator != null
&& !crpProgramOutcomeDetached.getIndicators().contains(crpProgramOutcomeIndicator)) {
crpProgramOutcomeIndicatorManager.deleteCrpProgramOutcomeIndicator(crpProgramOutcomeIndicator.getId());
crpProgramOutcomeIndicatorManager.remove(crpProgramOutcomeIndicator, nextPhase);
// crpProgramOutcomeIndicatorManager.remove(crpProgramOutcomeIndicator, nextPhase);
}
} else {
crpProgramOutcomeIndicatorManager.deleteCrpProgramOutcomeIndicator(crpProgramOutcomeIndicator.getId());
crpProgramOutcomeIndicatorManager.remove(crpProgramOutcomeIndicator, nextPhase);
// crpProgramOutcomeIndicatorManager.remove(crpProgramOutcomeIndicator, nextPhase);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,31 @@
[/#if]

[#assign enableUnsubmitButton = !upKeepActive ]
[#-- Submit button --]
[#if enableUnsubmitButton && canEdit]
[#assign showSubmit=(canSubmit && !submission && completed)]
<a id="submitProject-${projectID}" class="projectSubmitButton" style="display:${showSubmit?string('block','none')}" href="[@s.url action="${crpSession}/submit"][@s.param name='projectID']${projectID}[/@s.param][#include "/WEB-INF/global/pages/urlGlobalParams.ftl" /][/@s.url]" >
[@s.text name="form.buttons.submit" /]
</a>

[#if action.canAccessSuperAdmin()]

[#-- Submit button --]
[#assign showSubmit=(!submission)]
[#if enableUnsubmitButton && showSubmit]
<br>
<div class="borderBox text-center">
<p class="projectValidateButton-message text-center">Only for SuperAdmin<br/></p>
<a id="submitProject-${projectID}" class="projectSubmitButton" style="display:${showSubmit?string('block','none')}" href="[@s.url action="${crpSession}/submit"][@s.param name='projectID']${projectID}[/@s.param][#include "/WEB-INF/global/pages/urlGlobalParams.ftl" /][/@s.url]" >
[@s.text name="form.buttons.submit" /]
</a>
</div>
[/#if]

[#else]

[#-- Submit button --]
[#if enableUnsubmitButton && canEdit]
[#assign showSubmit=(canSubmit && !submission && completed)]
<a id="submitProject-${projectID}" class="projectSubmitButton" style="display:${showSubmit?string('block','none')}" href="[@s.url action="${crpSession}/submit"][@s.param name='projectID']${projectID}[/@s.param][#include "/WEB-INF/global/pages/urlGlobalParams.ftl" /][/@s.url]" >
[@s.text name="form.buttons.submit" /]
</a>
[/#if]

[/#if]

[#-- Unsubmit button --]
Expand Down

0 comments on commit a8375f1

Please sign in to comment.