getLegendSets()
+ {
+ return legendSets;
+ }
// -------------------------------------------------------------------------
// Action implementation
@@ -157,13 +169,15 @@
}
expressionAttributes = new ArrayList<>( program.getTrackedEntityAttributes() );
- constants = new ArrayList<>( constantService.getAllConstants() );
+ constants = constantService.getAllConstants();
+ legendSets = legendService.getAllLegendSets();
expressionAttributes = expressionAttributes.stream().filter( ArithmeticValueTypeTrackedEntityAttributeFilter.INSTANCE ).collect( Collectors.toList() );
Collections.sort( expressionAttributes );
Collections.sort( constants );
-
+ Collections.sort( legendSets );
+
return SUCCESS;
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java 2015-10-04 20:41:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java 2015-11-14 19:06:53 +0000
@@ -30,8 +30,11 @@
import org.apache.commons.lang3.StringUtils;
import org.hisp.dhis.analytics.AggregationType;
+import org.hisp.dhis.legend.LegendService;
+import org.hisp.dhis.legend.LegendSet;
import org.hisp.dhis.program.ProgramIndicator;
import org.hisp.dhis.program.ProgramIndicatorService;
+import org.springframework.beans.factory.annotation.Autowired;
import com.opensymphony.xwork2.Action;
@@ -53,6 +56,9 @@
this.programIndicatorService = programIndicatorService;
}
+ @Autowired
+ private LegendService legendService;
+
// -------------------------------------------------------------------------
// Setters
// -------------------------------------------------------------------------
@@ -120,6 +126,13 @@
this.decimals = decimals;
}
+ private Integer legendSetId;
+
+ public void setLegendSetId( Integer legendSetId )
+ {
+ this.legendSetId = legendSetId;
+ }
+
private Boolean displayInForm;
public void setDisplayInForm( Boolean displayInForm )
@@ -144,6 +157,8 @@
{
ProgramIndicator indicator = programIndicatorService.getProgramIndicator( id );
+ LegendSet legendSet = legendService.getLegendSet( legendSetId );
+
indicator.setName( StringUtils.trimToNull( name ) );
indicator.setShortName( StringUtils.trimToNull( shortName ) );
indicator.setCode( StringUtils.trimToNull( code ) );
@@ -152,6 +167,7 @@
indicator.setFilter( StringUtils.trimToNull( filter ) );
indicator.setAggregationType( AggregationType.valueOf( aggregationType ) );
indicator.setDecimals( decimals );
+ indicator.setLegendSet( legendSet );
indicator.setDisplayInForm( displayInForm );
programIndicatorService.updateProgramIndicator( indicator );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm 2015-10-04 20:41:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm 2015-11-14 19:06:53 +0000
@@ -78,6 +78,17 @@
|
+
+ |
+
+
+ |
+
|
|
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm 2015-10-04 20:41:27 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm 2015-11-14 19:06:53 +0000
@@ -77,6 +77,17 @@
+
+ |
+
+
+ |
+
|
|