dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #38852
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19742: Program indicator, added property displayInForms
------------------------------------------------------------
revno: 19742
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-08-07 17:04:21 +0200
message:
Program indicator, added property displayInForms
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java
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/resources/org/hisp/dhis/trackedentity/i18n_module.properties
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/updateProgramIndicator.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java 2015-07-14 09:34:46 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramIndicator.java 2015-08-07 15:04:21 +0000
@@ -93,6 +93,8 @@
*/
private Integer decimals;
+ private Boolean displayInForms;
+
private String rootDate;
// -------------------------------------------------------------------------
@@ -191,6 +193,19 @@
@JsonProperty
@JsonView( { DetailedView.class, ExportView.class } )
@JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+ public Boolean getDisplayInForms()
+ {
+ return displayInForms;
+ }
+
+ public void setDisplayInForms( Boolean displayInForms )
+ {
+ this.displayInForms = displayInForms;
+ }
+
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
public String getRootDate()
{
return rootDate;
@@ -209,13 +224,14 @@
if ( other.getClass().isInstance( this ) )
{
ProgramIndicator programIndicator = (ProgramIndicator) other;
-
+
if ( strategy.isReplace() )
{
program = programIndicator.getProgram();
valueType = programIndicator.getValueType();
expression = programIndicator.getExpression();
decimals = programIndicator.getDecimals();
+ displayInForms = programIndicator.getDisplayInForms();
rootDate = programIndicator.getRootDate();
}
else if ( strategy.isMerge() )
@@ -224,6 +240,7 @@
valueType = programIndicator.getValueType() == null ? valueType : programIndicator.getValueType();
expression = programIndicator.getExpression() == null ? expression : programIndicator.getExpression();
decimals = programIndicator.getDecimals() == null ? decimals : programIndicator.getDecimals();
+ displayInForms = programIndicator.getDisplayInForms() == null ? displayInForms : programIndicator.getDisplayInForms();
rootDate = programIndicator.getRootDate() == null ? rootDate : programIndicator.getRootDate();
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2015-08-02 12:27:56 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/trackedentity/startup/TableAlteror.java 2015-08-07 15:04:21 +0000
@@ -308,6 +308,8 @@
executeSql( "ALTER TABLE programindicator ALTER expression TYPE text" );
executeSql( "ALTER TABLE programstage ALTER description TYPE text" );
+ executeSql( "update programindicator set displayinforms = false where displayinforms is null" );
+
executeSql( "drop index index_patientdatavalue" );
executeSql( "update program p set dataentryformid = (select dataentryformid from trackedentityform tf where tf.programid=p.programid limit 1)" );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml 2015-07-13 17:43:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/program/hibernate/ProgramIndicator.hbm.xml 2015-08-07 15:04:21 +0000
@@ -30,6 +30,8 @@
<property name="decimals" />
+ <property name="displayInForms" />
+
<property name="rootDate" />
<!-- Access properties -->
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java 2015-07-13 17:43:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/AddProgramIndicatorAction.java 2015-08-07 15:04:21 +0000
@@ -135,6 +135,13 @@
{
this.decimals = decimals;
}
+
+ private Boolean displayInForms;
+
+ public void setDisplayInForms( Boolean displayInForms )
+ {
+ this.displayInForms = displayInForms;
+ }
private String rootDate;
@@ -177,6 +184,7 @@
indicator.setExpression( StringUtils.trimToNull( expression ) );
indicator.setFilter( StringUtils.trimToNull( filter ) );
indicator.setDecimals( decimals );
+ indicator.setDisplayInForms( displayInForms );
indicator.setRootDate( StringUtils.trimToNull( rootDate ) );
programIndicatorService.addProgramIndicator( indicator );
=== 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-07-13 17:43:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/java/org/hisp/dhis/trackedentity/action/programindicator/UpdateProgramIndicatorAction.java 2015-08-07 15:04:21 +0000
@@ -122,6 +122,13 @@
this.decimals = decimals;
}
+ private Boolean displayInForms;
+
+ public void setDisplayInForms( Boolean displayInForms )
+ {
+ this.displayInForms = displayInForms;
+ }
+
private String rootDate;
public void setRootDate( String rootDate )
@@ -168,6 +175,7 @@
indicator.setExpression( StringUtils.trimToNull( expression ) );
indicator.setFilter( StringUtils.trimToNull( filter ) );
indicator.setDecimals( decimals );
+ indicator.setDisplayInForms( displayInForms );
indicator.setRootDate( StringUtils.trimToNull( rootDate ) );
programIndicatorService.updateProgramIndicator( indicator );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2015-08-02 12:27:56 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/resources/org/hisp/dhis/trackedentity/i18n_module.properties 2015-08-07 15:04:21 +0000
@@ -551,4 +551,5 @@
tei_attribute = Tracked entity attribute
design_custom_registration_form=Design custom registration form
program_registration_form=Program registration form
-aggregation_type=Aggregation type
\ No newline at end of file
+aggregation_type=Aggregation type
+display_in_forms=Display in forms
\ No newline at end of file
=== 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-07-13 17:43:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/addProgramIndicator.vm 2015-08-07 15:04:21 +0000
@@ -77,6 +77,11 @@
</td>
<td></td>
</tr>
+ <tr>
+ <td><label for="displayInForms">$i18n.getString( "display_in_forms" )</label></td>
+ <td><input type="checkbox" id="displayInForms" name="displayInForms" value="true"></td>
+ <td></td>
+ </tr>
<tr id='rootDateTR' style='display:none'>
<td><label for="rootDate">$i18n.getString( "date_for_calculating" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>
=== 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-07-13 17:43:33 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-program/src/main/webapp/dhis-web-maintenance-program/updateProgramIndicator.vm 2015-08-07 15:04:21 +0000
@@ -77,6 +77,11 @@
</td>
<td></td>
</tr>
+ <tr>
+ <td><label for="displayInForms">$i18n.getString( "display_in_forms" )</label></td>
+ <td><input type="checkbox" id="displayInForms" name="displayInForms" value="true"#if( $programIndicator.displayInForms ) checked="checked"#end></td>
+ <td></td>
+ </tr>
<tr id='rootDateTR' #if($programIndicator.valueType!='date') style='display:none' #end >
<td><label for="rootDate">$i18n.getString( "date_for_calculating" ) <em title="$i18n.getString( "required" )" class="required">*</em></label></td>
<td>