=== 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-10-10 03:11:32 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/org/hisp/dhis/patient/i18n_module.properties 2013-10-16 08:49:06 +0000 @@ -488,4 +488,5 @@ default_value = Default value dashboard_shortcut_to_add_relative = Dashboard shortcut to add relative shortcut_link_label_eg_add_child = Shortcut link label (e.g. Add Child) -relationship = Relationship \ No newline at end of file +relationship = Relationship +select_at_least_one_scope=Select at least one scope for local id \ 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/addPatientIdentifierTypeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm 2013-09-17 06:08:16 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientIdentifierTypeForm.vm 2013-10-16 08:49:06 +0000 @@ -1,4 +1,7 @@ +

$i18n.getString( "create_new_patient_identifier_type" )

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addPatientIdentifierTypeForm.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addPatientIdentifierTypeForm.js 2012-03-19 09:35:42 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/addPatientIdentifierTypeForm.js 2013-10-16 08:49:06 +0000 @@ -1,10 +1,25 @@ -jQuery(document).ready( function(){ - - jQuery('name').focus(); - - validation( 'addPatientIdentifierTypeForm', function(form){ - form.submit(); - }); - - checkValueIsExist( "name", "validatePatientIdentifierType.action"); -}); \ No newline at end of file +$(document).ready(function() { + $('name').focus(); + + validation('addPatientIdentifierTypeForm'); + + $('#addPatientIdentifierTypeForm').submit(function( e ) { + e.preventDefault(); + + if( $('#type').val() === 'localId' ) { + var orgunitScope = $('#orgunitScope').is(':checked'); + var programScope = $('#programScope').is(':checked'); + var periodSelected = $('#periodTypeName').val() !== ""; + + if( !orgunitScope && !programScope && !periodSelected ) { + setHeaderDelayMessage(i18n_select_at_least_one_scope); + } else { + this.submit(); + } + } else { + this.submit(); + } + }); + + checkValueIsExist("name", "validatePatientIdentifierType.action"); +}); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updatePatientIdentifierTypeForm.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updatePatientIdentifierTypeForm.js 2012-03-19 09:35:42 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/javascript/updatePatientIdentifierTypeForm.js 2013-10-16 08:49:06 +0000 @@ -1,10 +1,25 @@ -jQuery(document).ready( function(){ - - jQuery('name').focus(); - - validation( 'updatePatientIdentifierTypeForm', function(form){ - form.submit(); - }); - - checkValueIsExist( "name", "validatePatientIdentifierType.action", {id:getFieldValue('id')}); -}); \ No newline at end of file +$(document).ready(function() { + $('name').focus(); + + validation('updatePatientIdentifierTypeForm'); + + $('#updatePatientIdentifierTypeForm').submit(function( e ) { + e.preventDefault(); + + if( $('#type').val() === 'localId' ) { + var orgunitScope = $('#orgunitScope').is(':checked'); + var programScope = $('#programScope').is(':checked'); + var periodSelected = $('#periodTypeName').val() !== ""; + + if( !orgunitScope && !programScope && !periodSelected ) { + setHeaderDelayMessage(i18n_select_at_least_one_scope); + } else { + this.submit(); + } + } else { + this.submit(); + } + }); + + checkValueIsExist("name", "validatePatientIdentifierType.action", {id: getFieldValue('id')}); +}); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm 2013-09-17 06:08:16 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/updatePatientIdentifierType.vm 2013-10-16 08:49:06 +0000 @@ -1,7 +1,10 @@ +

$i18n.getString( "edit_patient_identifier_type" )

- +