=== 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 07:47:52 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-10-05 08:12:39 +0000 @@ -1248,49 +1248,12 @@ jQuery('#activeTB' ).prepend(activedRow); jQuery('#enrollmentDiv').dialog("close"); saveIdentifierAndAttribute( patientId, programId,'identifierAndAttributeDiv' ); - loadProgramInstance( programInstanceId, false ); + loadActiveProgramStageRecords( programInstanceId ); showSuccessMessage(i18n_enrol_success); }); } // ---------------------------------------------------------------- -// Load program instance -// ---------------------------------------------------------------- - -function loadProgramInstance( programInstanceId, completed ) -{ - if( programInstanceId=='') { - hideById('programEnrollmentDiv'); - return; - } - jQuery('#loaderDiv').show(); - jQuery('#programEnrollmentDiv').load('enrollmentform.action', - { - programInstanceId:programInstanceId - }, function() - { - showById('programEnrollmentDiv'); - 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 ); - } - else{ - showById('programInstanceDiv'); - } - activeProgramInstanceDiv( programInstanceId ); - if( completed ){ - hideById('newEncounterBtn_' + programInstanceId); - } - jQuery('#loaderDiv').hide(); - resize(); - $(window).scrollTop(200); - }); -} - -// ---------------------------------------------------------------- // Program enrollmment && unenrollment // ---------------------------------------------------------------- @@ -1505,21 +1468,26 @@ }, function() { showById('programEnrollmentDiv'); - var type = jQuery('#tr_'+programInstanceId).attr('programType'); + var type = jQuery('#tb_'+programInstanceId).attr('programType'); if(type=='2'){ + hideById('colorHelpLink'); hideById('programInstanceDiv'); - var programStageInstanceId = jQuery('#tr_'+programInstanceId).attr('programStageInstanceId'); - loadDataEntryloadDataEntry( programStageInstanceId ); + var programStageInstanceId = jQuery('.stage-object').attr('id').split('_')[1]; + loadDataEntry( programStageInstanceId ); } else{ showById('programInstanceDiv'); + activeProgramInstanceDiv( programInstanceId ); + if( activeProgramStageInstanceId != undefined ) + { + loadDataEntry( activeProgramStageInstanceId ); + } } - activeProgramInstanceDiv( programInstanceId ); - if( activeProgramStageInstanceId ) + + if( activeProgramStageInstanceId != undefined ) { - loadDataEntry( activeProgramStageInstanceId ); + jQuery('#completedList').val(''); } - jQuery('#completedList').val(''); jQuery('#loaderDiv').hide(); }); } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-10-03 06:04:22 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-10-05 08:12:39 +0000 @@ -150,7 +150,7 @@