=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-09-21 01:10:53 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-09-22 15:52:58 +0000 @@ -217,7 +217,7 @@ delete_current_event=Deleted current event delete_event_success=Deleted event successfully please_enter_report_date=Please enter report date -comfirm_delete_event=Are you sure you want to delete the event? +comfirm_delete_event=All data values in an event will be deleted when the event is deleted. Are you sure you want to delete the event ? registered_by_orgunit=Registered by facility event_information=Event information history_events=History events === 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-09-22 13:08:09 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-09-22 15:52:58 +0000 @@ -663,6 +663,7 @@ jQuery('#ps_' + programStageInstanceId ).focus(); jQuery('#createNewEncounterDiv_' + programInstanceId).dialog("close"); + resetActiveEvent( programStageInstanceId ); loadDataEntry( programStageInstanceId ); showSuccessMessage(i18n_create_event_success); }); @@ -758,7 +759,10 @@ showById('programInstanceDiv'); } activeProgramInstanceDiv( programInstanceId ); - loadDataEntry( activeProgramStageInstanceId ); + if( activeProgramStageInstanceId ) + { + loadDataEntry( activeProgramStageInstanceId ); + } jQuery('#loaderDiv').hide(); }); } @@ -927,6 +931,7 @@ function setEventStatus( field, programStageInstanceId ) { + var status = field.value; field.style.backgroundColor = SAVING_COLOR; jQuery.postUTF8( 'setEventStatus.action', { @@ -936,16 +941,66 @@ { jQuery('#ps_' + programStageInstanceId).attr('status',field.value); setEventColorStatus( programStageInstanceId, field.value ); + resetActiveEvent( programStageInstanceId ); if( status==1){ hideById('del_' + programStageInstanceId); } else{ showById('del_' + programStageInstanceId); + if( status==5){ + var id = 'ps_' + programStageInstanceId; + if( jQuery(".stage-object-selected").attr('id')==id ) + { + hideById('entryForm'); + hideById('executionDateTB'); + hideById('inputCriteriaDiv'); + } + } } field.style.backgroundColor = SUCCESS_COLOR; } ); } +function resetActiveEvent( programStageInstanceId ) +{ + var activeProgramInstance = jQuery(".selected"); + if( activeProgramInstance.length > 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; + } + }); + + 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'); + } + } +} function removeEvent( programStageInstanceId, isEvent ) { === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js 2012-09-22 13:08:09 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js 2012-09-22 15:52:58 +0000 @@ -6,6 +6,8 @@ { setInnerHTML('dataEntryFormDiv', ''); showById('dataEntryFormDiv'); + showById('executionDateTB'); + showById('inputCriteriaDiv'); setFieldValue( 'dueDate', '' ); setFieldValue( 'executionDate', '' ); disable('validationBtn'); @@ -28,9 +30,6 @@ var irregular = jQuery('#entryFormContainer input[id=irregular]').val(); var reportDateDes = jQuery("#ps_" + programStageInstanceId).attr("reportDateDes"); setInnerHTML('reportDateDescriptionField',reportDateDes); - showById('entryForm'); - showById('executionDateTB'); - showById('inputCriteriaDiv'); enable('validationBtn'); if( executionDate == '' ) { @@ -47,7 +46,7 @@ resize(); hideLoader(); hideById('contentDiv'); - jQuery('#executionDate').focus(); + jQuery('#dueDate').focus(); } ); } === 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-09-21 04:26:48 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-09-22 15:52:58 +0000 @@ -92,16 +92,17 @@ #set($flag = 'false') #foreach( $programStageInstance in $programInstance.programStageInstances ) #set( $status = $statusMap.get( $programStageInstance.id ) ) - #if( $status!=1 && $flag=='false') + #if( $status!=1 && $status!=5 && $flag=='false') + programStageInstanceId='$programStageInstanceId' style='cursor:pointer;' + onclick='javascript:loadActiveProgramStageRecords("$programInstance.id", "$programStageInstance.id")' > - $programInstance.program.name ($format.formatDate($programInstance.enrollmentDate)) + $programInstance.program.name ($format.formatDate($programInstance.enrollmentDate)) - - - • $programStageInstance.programStage.name ($format.formatDate($programStageInstance.dueDate)) + + + >> $programStageInstance.programStage.name ($format.formatDate($programStageInstance.dueDate)) #set($flag = 'true') @@ -109,11 +110,15 @@ #end #if($flag=='false') + programStageInstanceId='$programStageInstanceId' style='cursor:pointer;' + onclick='javascript:loadActiveProgramStageRecords("$programInstance.id", false)' > - $programInstance.program.name ($format.formatDate($programInstance.enrollmentDate)) + $programInstance.program.name ($format.formatDate($programInstance.enrollmentDate)) + + + #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-09-21 10:08:15 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm 2012-09-22 15:52:58 +0000 @@ -19,6 +19,7 @@ id="ps_$!programStageInstance.id" psid="$programStageInstance.programStage.id" psname="$programStageInstance.programStage.name" + status="$programStageInstance.getEventStatus()" orgunit="$!programStageInstance.organisationUnit.name" programType='$programInstance.program.type' reportDate="$!format.formatDate( $!programStageInstance.executionDate )"