=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2013-02-25 07:12:31 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2013-02-26 04:24:48 +0000 @@ -352,4 +352,6 @@ min_dataelement_value = Minimum of data element values max_dataelement_value = Maximum of data element values assign_program_to_userroles = Assign program to userroles -property_is_inserted = The property is inserted \ No newline at end of file +property_is_inserted = The property is inserted +please_insert_all_required_fields = Please insert all required fields +required_fields_valivation = Required fields validation \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js 2013-02-25 07:12:31 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/viewPatientRegistationForm.js 2013-02-26 04:24:48 +0000 @@ -3,7 +3,7 @@ { $('#selectionDialog' ).dialog( { - title:'fafds', + title:i18n_properties, maximize:true, closable:true, modal:false, @@ -45,31 +45,38 @@ showById('programAttrTab'); } -function validateForm() +function getRequiredFields() { - var result = false; - var html = jQuery("#designTextarea").ckeditorGet().getData(); - - var requiredFields = new Array(); - requiredFields.push('fixedattributeid=registrationDate'); - requiredFields.push('fixedattributeid=fullName'); - requiredFields.push('fixedattributeid=gender'); - requiredFields.push('fixedattributeid=birthDate'); - + var requiredFields = {}; + + requiredFields['fixedattributeid=registrationDate'] = i18n_registration_date; + requiredFields['fixedattributeid=fullName'] = i18n_full_name; + requiredFields['fixedattributeid=gender'] = i18n_gender; + requiredFields['fixedattributeid=birthDate'] = i18n_date_of_birth; + jQuery('#identifiersSelector option').each(function() { var item = jQuery(this); if( item.attr('mandatory')=='true'){ - requiredFields.push('identifierid=' + item.val()); + requiredFields['identifierid=' + item.val()] = item.text(); } }); jQuery('#attributesSelector option').each(function() { var item = jQuery(this); if( item.attr('mandatory')=='true'){ - requiredFields.push('attributeid=' + item.val()); + requiredFields['attributeid=' + item.val()] = item.text(); } }); + + return requiredFields; +} +function validateForm() +{ + var result = false; + var html = jQuery("#designTextarea").ckeditorGet().getData(); + requiredFields = getRequiredFields(); + var input = jQuery( html ).find("input"); if( input.length > 0 ) { @@ -93,18 +100,35 @@ key = 'programid=' + inputKey } - for (var idx=0; idx 0 ) { + if( Object.keys(requiredFields).length > 0 ) { setFieldValue('requiredField',''); + var violate = '

' + i18n_please_insert_all_required_fields + '

'; + for (var idx in requiredFields){ + violate += " - " + requiredFields[idx] + '
'; + } + + setInnerHTML('validateDiv', violate); + jQuery('#validateDiv').dialog({ + title:i18n_required_fields_valivation, + maximize:true, + closable:true, + modal:false, + overlay:{background:'#000000', opacity:0.1}, + width:500, + height:300 + }); + return false; } else{ === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm 2013-02-04 20:56:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientRegistrationForm.vm 2013-02-26 04:24:48 +0000 @@ -13,7 +13,7 @@ @@ -73,7 +73,10 @@ - + - - -
$i18n.getString( "design_patient_registration_form" ) + $i18n.getString( "design_patient_registration_form" ) + +
@@ -82,9 +85,6 @@
@@ -106,8 +106,7 @@ @@ -131,8 +130,7 @@
- - +
@@ -150,8 +148,7 @@ @@ -170,8 +167,7 @@ @@ -205,7 +201,16 @@ +
+