=== 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-04 15:05:38 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-10-05 04:50:32 +0000 @@ -571,8 +571,9 @@ if( dueDate < dueDateInStage && !flag) { jQuery('' - + '' + getFieldValue('orgunitName') + '
' + + '
' + '' + '' - + '' + getFieldValue('orgunitName') + '
' + + '
' + ' 0 ) - { - var programInstanceId = activeProgramInstance.attr('id').split('_')[1]; - var hasActiveEvent = false; - jQuery(".stage-object").each(function(){ - var status = jQuery(this).attr('status'); - if(status !=1 && status != 5 && !hasActiveEvent){ - var value = jQuery(this).val(); - var programStageInstanceId = jQuery(this).attr('id').split('_')[1]; - - jQuery('#td_' + programInstanceId).attr("onClick", "javascript:loadActiveProgramStageRecords("+ programInstanceId +", "+ programStageInstanceId +")") - jQuery('#tr2_' + programInstanceId).html(">>" + value + ""); - jQuery('#tr2_' + programInstanceId).attr("onClick", "javascript:loadActiveProgramStageRecords("+ programInstanceId +", "+ programStageInstanceId + ")"); - - var id = 'ps_' + programStageInstanceId; - enable('ps_' + programStageInstanceId ); - if( jQuery(".stage-object-selected").attr('id')!=jQuery(this).attr('id') ) - { - hideById('entryForm'); - hideById('executionDateTB'); - hideById('inputCriteriaDiv'); - } - hasActiveEvent = true; + var hasActiveEvent = false; + jQuery(".stage-object").each(function(){ + var status = jQuery(this).attr('status'); + if(status !=1 && status != 5 && !hasActiveEvent){ + var value = jQuery(this).val(); + var programStageInstanceId = jQuery(this).attr('id').split('_')[1]; + + jQuery('#td_' + programInstanceId).attr("onClick", "javascript:loadActiveProgramStageRecords("+ programInstanceId +", "+ programStageInstanceId +")") + jQuery('#tr2_' + programInstanceId).html(">>" + value + ""); + jQuery('#tr2_' + programInstanceId).attr("onClick", "javascript:loadActiveProgramStageRecords("+ programInstanceId +", "+ programStageInstanceId + ")"); + + var id = 'ps_' + programStageInstanceId; + enable('ps_' + programStageInstanceId ); + if( jQuery(".stage-object-selected").attr('id')!=jQuery(this).attr('id') ) + { + hideById('entryForm'); + hideById('executionDateTB'); + hideById('inputCriteriaDiv'); } - }); + hasActiveEvent = true; + } + }); + + if( !hasActiveEvent ){ + jQuery('#td_' + programInstanceId).attr("onClick", "javascript:loadActiveProgramStageRecords("+ programInstanceId +", false)") + jQuery('#tr2_' + programInstanceId).html(""); + jQuery('#tr2_' + programInstanceId).attr("onClick", ""); - if( !hasActiveEvent ){ - jQuery('#td_' + programInstanceId).attr("onClick", "javascript:loadActiveProgramStageRecords("+ programInstanceId +", false)") - jQuery('#tr2_' + programInstanceId).html(""); - jQuery('#tr2_' + programInstanceId).attr("onClick", ""); - - hideById('entryForm'); - hideById('executionDateTB'); - hideById('inputCriteriaDiv'); - } - } + hideById('entryForm'); + hideById('executionDateTB'); + hideById('inputCriteriaDiv'); + } } function removeEvent( programStageInstanceId, isEvent ) { var result = window.confirm( i18n_comfirm_delete_event ); - if ( result ) { $.postJSON( @@ -889,7 +885,7 @@ jQuery('#ps_' + programStageInstanceId).remove(); jQuery('#arrow_' + programStageInstanceId).remove(); jQuery('#org_' + programStageInstanceId).remove(); - resetActiveEvent( programStageInstanceId ); + resetActiveEvent( programInstanceId ); reloadOneRecord( programInstanceId ); showSuccessMessage( i18n_delete_success ); resize(); === 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-03 07:54:14 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm 2012-10-05 04:50:32 +0000 @@ -17,6 +17,8 @@
 $!programStageInstance.organisationUnit.name