=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2012-09-11 13:35:26 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2012-09-20 04:13:44 +0000 @@ -56,9 +56,7 @@ public static final int LATE_VISIT_STATUS = 4; - public static final int UNKNOWN_STATUS = 5; - - public static final int SKIPPED_STATUS = 6; + public static final int SKIPPED_STATUS = 5; private int id; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SetEventStatusAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SetEventStatusAction.java 2012-09-15 04:18:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SetEventStatusAction.java 2012-09-20 04:13:44 +0000 @@ -82,24 +82,24 @@ ProgramStageInstance programStageInstance = programStageInstanceService .getProgramStageInstance( programStageInstanceId ); - if ( ProgramStageInstance.COMPLETED_STATUS == status.intValue() ) + switch ( status.intValue() ) { - programStageInstance.setExecutionDate( new Date() ); + case ProgramStageInstance.COMPLETED_STATUS: programStageInstance.setCompleted( true ); programStageInstance.setStatus( null ); - } - else if ( ProgramStageInstance.VISITED_STATUS == status.intValue() ) - { + break; + case ProgramStageInstance.VISITED_STATUS: programStageInstance.setCompleted( false ); programStageInstance.setStatus( null ); - } - else if ( ProgramStageInstance.UNKNOWN_STATUS == status.intValue() ) - { - programStageInstance.setStatus( null ); - } - else if ( ProgramStageInstance.SKIPPED_STATUS == status.intValue() ) - { - programStageInstance.setStatus( status ); + break; + case ProgramStageInstance.LATE_VISIT_STATUS: + programStageInstance.setStatus( status ); + break; + case ProgramStageInstance.SKIPPED_STATUS: + programStageInstance.setStatus( status ); + break; + default: + break; } programStageInstanceService.updateProgramStageInstance( programStageInstance ); === 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-20 03:00:16 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-09-20 04:13:44 +0000 @@ -454,4 +454,5 @@ overdue_scheduled = Overdue/Scheduled scheduled_overdue_incomplete = Scheduled/Overdue/Incomplete relationships = Relationships -no_program_available_for_enrollment = No program is available for enrollment \ No newline at end of file +no_program_available_for_enrollment = No program is available for enrollment +reschedule = Re-schedule \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm 2012-09-19 13:39:07 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/activityPlanRecords.vm 2012-09-20 04:13:44 +0000 @@ -98,7 +98,7 @@ onclick="javascript:loadDataEntry( $programStageInstance.id );"> #end === 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-20 03:00:16 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-09-20 04:13:44 +0000 @@ -3,10 +3,12 @@ var COLOR_GREEN = "#8ffe8f"; var COLOR_YELLOW = "#f9f95a"; var COLOR_LIGHTRED = "#fb6bfb"; +var COLOR_GREY = "#bbbbbb"; var COLOR_LIGHT_RED = "#ff7676"; var COLOR_LIGHT_YELLOW = "#ffff99"; var COLOR_LIGHT_GREEN = "#ccffcc"; var COLOR_LIGHT_LIGHTRED = "#ff99ff"; +var COLOR_LIGHT_GREY = "#ddd"; var MARKED_VISIT_COLOR = '#000000'; var SUCCESS_COLOR = '#ccffcc'; var ERROR_COLOR = '#ccccff'; @@ -404,26 +406,43 @@ window.location.href = url; } -function setEventColorStatus( elementId, status ) +function setEventColorStatus( programStageInstanceId, status ) { - status = eval(status); + var boxElement = jQuery('#ps_' + programStageInstanceId ); + var dueDateElementId = 'value_' + programStageInstanceId + '_date'; + var status = eval(status); + switch(status) { case 1: - jQuery('#' + elementId ).css('border-color', COLOR_GREEN); - jQuery('#' + elementId ).css('background-color', COLOR_LIGHT_GREEN); + boxElement.css('border-color', COLOR_GREEN); + boxElement.css('background-color', COLOR_LIGHT_GREEN); + jQuery("#" + dueDateElementId ).datepicker("destroy"); + disable( dueDateElementId ); return; case 2: - jQuery('#' + elementId ).css('border-color', COLOR_LIGHTRED); - jQuery('#' + elementId ).css('background-color', COLOR_LIGHT_LIGHTRED); + boxElement.css('border-color', COLOR_LIGHTRED); + boxElement.css('background-color', COLOR_LIGHT_LIGHTRED); + datePicker( dueDateElementId ); + enable( dueDateElementId ); return; case 3: - jQuery('#' + elementId ).css('border-color', COLOR_YELLOW); - jQuery('#' + elementId ).css('background-color', COLOR_LIGHT_YELLOW); + boxElement.css('border-color', COLOR_YELLOW); + boxElement.css('background-color', COLOR_LIGHT_YELLOW); + datePicker( dueDateElementId ); + enable( dueDateElementId ); return; case 4: - jQuery('#' + elementId ).css('border-color', COLOR_RED); - jQuery('#' + elementId ).css('background-color', COLOR_LIGHT_RED); + boxElement.css('border-color', COLOR_RED); + boxElement.css('background-color', COLOR_LIGHT_RED); + datePicker( dueDateElementId ); + enable( dueDateElementId ); + return; + case 5: + boxElement.css('border-color', COLOR_GREY); + boxElement.css('background-color', COLOR_LIGHT_GREY); + jQuery("#" + dueDateElementId ).datepicker("destroy"); + disable( dueDateElementId ); return; default: return; @@ -605,7 +624,6 @@ + '>' + '') .insertBefore(element.parent()); - setEventColorStatus( elementId, 3 ); flag = true; } }); @@ -623,12 +641,12 @@ + 'onclick="javascript:loadDataEntry(' + programStageInstanceId + ')" ' + 'type="button" class="stage-object" ' + '>'); - setEventColorStatus( elementId, 3 ); } if( jQuery('#tb_' + programInstanceId + " :input" ).length > 4 ){ jQuery('#tb_' + programInstanceId + ' .arrow-left').removeClass("hidden"); jQuery('#tb_' + programInstanceId + ' .arrow-right').removeClass("hidden"); } + setEventColorStatus( programStageInstanceId, 3 ); jQuery('#ps_' + programStageInstanceId ).focus(); jQuery('#createNewEncounterDiv_' + programInstanceId).dialog("close"); loadDataEntry( programStageInstanceId ); @@ -875,3 +893,62 @@ jQuery(this).find('td:last').removeAttr("width"); }); } + +function setEventStatus( field, programStageInstanceId ) +{ + field.style.backgroundColor = SAVING_COLOR; + jQuery.postUTF8( 'setEventStatus.action', + { + programStageInstanceId:programStageInstanceId, + status:field.value + }, function ( json ) + { + jQuery('#ps_' + programStageInstanceId).attr('status',field.value); + setEventColorStatus( programStageInstanceId, field.value ); + field.style.backgroundColor = SUCCESS_COLOR; + } ); +} + + +function removeEvent( programStageInstanceId, isEvent ) +{ + var result = window.confirm( i18n_comfirm_delete_event ); + + if ( result ) + { + $.postJSON( + "removeCurrentEncounter.action", + { + "id": programStageInstanceId + }, + function( json ) + { + if ( json.response == "success" ) + { + jQuery( "tr#tr" + programStageInstanceId ).remove(); + + jQuery( "table.listTable tbody tr" ).removeClass( "listRow listAlternateRow" ); + jQuery( "table.listTable tbody tr:odd" ).addClass( "listAlternateRow" ); + jQuery( "table.listTable tbody tr:even" ).addClass( "listRow" ); + jQuery( "table.listTable tbody" ).trigger("update"); + + hideById('smsManagementDiv'); + if(isEvent) + { + showById('searchDiv'); + showById('listPatientDiv'); + } + var programInstanceId = jQuery('#ps_' + programStageInstanceId).attr('programInstanceId'); + jQuery('#ps_' + programStageInstanceId).remove(); + jQuery('#arrow_' + programStageInstanceId).remove(); + reloadOneRecord( programInstanceId ); + showSuccessMessage( i18n_delete_success ); + } + else if ( json.response == "error" ) + { + showWarningMessage( json.message ); + } + } + ); + } +} === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-09-20 03:00:16 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/entry.js 2012-09-20 04:13:44 +0000 @@ -58,7 +58,7 @@ + 'dueDate="' + json.programStageInstances[i].dueDate + '"' + 'value="'+ programStageName + ' ' + json.programStageInstances[i].dueDate + '" ' + 'onclick="javascript:loadDataEntry(' + programStageInstanceId + ')">'); - setEventColorStatus( elementId, status ); + setEventColorStatus( programStageInstanceId, status ); } disableCompletedButton(true); === 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-15 04:18:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-09-20 04:13:44 +0000 @@ -813,3 +813,5 @@ showSuccessMessage( i18n_save_success ); } ); } + +function reloadOneRecord(){} === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-09-18 01:55:04 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-09-20 04:13:44 +0000 @@ -231,7 +231,7 @@ commentText: commentText }, function ( json ) { - var programStageName = jQuery("#box_" + programStageInstanceId).attr('programStageName'); + var programStageName = jQuery("#ps_" + programStageInstanceId).attr('programStageName'); var date = new Date(); var currentTime = date.getHours() + ":" + date.getMinutes(); jQuery('#commentTB').prepend("" + getFieldValue("currentDate") + " " + currentTime + "" @@ -270,7 +270,7 @@ jQuery("#tb_" + programInstanceId + " .stage-object").each( function(){ var programStageInstance = this.id.split('_')[1]; jQuery('#arrow_' + programStageInstance ).toggle(); - jQuery('#box_' + programStageInstance ).toggle(); + jQuery('#ps_' + programStageInstance ).toggle(); jQuery(this).removeClass("stage-object-selected"); }); @@ -278,7 +278,7 @@ { var id = jQuery("#tb_" + programInstanceId + " .searched").attr('id').split('_')[1]; showById("arrow_" + id); - showById("box_" + id ); + showById("ps_" + id ); } resize(); } @@ -303,62 +303,6 @@ }); } -function setEventStatus( field, programStageInstanceId ) -{ - field.style.backgroundColor = SAVING_COLOR; - jQuery.postUTF8( 'setEventStatus.action', - { - programStageInstanceId:programStageInstanceId, - status:field.value - }, function ( json ) - { - field.style.backgroundColor = SUCCESS_COLOR; - } ); -} - -function removeEvent( programStageInstanceId, isEvent ) -{ - var result = window.confirm( i18n_comfirm_delete_event ); - - if ( result ) - { - $.postJSON( - "removeCurrentEncounter.action", - { - "id": programStageInstanceId - }, - function( json ) - { - if ( json.response == "success" ) - { - jQuery( "tr#tr" + programStageInstanceId ).remove(); - - jQuery( "table.listTable tbody tr" ).removeClass( "listRow listAlternateRow" ); - jQuery( "table.listTable tbody tr:odd" ).addClass( "listAlternateRow" ); - jQuery( "table.listTable tbody tr:even" ).addClass( "listRow" ); - jQuery( "table.listTable tbody" ).trigger("update"); - - hideById('smsManagementDiv'); - if(isEvent) - { - showById('searchDiv'); - showById('listPatientDiv'); - } - var programInstanceId = jQuery('#box_' + programStageInstanceId).attr('programInstanceId'); - jQuery('#box_' + programStageInstanceId).remove(); - jQuery('#arrow_' + programStageInstanceId).remove(); - reloadOneRecord( programInstanceId ); - showSuccessMessage( i18n_delete_success ); - } - else if ( json.response == "error" ) - { - showWarningMessage( json.message ); - } - } - ); - } -} - function commentDivToggle(isHide) { var index = 1; @@ -418,16 +362,16 @@ if( dueDate >= startDate && dueDate <= endDate && statusEvent == status ) { if( jQuery("#tb_" + programInstanceId + " .searched").length > 0 ){ - jQuery("#box_" + id ).addClass("stage-object-selected searched"); - hideById("box_" + id ) + jQuery("#ps_" + id ).addClass("stage-object-selected searched"); + hideById("ps_" + id ) hideById('arrow_' + id ); } - jQuery("#box_" + id ).addClass("stage-object-selected searched"); + jQuery("#ps_" + id ).addClass("stage-object-selected searched"); } else { hideById('arrow_' + id ); - hideById('box_' + id ); + hideById('ps_' + id ); } }); jQuery(".arrow-left").hide(); === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm 2012-09-15 04:18:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm 2012-09-20 04:13:44 +0000 @@ -127,21 +127,25 @@ $encoder.htmlEncode( $programStageInstance.programStage.name ) #set( $duedateId = "value_" + $programStageInstance.id + "_date" ) + #set($status = $statusMap.get( $programStageInstance.id )) - #set($status = $statusMap.get( $programStageInstance.id )) - + + + + + + + + + #if($programStageInstance.programStage.irregular=='true' && ($status==3 || $status==4 || $status==5 )) + $i18n.getString( "remove" ) + #end + #set( $mark = !$mark ) #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-19 13:39:07 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstanceFlow.vm 2012-09-20 04:13:44 +0000 @@ -27,8 +27,8 @@ value="$programStageInstance.programStage.name $valueDate" onclick="javascript:loadDataEntry( $programStageInstance.id );"> #end === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm 2012-09-15 04:18:54 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm 2012-09-20 04:13:44 +0000 @@ -55,7 +55,7 @@ #set($status = $programStageInstance.getEventStatus()) - #if( $programStageInstance.irregular!='true' && ($status==3 || $status==4) ) + #if( $programStageInstance.irregular!='true' && ($status==3 || $status==4 || $status==5 ) ) #end @@ -79,7 +79,11 @@ @@ -89,18 +93,18 @@ - + === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2012-09-19 13:39:07 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2012-09-20 04:13:44 +0000 @@ -82,7 +82,7 @@ #if($!programStageInstance.executionDate) #set($valueDate=$format.formatDate( $programStageInstance.executionDate )) #end - var status = $statusMap.get( $programStageInstance.id ); var dueDate = "$format.formatDate($programStageInstance.dueDate)"; - setEventColorStatus( 'box_' + $programStageInstance.id ,status, dueDate ); + setEventColorStatus( $programStageInstance.id ,status, dueDate ); #end === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm 2012-08-28 05:48:46 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/selectPatient.vm 2012-09-20 04:13:44 +0000 @@ -103,6 +103,8 @@ var i18n_show_all_items = '$encoder.jsEscape( $i18n.getString( "show_all_items" ) , "'")'; var i18n_create_new_event = '$encoder.jsEscape( $i18n.getString( "create_new_event" ) , "'")'; var i18n_enroll_program = '$encoder.jsEscape( $i18n.getString( "enroll_program" ) , "'")'; + var i18n_comfirm_delete_event = '$encoder.jsEscape( $i18n.getString( "comfirm_delete_event" ) , "'")'; + var checkedDuplicate = false; // -1: no search anything // 0: show list all patient