← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7760: (mobile) minor fixes

 

------------------------------------------------------------
revno: 7760
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-30 11:35:52 +0200
message:
  (mobile) minor fixes
modified:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.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/registration/beneficiaryRegistrationForm.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/beneficiaryregistration/action/SaveBeneficiaryAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java	2012-07-30 09:09:34 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/beneficiaryregistration/action/SaveBeneficiaryAction.java	2012-07-30 09:35:52 +0000
@@ -39,6 +39,7 @@
 import org.joda.time.DateTime;
 import org.joda.time.format.DateTimeFormatter;
 import org.joda.time.format.ISODateTimeFormat;
+
 import javax.servlet.http.HttpServletRequest;
 import java.util.*;
 
@@ -314,8 +315,7 @@
             try
             {
                 patient.setBirthDateFromAge( Integer.parseInt( dateOfBirth ), Patient.AGE_TYPE_YEAR );
-            }
-            catch ( NumberFormatException nfe )
+            } catch ( NumberFormatException nfe )
             {
                 validationMap.put( "dob", "is_invalid_number" );
             }
@@ -327,8 +327,7 @@
                 DateTimeFormatter sdf = ISODateTimeFormat.yearMonthDay();
                 DateTime date = sdf.parseDateTime( dateOfBirth );
                 patient.setBirthDate( date.toDate() );
-            }
-            catch ( Exception e )
+            } catch ( Exception e )
             {
                 validationMap.put( "dob", "is_invalid_date" );
             }
@@ -344,12 +343,19 @@
             {
                 String key = "IDT" + patientIdentifierType.getId();
                 String value = parameterMap.get( key );
-                PatientIdentifier duplicateId = patientIdentifierService.get( patientIdentifierType, value );
+
+                PatientIdentifier duplicateId = null;
+
+                if ( !value.isEmpty() )
+                {
+                    patientIdentifierService.get( patientIdentifierType, value );
+                }
+
                 if ( value != null )
                 {
                     if ( patientIdentifierType.isMandatory() && value.trim().equals( "" ) )
                     {
-                        this.validationMap.put( key, "is_empty" );
+                        this.validationMap.put( key, "is_mandatory" );
                     }
                     else if ( patientIdentifierType.getType().equals( "number" ) && !FormUtils.isNumber( value ) )
                     {
@@ -367,6 +373,7 @@
                         patientIdentifierSet.add( patientIdentifier );
                         patientIdentifier.setIdentifier( value.trim() );
                     }
+
                     this.previousValues.put( key, value );
                 }
             }
@@ -384,7 +391,7 @@
                 {
                     if ( patientAttribute.isMandatory() && value.trim().equals( "" ) )
                     {
-                        this.validationMap.put( key, "is_empty" );
+                        this.validationMap.put( key, "is_mandatory" );
                     }
                     else if ( value.trim().length() > 0
                         && patientAttribute.getValueType().equals( PatientAttribute.TYPE_INT )
@@ -406,6 +413,7 @@
                         {
                             PatientAttributeOption option = patientAttributeOptionService.get( NumberUtils.toInt(
                                 value, 0 ) );
+
                             if ( option != null )
                             {
                                 patientAttributeValue.setPatientAttributeOption( option );

=== 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	2012-07-30 09:09:34 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2012-07-30 09:35:52 +0000
@@ -31,6 +31,7 @@
 is_invalid_negative_integer=is not a valid negative integer
 is_invalid_name=is not a valid name
 is_invalid_name_length=needs to be 7 or more characters
+is_mandatory=is a mandatory field
 is_duplicate=person identifier number is duplicated
 warnings_and_errors=Warnings and errors
 validation_rule_violation_warnings=Validation Rule Violation Warnings

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm	2012-07-30 09:09:34 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/registration/beneficiaryRegistrationForm.vm	2012-07-30 09:35:52 +0000
@@ -12,7 +12,7 @@
 <div class="header-box" align="center">
 <input type="hidden" name="orgUnitId" value="$orgUnitId"/>	
 	<p style="text-align: left;">
-		<label>$i18n.getString( "full_name" )</label>
+		<label>$i18n.getString( "full_name" )*</label>
 
 		#if( $validationMap.get( "fullName" ) )
            	<br /><span style="color: #990000;"> $i18n.getString($validationMap.get( "fullName" ))</span>