=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-10-05 08:12:39 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-10-05 08:56:56 +0000 @@ -1461,6 +1461,8 @@ function loadActiveProgramStageRecords(programInstanceId, activeProgramStageInstanceId) { + if( programInstanceId == "") return; + jQuery('#loaderDiv').show(); jQuery('#programEnrollmentDiv').load('enrollmentform.action', { @@ -1468,17 +1470,21 @@ }, function() { showById('programEnrollmentDiv'); + var hasDataEntry = getFieldValue('hasDataEntry'); var type = jQuery('#tb_'+programInstanceId).attr('programType'); if(type=='2'){ hideById('colorHelpLink'); hideById('programInstanceDiv'); - var programStageInstanceId = jQuery('.stage-object').attr('id').split('_')[1]; - loadDataEntry( programStageInstanceId ); + if( hasDataEntry=='true' || hasDataEntry==undefined ){ + var programStageInstanceId = jQuery('.stage-object').attr('id').split('_')[1]; + loadDataEntry( programStageInstanceId ); + } } else{ showById('programInstanceDiv'); activeProgramInstanceDiv( programInstanceId ); - if( activeProgramStageInstanceId != undefined ) + if( activeProgramStageInstanceId != undefined + && ( hasDataEntry=='true' || hasDataEntry==undefined )) { loadDataEntry( activeProgramStageInstanceId ); } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-09-25 02:08:39 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-10-05 08:56:56 +0000 @@ -3,6 +3,7 @@ { showById('selectDiv'); showById('searchDiv'); + showById('mainLinkLbl'); hideById('listPatientDiv'); hideById('editPatientDiv'); hideById('enrollmentDiv'); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2012-10-05 08:12:39 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2012-10-05 08:56:56 +0000 @@ -3,6 +3,7 @@ #if( $programInstance || $hasDataEntry=='true') +