=== 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 @@ $i18n.getString("completed_programs") - #foreach($programInstance in $completedProgramInstances) #set($programStageInstanceId = '') === 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 03:29:50 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programEnrollmentForm.vm 2012-10-05 08:12:39 +0000 @@ -144,21 +144,24 @@ $('#tabs').tabs(); #if( $programInstance.program.type!='1' ) + $("#tabs").tabs("remove", 4); + $("#tabs").tabs("remove", 3); $("#tabs").tabs("remove", 2); - #end - - #if( ( $noIden && $noIden > 0) || ( $noOtherGroup && $noOtherGroup > 0) || ( $noGroup && $noGroup > 0 )) - $( "#tabs" ).tabs( "option", "selected", 1 ); - #else - $( "#tabs" ).tabs( "option", "selected", 2 ); $("#tabs").tabs("remove", 1); - #end - - #if( $hasDataEntry == 'true' ) - $( "#tabs" ).tabs( "option", "selected", 0 ); #else - $( "#tabs" ).tabs( "option", "disabled", [0] ); - $("#tabs").tabs("remove", 0); + #if( ( $noIden && $noIden > 0) || ( $noOtherGroup && $noOtherGroup > 0) || ( $noGroup && $noGroup > 0 )) + $( "#tabs" ).tabs( "option", "selected", 1 ); + #else + $( "#tabs" ).tabs( "option", "selected", 2 ); + $("#tabs").tabs("remove", 1); + #end + + #if( $hasDataEntry == 'true' ) + $( "#tabs" ).tabs( "option", "selected", 0 ); + #else + $( "#tabs" ).tabs( "option", "disabled", [0] ); + $("#tabs").tabs("remove", 0); + #end #end #end === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm 2012-10-05 07:47:52 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm 2012-10-05 08:12:39 +0000 @@ -22,7 +22,6 @@ psid="$programStageInstance.programStage.id" psname="$programStageInstance.programStage.name" status="$programStageInstance.getEventStatus()" - orgunit="$!programStageInstance.organisationUnit.name" programType='$programInstance.program.type' reportDate="$!format.formatDate( $!programStageInstance.executionDate )" reportDateDes="$programStageInstance.programStage.reportDateDescription"