=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2011-09-06 11:52:18 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2011-09-08 15:28:20 +0000 @@ -89,6 +89,8 @@ public static final String AGGREGATION_OPERATOR_COUNT = "count"; + private String formName; + /** * If this DataElement is active or not (enabled or disabled). */ @@ -369,11 +371,26 @@ result.append( "}" ); return result.toString(); } + + public String getFormNameFallback() + { + return formName != null && !formName.isEmpty() ? formName : name; + } // ------------------------------------------------------------------------- // Getters and setters // ------------------------------------------------------------------------- + public String getFormName() + { + return formName; + } + + public void setFormName( String formName ) + { + this.formName = formName; + } + public boolean isActive() { return active; === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java' --- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2011-09-08 14:17:11 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2011-09-08 15:28:20 +0000 @@ -302,7 +302,7 @@ } inputHtml = inputHtml.replace( TAG_CLOSE, appendCode ); - inputHtml += "" + dataElement.getName() + ""; + inputHtml += "" + dataElement.getFormNameFallback() + ""; inputHtml += "" + categoryOptionCombo.getName() + ""; inputMatcher.appendReplacement( sb, inputHtml ); === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml 2011-09-06 11:52:18 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElement.hbm.xml 2011-09-08 15:28:20 +0000 @@ -34,6 +34,8 @@ + + === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2011-08-18 12:04:09 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2011-09-08 15:28:20 +0000 @@ -214,6 +214,11 @@ "alphanumericwithbasicpuncspaces" : true, "notOnlyDigits" : true }, + "formName" : { + "rangelength" : [ 2, 150 ], + "alphanumericwithbasicpuncspaces" : false, + "notOnlyDigits" : false + }, "url" : { "url" : true, "rangelength" : [ 0, 255 ] === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2011-09-08 14:17:11 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2011-09-08 15:28:20 +0000 @@ -36,7 +36,7 @@ #end #set( $count = $count + 1 ) - ${encoder.htmlEncode( $dataElement.name )} + ${encoder.htmlEncode( $dataElement.getFormNameFallback() )} #foreach( $optionCombo in $optionCombos ) #set( $dataEntryId = "${dataElement.id}-${optionCombo.id}-val" ) === modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm' --- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2011-09-08 14:17:11 +0000 +++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2011-09-08 15:28:20 +0000 @@ -53,7 +53,7 @@ #end #set( $count = $count + 1 ) - ${encoder.htmlEncode( $dataElement.name )} + ${encoder.htmlEncode( $dataElement.getFormNameFallback() )} #foreach( $optionCombo in $optionCombos ) #set( $dataEntryId = "${dataElement.id}-${optionCombo.id}-val" ) #set( $greyedField = false ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java 2011-05-05 21:15:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java 2011-09-08 15:28:20 +0000 @@ -100,6 +100,13 @@ { this.description = description; } + + private String formName; + + public void setFormName( String formName ) + { + this.formName = formName; + } private String domainType; @@ -196,6 +203,7 @@ dataElement.setShortName( shortName ); dataElement.setCode( code ); dataElement.setDescription( description ); + dataElement.setFormName( formName ); dataElement.setActive( true ); dataElement.setDomainType( domainType ); dataElement.setType( valueType ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java 2011-06-29 08:45:16 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java 2011-09-08 15:28:20 +0000 @@ -118,6 +118,13 @@ this.description = description; } + private String formName; + + public void setFormName( String formName ) + { + this.formName = formName; + } + private Boolean active; public void setActive( Boolean active ) @@ -205,6 +212,11 @@ { description = null; } + + if ( formName != null && formName.trim().length() == 0 ) + { + formName = null; + } // --------------------------------------------------------------------- // Update data element @@ -220,6 +232,7 @@ dataElement.setShortName( shortName ); dataElement.setCode( code ); dataElement.setDescription( description ); + dataElement.setFormName( formName ); dataElement.setActive( active ); dataElement.setDomainType( domainType ); dataElement.setType( valueType ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2011-06-14 16:13:36 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2011-09-08 15:28:20 +0000 @@ -351,4 +351,5 @@ negativeNumber = Negative Integer view_1 = View 1 view_2 = View 2 -store_zero_data_values = Store Zero Data Value \ No newline at end of file +store_zero_data_values = Store Zero Data Value +form_name = Form name \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2011-04-24 15:50:02 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2011-09-08 15:28:20 +0000 @@ -33,6 +33,10 @@ + + + + + + + +