dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25264
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12483: Merge of SISMA-362. Implements zero-or-positive integer data element value type.
Merge authors:
Stefan Börjesson (siborjesson)
Related merge proposals:
https://code.launchpad.net/~sis-ma/dhis2/SISMA-362/+merge/187168
proposed by: Leandro Soares (lssoares)
------------------------------------------------------------
revno: 12483 [merge]
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-10-07 19:58:57 +0200
message:
Merge of SISMA-362. Implements zero-or-positive integer data element value type.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/DefaultInputValidationService.java
dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java
dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.java
dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ValidationUtilsTest.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java
dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/form/InputType.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipPatients.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js
dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js
dhis-2/dhis-web/dhis-web-commons/src/test/java/org/hisp/dhis/ouwt/manager/OrganisationUnitSelectionManagerTest.java
dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm
dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm
dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm
dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/dataEntrySection.vm
dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/patientRegistrationList.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/dataelement/DataElement.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2013-09-11 15:26:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java 2013-09-20 15:13:05 +0000
@@ -85,6 +85,8 @@
public static final String VALUE_TYPE_INT = "int";
public static final String VALUE_TYPE_NUMBER = "number";
public static final String VALUE_TYPE_USER_NAME = "username";
+
+ public static final String VALUE_TYPE_ZERO_OR_POSITIVE_INT = "zeroPositiveInt";
public static final String VALUE_TYPE_POSITIVE_INT = "positiveNumber";
public static final String VALUE_TYPE_NEGATIVE_INT = "negativeNumber";
public static final String VALUE_TYPE_TRUE_ONLY = "trueOnly";
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/DefaultInputValidationService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/DefaultInputValidationService.java 2013-09-23 07:28:36 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/DefaultInputValidationService.java 2013-10-07 17:58:57 +0000
@@ -178,6 +178,13 @@
return new Status( false, value + " is not a valid negative integer." );
}
}
+ else if ( dataElement.getNumberType().equals( DataElement.VALUE_TYPE_ZERO_OR_POSITIVE_INT) )
+ {
+ if ( !MathUtils.isZeroOrPositiveInteger( value ) )
+ {
+ return new Status( false, value + " is not a valid zero or positive integer." );
+ }
+ }
}
return new Status();
=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java 2013-09-23 10:29:51 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/events/enrollment/AbstractEnrollmentService.java 2013-10-07 17:58:57 +0000
@@ -360,17 +360,4 @@
return program;
}
-
- private OrganisationUnit getOrganisationUnit( String id )
- {
- OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( id );
-
- if ( organisationUnit == null )
- {
- throw new IllegalArgumentException( "OrganisationUnit does not exist." );
- }
-
- return organisationUnit;
- }
-
}
\ No newline at end of file
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java 2013-09-20 15:13:05 +0000
@@ -326,7 +326,8 @@
else if ( dataElementType.equals( DataElement.VALUE_TYPE_NUMBER )
|| dataElementType.equals( DataElement.VALUE_TYPE_INT )
|| dataElementType.equals( DataElement.VALUE_TYPE_NEGATIVE_INT )
- || dataElementType.equals( DataElement.VALUE_TYPE_POSITIVE_INT ) )
+ || dataElementType.equals( DataElement.VALUE_TYPE_POSITIVE_INT )
+ || dataElementType.equals( DataElement.VALUE_TYPE_ZERO_OR_POSITIVE_INT) )
{
out.write( SEPARATOR_B );
out.write( SEPARATOR_B );
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java 2013-10-07 15:18:24 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/grid/GridUtils.java 2013-10-07 17:58:57 +0000
@@ -83,7 +83,6 @@
import org.htmlparser.filters.TagNameFilter;
import org.htmlparser.nodes.TagNode;
import org.htmlparser.tags.CompositeTag;
-import org.htmlparser.tags.Span;
import org.htmlparser.tags.TableRow;
import org.htmlparser.tags.TableTag;
import org.springframework.jdbc.support.rowset.SqlRowSet;
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java 2013-10-07 17:58:57 +0000
@@ -54,6 +54,7 @@
private static final Pattern NUMERIC_LENIENT_PATTERN = Pattern.compile( NUMERIC_LENIENT_REGEXP );
private static final Pattern INT_PATTERN = Pattern.compile( "^(0|-?[1-9]\\d*)$" );
private static final Pattern POSITIVE_INT_PATTERN = Pattern.compile( "^[1-9]\\d*$" );
+ private static final Pattern POSITIVE_OR_ZERO_INT_PATTERN = Pattern.compile( "(^0$)|(^[1-9]\\d*$)" );
private static final Pattern NEGATIVE_INT_PATTERN = Pattern.compile( "^-[1-9]\\d*$" );
private static final Pattern ZERO_PATTERN = Pattern.compile( "^0(\\.0*)?$" );
@@ -280,6 +281,21 @@
{
return value != null && POSITIVE_INT_PATTERN.matcher( value ).matches();
}
+
+
+ /**
+ * Returns true if the provided string argument is to be considered a positive
+ * or zero integer.
+ *
+ * @param value the value.
+ * @return true if the provided string argument is to be considered a positive
+ * integer.
+ */
+ public static boolean isZeroOrPositiveInteger( String value )
+ {
+ return value != null && POSITIVE_OR_ZERO_INT_PATTERN.matcher( value ).matches();
+ }
+
/**
* Returns true if the provided string argument is to be considered a negative
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/ValidationUtils.java 2013-10-07 17:58:57 +0000
@@ -243,7 +243,8 @@
return "data_element_or_type_null_or_empty";
}
- List<String> types = Arrays.asList( VALUE_TYPE_STRING, VALUE_TYPE_INT, VALUE_TYPE_NUMBER, VALUE_TYPE_POSITIVE_INT, VALUE_TYPE_NEGATIVE_INT );
+ List<String> types = Arrays.asList( VALUE_TYPE_STRING, VALUE_TYPE_INT, VALUE_TYPE_NUMBER,
+ VALUE_TYPE_POSITIVE_INT, VALUE_TYPE_NEGATIVE_INT, VALUE_TYPE_ZERO_OR_POSITIVE_INT);
String type = dataElement.getDetailedNumberType();
@@ -271,6 +272,11 @@
{
return "value_not_negative_integer";
}
+
+ if ( VALUE_TYPE_ZERO_OR_POSITIVE_INT.equals( type ) && !MathUtils.isZeroOrPositiveInteger( value ) )
+ {
+ return "value_not_zero_or_positive_integer";
+ }
if ( VALUE_TYPE_INT.equals( dataElement.getType() ) && MathUtils.isZero( value ) &&
!dataElement.isZeroIsSignificant() && !AGGREGATION_OPERATOR_AVERAGE.equals( dataElement.getAggregationOperator() ) )
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/MathUtilsTest.java 2013-10-07 17:58:57 +0000
@@ -224,6 +224,24 @@
assertFalse( MathUtils.isNegativeInteger( "2 " ) );
assertFalse( MathUtils.isNegativeInteger( "6.1345" ) );
}
+
+ @Test
+ public void testIsZeroOrPositiveInteger()
+ {
+ assertTrue( MathUtils.isZeroOrPositiveInteger( "0" ) );
+ assertTrue( MathUtils.isZeroOrPositiveInteger( "123" ) );
+
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "012" ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "+20" ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "-2" ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "-2232" ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "-2.17" ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "1.1" ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "-0" ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "Hey" ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "1 " ) );
+ assertFalse( MathUtils.isZeroOrPositiveInteger( "1.2345" ) );
+ }
@Test
public void testIsZero()
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ValidationUtilsTest.java'
--- dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ValidationUtilsTest.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/test/java/org/hisp/dhis/system/util/ValidationUtilsTest.java 2013-09-20 15:13:05 +0000
@@ -130,6 +130,12 @@
assertNull( dataValueIsValid( "3", de ) );
assertNotNull( dataValueIsValid( "-4", de ) );
+
+ de.setNumberType( DataElement.VALUE_TYPE_ZERO_OR_POSITIVE_INT );
+
+ assertNull( dataValueIsValid( "3", de ) );
+ assertNotNull( dataValueIsValid( "-4", de ) );
+
de.setNumberType( DataElement.VALUE_TYPE_NEGATIVE_INT );
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java 2013-09-05 13:09:59 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/utils/FormUtils.java 2013-09-20 15:13:05 +0000
@@ -253,6 +253,10 @@
{
return InputType.INTEGER_POSITIVE;
}
+ else if ( DataElement.VALUE_TYPE_ZERO_OR_POSITIVE_INT.equals( dataElement.getNumberType() ) )
+ {
+ return InputType.INTEGER_ZERO_OR_POSITIVE;
+ }
else if ( DataElement.VALUE_TYPE_NEGATIVE_INT.equals( dataElement.getNumberType() ) )
{
return InputType.INTEGER_NEGATIVE;
=== modified file 'dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/form/InputType.java'
--- dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/form/InputType.java 2013-08-23 16:00:30 +0000
+++ dhis-2/dhis-web/dhis-web-api/src/main/java/org/hisp/dhis/api/webdomain/form/InputType.java 2013-09-20 15:13:05 +0000
@@ -42,5 +42,6 @@
INTEGER,
INTEGER_POSITIVE,
INTEGER_NEGATIVE,
+ INTEGER_ZERO_OR_POSITIVE,
NEGATIVE_INTEGER
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm 2013-08-06 07:12:39 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanSelect.vm 2013-09-20 15:13:05 +0000
@@ -150,6 +150,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n "
+ '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '"
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2013-10-07 11:41:53 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm 2013-10-07 17:58:57 +0000
@@ -184,6 +184,7 @@
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n "
+ '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '"
+ dateFormat.replace('yy', 'yyyy') + " '" ;
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-10-03 14:11:59 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-10-07 17:58:57 +0000
@@ -2442,7 +2442,7 @@
{
return 'float';
}
- if( type == 'int' || type == 'positiveNumber' || type == 'negativeNumber' )
+ if( type == 'int' || type == 'positiveNumber' || type == 'negativeNumber' || type == 'zeroPositiveInt' )
{
return 'numeric';
}
@@ -2462,7 +2462,7 @@
{
return 'datefield';
}
- if( type == 'number' || type == 'int' || type == 'positiveNumber' || type == 'negativeNumber' )
+ if( type == 'number' || type == 'int' || type == 'positiveNumber' || type == 'negativeNumber' || type == 'zeroPositiveInt' )
{
return 'numberfield';
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2013-10-07 15:11:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2013-10-07 17:58:57 +0000
@@ -28,7 +28,7 @@
field.style.backgroundColor = SAVING_COLOR;
if ( fieldValue != '' ) {
- if ( type == 'int' || type == 'number' || type == 'positiveNumber' || type == 'negativeNumber' ) {
+ if ( type == 'int' || type == 'number' || type == 'positiveNumber' || type == 'negativeNumber' || type == 'zeroPositiveInt' ) {
if ( type == 'int' && !isInt( fieldValue ) ) {
field.style.backgroundColor = '#ffcc00';
@@ -59,6 +59,13 @@
return;
}
+ else if ( type == 'zeroPositiveInt' && !isZeroOrPositiveInt( fieldValue ) ) {
+ field.style.backgroundColor = '#ffcc00';
+ window.alert( i18n_value_must_zero_or_positive_integer + '\n\n' + dataElementName );
+ field.focus();
+
+ return;
+ }
}
else if ( type == 'date' ) {
field.focus();
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm 2013-05-28 07:32:37 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/multiDataEntrySelect.vm 2013-09-20 15:13:05 +0000
@@ -54,6 +54,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")';
var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm 2013-10-05 05:15:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientRegistrationList.vm 2013-10-07 17:58:57 +0000
@@ -213,6 +213,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n " + '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '" + dateFormat.replace('yy', 'yyyy') + " '" ;
var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm 2013-06-12 03:54:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm 2013-09-20 15:13:05 +0000
@@ -140,6 +140,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n "
+ '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '"
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipPatients.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipPatients.vm 2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/relationshipPatients.vm 2013-09-30 13:53:17 +0000
@@ -81,6 +81,7 @@
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n " + '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '" + dateFormat.replace('yy', 'yyyy') + " '" ;
var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
var i18n_saving_value_failed_error_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_error_code" ) , "'")';
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm 2013-09-23 03:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/reportDataEntryForm.vm 2013-09-30 13:53:17 +0000
@@ -80,6 +80,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n "
+ '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '"
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm 2013-10-05 05:15:03 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm 2013-10-07 17:58:57 +0000
@@ -79,6 +79,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n "
+ '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '"
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2013-09-06 09:06:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2013-09-20 15:13:05 +0000
@@ -91,6 +91,8 @@
#set($validate="positive_integer:true")
#elseif( $type=='negativeNumber' )
#set($validate="negative_integer:true")
+ #elseif( $type=='zeroPositiveInt' )
+ #set($validate="zeroPositiveInt:true")
#elseif( $type=='int' )
#set($validate="integer:true")
#end
@@ -194,6 +196,8 @@
#set($validate="positive_integer:true")
#elseif( $type=='negativeNumber' )
#set($validate="negative_integer:true")
+ #elseif( $type=='zeroPositiveInt' )
+ #set($validate="zeroPositiveInt:true")
#elseif( $type=='int' )
#set($validate="integer:true")
#end
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm 2013-05-28 03:10:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleEventSelect.vm 2013-09-20 15:13:05 +0000
@@ -111,6 +111,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n "
var i18n_reenrollment_confirm_message = '$encoder.jsEscape( $i18n.getString( "reenrollment_confirm_message" ) , "'")';
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-09-05 09:24:48 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/commons.js 2013-10-07 17:58:57 +0000
@@ -1671,6 +1671,15 @@
}
/**
+ * Allow only zero or positive integers, no thousands seperators
+ */
+function isZeroOrPositiveInt( value )
+{
+ var regex = /(^0$)|(^[1-9]\d*$)/;
+ return regex.test( value );
+}
+
+/**
* Allow only negative integers, not Zero and no thousands seperators
*/
function isNegativeInt( value )
=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js 2013-04-26 14:46:03 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/jQuery/jquery.validate.ext.js 2013-09-20 15:13:05 +0000
@@ -432,6 +432,10 @@
return this.optional(element) || isNegativeInt(value);
});
+jQuery.validator.addMethod("zero_positive_int", function(value, element, param) {
+ return this.optional(element) || isZeroOrPositiveInt(value);
+});
+
// Support method for date
//Parse a string and convert it to a Date object.
//If string cannot be parsed, return null.
=== modified file 'dhis-2/dhis-web/dhis-web-commons/src/test/java/org/hisp/dhis/ouwt/manager/OrganisationUnitSelectionManagerTest.java'
--- dhis-2/dhis-web/dhis-web-commons/src/test/java/org/hisp/dhis/ouwt/manager/OrganisationUnitSelectionManagerTest.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-commons/src/test/java/org/hisp/dhis/ouwt/manager/OrganisationUnitSelectionManagerTest.java 2013-10-07 17:58:57 +0000
@@ -42,7 +42,6 @@
/**
* @author Torgeir Lorange Ostby
- * @version $Id: OrganisationUnitSelectionManagerTest.java 6335 2008-11-20 11:11:26Z larshelg $
*/
public class OrganisationUnitSelectionManagerTest
extends DhisSpringTest
=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2013-09-19 16:35:34 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/resources/org/hisp/dhis/dashboard/i18n_module.properties 2013-10-07 17:58:57 +0000
@@ -112,7 +112,7 @@
sharing=Sharing
click_add_new_to_get_started=Click 'Add new' to get started
add_stuff_by_searching=Add stuff by searching from the search field above
-arrange_dashboard_by_dragging_and_dropping=Tip: arrange dashboard by dragging and dropping items
+arrange_dashboard_by_dragging_and_dropping=Then arrange dashboard by dragging and dropping items
click_to_explore_drag_to_new_position=Click to explore or drag to new position
drag_to_new_position=Drag to new position
system_notification=System notification
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2013-08-16 11:10:51 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js 2013-09-20 15:13:05 +0000
@@ -138,7 +138,7 @@
if ( value != '' )
{
- if ( type == 'string' || type == 'int' || type == 'number' || type == 'positiveNumber' || type == 'negativeNumber' )
+ if ( type == 'string' || type == 'int' || type == 'number' || type == 'positiveNumber' || type == 'negativeNumber' || type == 'zeroPositiveInt' )
{
if ( value.length > 255 )
{
@@ -160,6 +160,10 @@
{
return alertField( fieldId, i18n_value_must_negative_integer + ': ' + dataElementName );
}
+ if ( type == 'zeroPositiveInt' && !isZeroOrPositiveInt( value ) )
+ {
+ return alertField( fieldId, i18n_value_must_zero_or_positive_integer + ': ' + dataElementName );
+ }
if ( isValidZeroNumber( value ) )
{
// If value = 0 and zero not significant for data element, skip
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2013-10-07 14:00:59 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/select.vm 2013-10-07 17:58:57 +0000
@@ -10,6 +10,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_field_unallowed_save_zero = '$encoder.jsEscape( $i18n.getString( "field_unallowed_save_zero" ) , "'")';
var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';
=== modified file 'dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties 2013-10-01 13:16:44 +0000
+++ dhis-2/dhis-web/dhis-web-importexport/src/main/resources/org/hisp/dhis/importexport/i18n_module.properties 2013-10-07 17:58:57 +0000
@@ -332,4 +332,5 @@
value_not_positive_integer=Value is not a valid positive integer
value_not_negative_integer=Value is not a valid negative integer
value_is_zero_and_not_zero_significant=Value is zero and not zero-significant
+value_not_zero_or_positive_integer=Value is not a valid zero or positive integer
comment_too_long=Comment is too long
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2013-10-01 08:28:26 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2013-10-07 17:58:57 +0000
@@ -331,8 +331,7 @@
if ( !valueIsEmpty && !FormUtils.isBoolean( value ) )
{
correctType = false;
- typeViolations
- .put( key, "\"" + value + "\"" + " " + i18n.getString( "is_invalid_boolean" ) );
+ typeViolations.put( key, "\"" + value + "\"" + " " + i18n.getString( "is_invalid_boolean" ) );
}
}
else if ( type.equals( DataElement.VALUE_TYPE_DATE ) )
@@ -358,8 +357,7 @@
if ( !FormUtils.isInteger( value ) )
{
correctType = false;
- typeViolations
- .put( key, "\"" + value + "\"" + " " + i18n.getString( "is_invalid_integer" ) );
+ typeViolations.put( key, "\"" + value + "\"" + " " + i18n.getString( "is_invalid_integer" ) );
}
}
else if ( type.equals( DataElement.VALUE_TYPE_INT )
@@ -368,8 +366,7 @@
if ( !FormUtils.isPositiveInteger( value ) )
{
correctType = false;
- typeViolations.put( key,
- "\"" + value + "\"" + " " + i18n.getString( "is_invalid_positive_integer" ) );
+ typeViolations.put( key, "\"" + value + "\"" + " " + i18n.getString( "is_invalid_positive_integer" ) );
}
}
else if ( type.equals( DataElement.VALUE_TYPE_INT )
@@ -378,8 +375,16 @@
if ( !FormUtils.isNegativeInteger( value ) )
{
correctType = false;
- typeViolations.put( key,
- "\"" + value + "\"" + " " + i18n.getString( "is_invalid_negative_integer" ) );
+ typeViolations.put( key, "\"" + value + "\"" + " " + i18n.getString( "is_invalid_negative_integer" ) );
+ }
+ }
+ else if ( type.equals( DataElement.VALUE_TYPE_INT)
+ && numberType.equals( DataElement.VALUE_TYPE_ZERO_OR_POSITIVE_INT ) )
+ {
+ if ( !FormUtils.isZeroOrPositiveInteger( value ) )
+ {
+ correctType = false;
+ typeViolations.put( key, "\"" + value + "\"" + " " + i18n.getString( "is_invalid_zero_or_positive_integer" ) );
}
}
}
@@ -417,7 +422,6 @@
}
}
}
-
}
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java 2013-10-01 08:33:31 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/FormUtils.java 2013-10-07 17:58:57 +0000
@@ -327,10 +327,17 @@
return true;
}
+ //TODO re-use ValidationUtils
+
public static boolean isPositiveInteger( String value )
{
return valueHigher( value, 0 );
}
+
+ public static boolean isZeroOrPositiveInteger( String value )
+ {
+ return valueHigherOrEqual( value, 0 );
+ }
public static boolean isNegativeInteger( String value )
{
@@ -356,6 +363,26 @@
return false;
}
+
+ public static boolean valueHigherOrEqual( String value, int max )
+ {
+ int integerValue;
+
+ try
+ {
+ integerValue = Integer.parseInt( value );
+
+ if ( integerValue >= max )
+ {
+ return true;
+ }
+ }
+ catch ( NumberFormatException ignored )
+ {
+ }
+
+ return false;
+ }
public static boolean valueLower( String value, int min )
{
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java 2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/utils/NamebasedUtils.java 2013-09-20 15:13:05 +0000
@@ -138,6 +138,13 @@
return "is_invalid_negative_integer";
}
}
+ else if ( type.equals( DataElement.VALUE_TYPE_INT ) && numberType.equals( DataElement.VALUE_TYPE_ZERO_OR_POSITIVE_INT ) )
+ {
+ if ( !FormUtils.isZeroOrPositiveInteger( value ) )
+ {
+ return "is_invalid_zero_or_positive_integer";
+ }
+ }
return null;
}
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm 2013-10-01 08:28:26 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm 2013-10-07 17:58:57 +0000
@@ -84,6 +84,8 @@
<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
#elseif( $dataElement.type == "int" && $dataElement.numberType == "negativeNumber" )
<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
+ #elseif( $dataElement.type == "int" && $dataElement.numberType == "zeroPositiveInt" )
+ <input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
#elseif($dataElement.type=="trueOnly")
<input name="$key" type="checkbox" #if($!dataValues.get($key) == "on" ) checked #end/>
#end
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm 2013-07-17 16:50:42 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/dataElementForm.vm 2013-09-20 15:13:05 +0000
@@ -125,6 +125,7 @@
<option value="int" #if( $!dataElement.numberType == 'int' ) selected="selected" #end>$i18n.getString( "int" )</option>
<option value="positiveNumber" #if( $!dataElement.numberType == 'positiveNumber' ) selected="selected" #end>$i18n.getString( "positiveNumber" )</option>
<option value="negativeNumber" #if( $!dataElement.numberType == 'negativeNumber' ) selected="selected" #end>$i18n.getString( "negativeNumber" )</option>
+ <option value="zeroPositiveInt" #if( $!dataElement.numberType == 'zeroPositiveInt' ) selected="selected" #end>$i18n.getString( "zeroPositiveInt" )</option>
</select>
<script>
</script>
=== modified file 'dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm'
--- dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm 2013-08-21 12:10:58 +0000
+++ dhis-2/dhis-web/dhis-web-mobile/src/main/webapp/WEB-INF/dhis-web-mobile-velocity/data-entry.vm 2013-09-20 15:13:05 +0000
@@ -346,6 +346,8 @@
<input type="number" id='<%= fieldId %>' name='<%= fieldId %>' data-dataElement='<%= field.dataElement %>' data-categoryOptionCombo='<%= field.categoryOptionCombo %>' maxlength="255" value="<%= value %>" />
<% } else if( field.type == 'INTEGER_NEGATIVE' ) { %>
<input type="number" id='<%= fieldId %>' name='<%= fieldId %>' data-dataElement='<%= field.dataElement %>' data-categoryOptionCombo='<%= field.categoryOptionCombo %>' maxlength="255" value="<%= value %>" />
+ <% } else if( field.type == 'INTEGER_ZERO_OR_POSITIVE' ) { %>
+ <input type="number" id='<%= fieldId %>' name='<%= fieldId %>' data-dataElement='<%= field.dataElement %>' data-categoryOptionCombo='<%= field.categoryOptionCombo %>' maxlength="255" value="<%= value %>" />
<% } else if( field.type == 'NUMBER' ) { %>
<input type="number" id='<%= fieldId %>' name='<%= fieldId %>' data-dataElement='<%= field.dataElement %>' data-categoryOptionCombo='<%= field.categoryOptionCombo %>' maxlength="255" value="<%= value %>" />
<% } %>
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/dataEntrySection.vm'
--- dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/dataEntrySection.vm 2013-02-03 10:13:17 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/dataEntrySection.vm 2013-09-20 15:13:05 +0000
@@ -91,6 +91,8 @@
<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
#elseif( $dataElement.type == "int" && $dataElement.numberType == "positiveNumber" )
<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
+ #elseif( $dataElement.type == "int" && $dataElement.numberType == "zeroPositiveInt" )
+ <input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
#elseif( $dataElement.type == "int" && $dataElement.numberType == "negativeNumber" )
<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
#end
=== modified file 'dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/patientRegistrationList.vm'
--- dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/patientRegistrationList.vm 2013-09-12 08:40:07 +0000
+++ dhis-2/dhis-web/dhis-web-sms/src/main/webapp/dhis-web-sms/patientRegistrationList.vm 2013-09-20 15:13:05 +0000
@@ -151,6 +151,7 @@
var i18n_value_must_integer = '$encoder.jsEscape( $i18n.getString( "value_must_integer" ) , "'")';
var i18n_value_must_number = '$encoder.jsEscape( $i18n.getString( "value_must_number" ) , "'")';
var i18n_value_must_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_positive_integer" ) , "'")';
+ var i18n_value_must_zero_or_positive_integer = '$encoder.jsEscape( $i18n.getString( "value_must_zero_or_positive_integer" ) , "'")';
var i18n_value_must_negative_integer = '$encoder.jsEscape( $i18n.getString( "value_must_negative_integer" ) , "'")';
var i18n_invalid_date = '$encoder.jsEscape( $i18n.getString( "invalid_date" ) , "'")' + ".\n " + '$encoder.jsEscape( $i18n.getString( "format_date" ) , "'")' + " '" + dateFormat.replace('yy', 'yyyy') + " '" ;
var i18n_saving_value_failed_status_code = '$encoder.jsEscape( $i18n.getString( "saving_value_failed_status_code" ) , "'")';