← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5056: (mobile) added warnings and errors header to data entry

 

------------------------------------------------------------
revno: 5056
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-10-27 19:40:17 +0200
message:
  (mobile) added warnings and errors header to data entry
modified:
  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/resources/org/hisp/dhis/light/i18n_module.properties
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntry.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-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	2011-10-26 12:07:23 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java	2011-10-27 17:40:17 +0000
@@ -303,7 +303,7 @@
                         if ( !valueIsEmpty && !SectionFormUtils.isBoolean( value ) )
                         {
                             correctType = false;
-                            typeViolations.put( key, i18n.getString( "invalid_boolean" ) );
+                            typeViolations.put( key, value + " " + i18n.getString( "is_invalid_boolean" ) );
                         }
                     }
                     else if ( type.equals( DataElement.VALUE_TYPE_DATE ) )
@@ -311,7 +311,7 @@
                         if ( !SectionFormUtils.isDate( value ) )
                         {
                             correctType = false;
-                            typeViolations.put( key, i18n.getString( "invalid_date" ) );
+                            typeViolations.put( key, value + " " + i18n.getString( "is_invalid_date" ) );
                         }
                     }
                     else if ( type.equals( DataElement.VALUE_TYPE_INT )
@@ -320,7 +320,7 @@
                         if ( !SectionFormUtils.isNumber( value ) )
                         {
                             correctType = false;
-                            typeViolations.put( key, i18n.getString( "invalid_number" ) );
+                            typeViolations.put( key, value + " " + i18n.getString( "is_invalid_number" ) );
                         }
                     }
                     else if ( type.equals( DataElement.VALUE_TYPE_INT )
@@ -329,7 +329,7 @@
                         if ( !SectionFormUtils.isInteger( value ) )
                         {
                             correctType = false;
-                            typeViolations.put( key, i18n.getString( "invalid_integer" ) );
+                            typeViolations.put( key, value + " " + i18n.getString( "is_invalid_integer" ) );
                         }
                     }
                     else if ( type.equals( DataElement.VALUE_TYPE_INT )
@@ -338,7 +338,7 @@
                         if ( !SectionFormUtils.isPositiveInteger( value ) )
                         {
                             correctType = false;
-                            typeViolations.put( key, i18n.getString( "invalid_positive_integer" ) );
+                            typeViolations.put( key, value + " " + i18n.getString( "is_invalid_positive_integer" ) );
                         }
                     }
                     else if ( type.equals( DataElement.VALUE_TYPE_INT )
@@ -347,7 +347,7 @@
                         if ( !SectionFormUtils.isNegativeInteger( value ) )
                         {
                             correctType = false;
-                            typeViolations.put( key, i18n.getString( "invalid_negative_integer" ) );
+                            typeViolations.put( key, value + " " + i18n.getString( "is_invalid_negative_integer" ) );
                         }
                     }
                 }

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2011-10-27 16:59:32 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2011-10-27 17:40:17 +0000
@@ -25,9 +25,14 @@
 db_language = Database Language
 
 # validation messages
-invalid_boolean = Invalid boolean
-invalid_date = Invalid date (yyyy-MM-dd)
-invalid_number = Invalid number
-invalid_integer = Invalid integer
-invalid_positive_integer = Invalid positive integer
-invalid_negative_integer = Invalid negative integer
+is_invalid_boolean = is not a valid boolean
+is_invalid_date = is not a valid date (yyyy-MM-dd)
+is_invalid_number = is not a valid number
+is_invalid_integer = is not a valid integer
+is_invalid_positive_integer = is not a valid positive integer
+is_invalid_negative_integer = is not a valid negative integer
+
+warnings_and_errors = Warnings and errors
+validation_rule_violation_warnings = Validation Rule Violation Warnings
+minmax_violation_warnings = Min/Max Violation Warnings
+type_violation_errors = Type Violation Errors

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntry.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntry.vm	2011-10-26 11:49:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntry.vm	2011-10-27 17:40:17 +0000
@@ -3,9 +3,30 @@
 
 <h2>$encoder.htmlEncode( $dataSet.name )</h2>
 
-#if( $validationRuleViolations.size() > 0 )
-<div class="header-box" align="center">
-	<h3 style="text-align: left; background-color: #990000; color: white;">Validation Rule Violations</h3>
+#set( $validationRuleViolationsSize = $validationRuleViolations.size() )
+#set( $validationViolationsSize = $validationViolations.size() )
+#set( $typeViolationsSize = $typeViolations.size() )
+
+#if( $validationRuleViolationsSize > 0 || $validationViolationsSize > 0 || $typeViolationsSize > 0 )
+<div class="header-box" align="center">
+	<h3 style="text-align: left; background-color: #990000; color: white;">$i18n.getString("warnings_and_errors")</h3>
+	<p style="text-align: left;">
+		#if( $validationRuleViolationsSize > 0 )
+			$validationRuleViolationsSize $i18n.getString("validation_rule_violation_warnings"). <br />
+		#end
+		#if( $validationViolationsSize > 0 )
+			$validationViolationsSize $i18n.getString("minmax_violation_warnings"). <br />
+		#end
+		#if( $typeViolationsSize > 0 )
+			$typeViolationsSize $i18n.getString("type_violation_errors"). <br />
+		#end
+	</p>
+</div>
+#end
+
+#if( $validationRuleViolationsSize > 0 )
+<div class="header-box" align="center">
+	<h3 style="text-align: left; background-color: #990000; color: white;">$i18n.getString("validation_rule_violations")</h3>
 	<p style="text-align: left;">
 	#foreach( $validationRuleViolation in $validationRuleViolations )
 		$validationRuleViolation <br />
@@ -60,11 +81,11 @@
 				#elseif( $dataElement.type == "int" && $dataElement.numberType == "number" )
 					<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
 				#elseif( $dataElement.type == "int" && $dataElement.numberType == "int" )
-					<input type="number" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
+					<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
 				#elseif( $dataElement.type == "int" && $dataElement.numberType == "positiveNumber" )
-					<input type="number" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
+					<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
 				#elseif( $dataElement.type == "int" && $dataElement.numberType == "negativeNumber" )
-					<input type="number" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
+					<input type="text" maxlength="255" size="24" name="$key" value="$!dataValues.get($key)" />
 				#end
 			#end
 		#end