=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-09-23 09:30:13 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-09-24 05:02:17 +0000 @@ -416,6 +416,7 @@ ../dhis-web-commons/ouwt/ouwt.js ,javascript/commons.js ,javascript/patient.js + ,javascript/patientForm.js ,javascript/entry.js ,javascript/relationshipPatient.js @@ -883,7 +884,12 @@ /dhis-web-caseentry/programTrackingSelect.vm /dhis-web-caseentry/trackingMenu.vm style/style.css - ../dhis-web-commons/ouwt/ouwt.js,javascript/commons.js,javascript/smsReminder.js + + ../dhis-web-commons/ouwt/ouwt.js, + javascript/commons.js, + javascript/patient.js, + javascript/relationshipPatient.js, + javascript/smsReminder.js F_SMS_REMINDER @@ -972,7 +978,11 @@ /dhis-web-caseentry/activityPlanSelect.vm /dhis-web-caseentry/trackingMenu.vm style/style.css - ../dhis-web-commons/ouwt/ouwt.js,javascript/commons.js,javascript/activityPlan.js + + ../dhis-web-commons/ouwt/ouwt.js, + javascript/commons.js, + javascript/patient.js, + javascript/activityPlan.js F_ACTIVITY_PLAN === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm 2012-09-23 09:30:13 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addPatientForm.vm 2012-09-24 05:02:17 +0000 @@ -34,7 +34,7 @@ addEventForPatientForm( 'patientForm' ); }); hideById('patientForm [id=age]'); - hideById('patientManagementLbl'); + hideById('mainLinkLbl');

=== 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-23 11:52:27 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/commons.js 2012-09-24 05:02:17 +0000 @@ -452,7 +452,6 @@ } } - // ----------------------------------------------------------------------------- // check duplicate patient // ----------------------------------------------------------------------------- @@ -701,26 +700,6 @@ // Dash board // ---------------------------------------------------------------- -function activeProgramInstanceDiv( programInstanceId ) -{ - jQuery(".selected").each(function(){ - jQuery(this).removeClass(); - }); - - jQuery("#infor_" + programInstanceId).each(function(){ - jQuery(this).addClass('selected bold'); - }); - - showById('pi_' + programInstanceId); -} - -function hideProgramInstanceDiv( programInstanceId ) -{ - hideById('pi_' + programInstanceId); - jQuery('#pi_' + programInstanceId).removeClass("link-area-active"); - jQuery("#img_" + programInstanceId).attr('src',''); -} - function showPatientDashboardForm( patientId ) { hideById('selectDiv'); @@ -730,6 +709,9 @@ hideById('listRelationshipDiv'); hideById('addRelationshipDiv'); hideById('migrationPatientDiv'); + hideById('patientProgramTrackingDiv'); + hideById('smsManagementDiv'); + setInnerHTML('listEventDiv',''); jQuery('#loaderDiv').show(); jQuery('#patientDashboard').load('patientDashboard.action', @@ -737,11 +719,32 @@ patientId:patientId }, function() { + setInnerHTML('mainFormLink', i18n_main_form_link); showById('patientDashboard'); jQuery('#loaderDiv').hide(); }); } +function activeProgramInstanceDiv( programInstanceId ) +{ + jQuery(".selected").each(function(){ + jQuery(this).removeClass(); + }); + + jQuery("#infor_" + programInstanceId).each(function(){ + jQuery(this).addClass('selected bold'); + }); + + showById('pi_' + programInstanceId); +} + +function hideProgramInstanceDiv( programInstanceId ) +{ + hideById('pi_' + programInstanceId); + jQuery('#pi_' + programInstanceId).removeClass("link-area-active"); + jQuery("#img_" + programInstanceId).attr('src',''); +} + function loadActiveProgramStageRecords(programInstanceId, activeProgramStageInstanceId) { jQuery('#loaderDiv').show(); @@ -926,8 +929,7 @@ $('.stage-flow').css('width', w-width); $('.table-flow').css('width', w-width); $('.table-flow tr').each(function(){ - jQuery(this).find('td:visible').attr("width", "10px"); - jQuery(this).find('td:hidden').removeAttr("width"); + jQuery(this).find('td').attr("width", "10px"); jQuery(this).find('td:last').removeAttr("width"); }); } @@ -1033,7 +1035,7 @@ showById('searchDiv'); showById('listPatientDiv'); } - var id = 'ps_'+programStageInstanceId; + var id = 'ps_' + programStageInstanceId; var programInstanceId = jQuery('#' + id).attr('programInstanceId'); if(jQuery(".stage-object-selected").attr('id')== id) { === 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-23 12:58:02 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patient.js 2012-09-24 05:02:17 +0000 @@ -1,147 +1,4 @@ -function organisationUnitSelected( orgUnits, orgUnitNames ) -{ - showById('selectDiv'); - showById('searchDiv'); - hideById('listPatientDiv'); - hideById('editPatientDiv'); - hideById('enrollmentDiv'); - hideById('listRelationshipDiv'); - hideById('addRelationshipDiv'); - hideById('migrationPatientDiv'); - hideById('patientDashboard'); - enable('listPatientBtn'); - enable('addPatientBtn'); - enable('advancedSearchBtn'); - setFieldValue("orgunitName", orgUnitNames[0]); -} - -selection.setListenerFunction( organisationUnitSelected ); - -// ----------------------------------------------------------------------------- -// List && Search patients -// ----------------------------------------------------------------------------- - -function listAllPatient() -{ - hideById('listPatientDiv'); - hideById('editPatientDiv'); - hideById('migrationPatientDiv'); - - jQuery('#loaderDiv').show(); - contentDiv = 'listPatientDiv'; - jQuery('#listPatientDiv').load('searchRegistrationPatient.action',{ - listAll:true - }, - function(){ - statusSearching = 0; - showById('listPatientDiv'); - jQuery('#loaderDiv').hide(); - }); - hideLoader(); -} - -function advancedSearch( params ) -{ - $.ajax({ - url: 'searchRegistrationPatient.action', - type:"POST", - data: params, - success: function( html ){ - statusSearching = 1; - setInnerHTML( 'listPatientDiv', html ); - showById('listPatientDiv'); - setFieldValue('listAll',false); - jQuery( "#loaderDiv" ).hide(); - } - }); -} - -// ----------------------------------------------------------------------------- -// Remove patient -// ----------------------------------------------------------------------------- - -function removePatient( patientId, fullName ) -{ - removeItem( patientId, fullName, i18n_confirm_delete, 'removePatient.action' ); -} - -// ----------------------------------------------------------------------------- -// Add Patient -// ----------------------------------------------------------------------------- - -function showAddPatientForm() -{ - hideById('listPatientDiv'); - hideById('selectDiv'); - hideById('searchDiv'); - hideById('migrationPatientDiv'); - - jQuery('#loaderDiv').show(); - jQuery('#editPatientDiv').load('showAddPatientForm.action' - , function() - { - showById('editPatientDiv'); - jQuery('#loaderDiv').hide(); - }); - -} - -function validateAddPatient() -{ - $("#patientForm :input").attr("disabled", true); - $.ajax({ - type: "POST", - url: 'validatePatient.action', - data: getParamsForDiv('patientForm'), - success:addValidationCompleted - }); -} - -function addValidationCompleted( data ) -{ - var type = jQuery(data).find('message').attr('type'); - var message = jQuery(data).find('message').text(); - - if ( type == 'success' ) - { - removeDisabledIdentifier( ); - addPatient(); - } - else - { - if ( type == 'error' ) - { - showErrorMessage( i18n_adding_patient_failed + ':' + '\n' + message ); - } - else if ( type == 'input' ) - { - showWarningMessage( message ); - } - else if( type == 'duplicate' ) - { - showListPatientDuplicate(data, false); - } - - $("#patientForm :input").attr("disabled", false); - } -} - -function addPatient() -{ - $.ajax({ - type: "POST", - url: 'addPatient.action', - data: getParamsForDiv('patientForm'), - success: function(json) { - var patientId = json.message.split('_')[0]; - jQuery('#resultSearchDiv').dialog('close'); - showPatientDashboardForm( patientId ); - } - }); - return false; -} - function addEventForPatientForm( divname ) { jQuery("#" + divname + " [id=checkDuplicateBtn]").click(function() { @@ -154,17 +11,26 @@ } // ----------------------------------------------------------------------------- -// remove value of all the disabled identifier fields -// an identifier field is disabled when its value is inherited from another person ( underAge is true ) -// we don't save inherited identifiers. Only save the representative id. +// Show relationship with new patient // ----------------------------------------------------------------------------- -function removeDisabledIdentifier() +function showRelationshipList( patientId ) { - jQuery("input.idfield").each(function(){ - if( jQuery(this).is(":disabled")) - jQuery(this).val(""); - }); + hideById('addRelationshipDiv'); + hideById('patientDashboard'); + hideById('selectDiv'); + hideById('searchDiv'); + hideById('listPatientDiv'); + + jQuery('#loaderDiv').show(); + jQuery('#listRelationshipDiv').load('showRelationshipList.action', + { + id:patientId + }, function() + { + showById('listRelationshipDiv'); + jQuery('#loaderDiv').hide(); + }); } // ----------------------------------------------------------------------------- @@ -178,7 +44,7 @@ hideById('selectDiv'); hideById('searchDiv'); hideById('migrationPatientDiv'); - setInnerHTML('patientDashboard',''); + hideById('patientDashboard'); jQuery('#loaderDiv').show(); jQuery('#editPatientDiv').load('showUpdatePatientForm.action', @@ -259,6 +125,14 @@ }); } +function removeDisabledIdentifier() +{ + jQuery("input.idfield").each(function(){ + if( jQuery(this).is(":disabled")) + jQuery(this).val(""); + }); +} + /** * Show list patient duplicate by jQuery thickbox plugin * @param rootElement : root element of the response xml @@ -575,6 +449,10 @@ } +// ---------------------------------------------------------------- +// Identifiers && Attributes for selected program +// ---------------------------------------------------------------- + function saveIdentifierAndAttribute( patientId, programId, paramsDiv) { var params = getParamsForDiv(paramsDiv); @@ -591,80 +469,6 @@ }); } -//---------------------------------------------------- -// Show relationship with new patient -//---------------------------------------------------- - -function showRelationshipList( patientId ) -{ - hideById('addRelationshipDiv'); - setInnerHTML('patientDashboard',''); - - if ( getFieldValue('isShowPatientList') == 'false' ) - { - hideById('selectDiv'); - hideById('searchDiv'); - hideById('listPatientDiv'); - - jQuery('#loaderDiv').show(); - jQuery('#listRelationshipDiv').load('showRelationshipList.action', - { - id:patientId - }, function() - { - showById('listRelationshipDiv'); - jQuery('#loaderDiv').hide(); - }); - } - else - { - loadPatientList(); - } -} - -// ---------------------------------------------------------------- -// Click Back to main form -// ---------------------------------------------------------------- - -function onClickBackBtn() -{ - showById('patientManagementLbl'); - showById('selectDiv'); - showById('searchDiv'); - showById('listPatientDiv'); - - hideById('editPatientDiv'); - hideById('enrollmentDiv'); - hideById('listRelationshipDiv'); - hideById('addRelationshipDiv'); - hideById('migrationPatientDiv'); - setInnerHTML('patientDashboard',''); -} - -function loadPatientList() -{ - hideById('editPatientDiv'); - hideById('enrollmentDiv'); - hideById('listRelationshipDiv'); - hideById('addRelationshipDiv'); - hideById('dataRecordingSelectDiv'); - hideById('dataEntryFormDiv'); - hideById('migrationPatientDiv'); - - showById('patientManagementLbl'); - showById('selectDiv'); - showById('searchDiv'); - - if( statusSearching == 0) - { - listAllPatient(); - } - else if( statusSearching == 1 ) - { - validateAdvancedSearch(); - } -} - // ---------------------------------------------------------------- // Show selected data-recording // ---------------------------------------------------------------- @@ -729,16 +533,10 @@ } // ---------------------------------------------------------------- -// Load visit schedule +// List program-stage-instance of selected program // ---------------------------------------------------------------- function getVisitSchedule( programInstanceId ) { $('#tab-3').load("getVisitSchedule.action", {programInstanceId:programInstanceId}); } - -// ---------------------------------------------------------------- -// Cosmetic UI -// ---------------------------------------------------------------- - -function reloadOneRecord(){} === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patientForm.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patientForm.js 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/patientForm.js 2012-09-24 05:02:17 +0000 @@ -0,0 +1,244 @@ + +function organisationUnitSelected( orgUnits, orgUnitNames ) +{ + showById('selectDiv'); + showById('searchDiv'); + hideById('listPatientDiv'); + hideById('editPatientDiv'); + hideById('enrollmentDiv'); + hideById('listRelationshipDiv'); + hideById('addRelationshipDiv'); + hideById('migrationPatientDiv'); + hideById('patientDashboard'); + enable('listPatientBtn'); + enable('addPatientBtn'); + enable('advancedSearchBtn'); + setFieldValue("orgunitName", orgUnitNames[0]); +} + +selection.setListenerFunction( organisationUnitSelected ); + +// ----------------------------------------------------------------------------- +// List && Search patients +// ----------------------------------------------------------------------------- + +function listAllPatient() +{ + hideById('listPatientDiv'); + hideById('editPatientDiv'); + hideById('migrationPatientDiv'); + + jQuery('#loaderDiv').show(); + contentDiv = 'listPatientDiv'; + jQuery('#listPatientDiv').load('searchRegistrationPatient.action',{ + listAll:true + }, + function(){ + statusSearching = 0; + showById('listPatientDiv'); + jQuery('#loaderDiv').hide(); + }); + hideLoader(); +} + +function advancedSearch( params ) +{ + $.ajax({ + url: 'searchRegistrationPatient.action', + type:"POST", + data: params, + success: function( html ){ + statusSearching = 1; + setInnerHTML( 'listPatientDiv', html ); + showById('listPatientDiv'); + setFieldValue('listAll',false); + jQuery( "#loaderDiv" ).hide(); + } + }); +} + +// ----------------------------------------------------------------------------- +// Remove patient +// ----------------------------------------------------------------------------- + +function removePatient( patientId, fullName ) +{ + removeItem( patientId, fullName, i18n_confirm_delete, 'removePatient.action' ); +} + +// ----------------------------------------------------------------------------- +// Add Patient +// ----------------------------------------------------------------------------- + +function showAddPatientForm() +{ + hideById('listPatientDiv'); + hideById('selectDiv'); + hideById('searchDiv'); + hideById('migrationPatientDiv'); + + jQuery('#loaderDiv').show(); + jQuery('#editPatientDiv').load('showAddPatientForm.action' + , function() + { + showById('editPatientDiv'); + jQuery('#loaderDiv').hide(); + }); + +} + +function validateAddPatient() +{ + $("#patientForm :input").attr("disabled", true); + $.ajax({ + type: "POST", + url: 'validatePatient.action', + data: getParamsForDiv('patientForm'), + success:addValidationCompleted + }); +} + +function addValidationCompleted( data ) +{ + var type = jQuery(data).find('message').attr('type'); + var message = jQuery(data).find('message').text(); + + if ( type == 'success' ) + { + removeDisabledIdentifier( ); + addPatient(); + } + else + { + if ( type == 'error' ) + { + showErrorMessage( i18n_adding_patient_failed + ':' + '\n' + message ); + } + else if ( type == 'input' ) + { + showWarningMessage( message ); + } + else if( type == 'duplicate' ) + { + showListPatientDuplicate(data, false); + } + + $("#patientForm :input").attr("disabled", false); + } +} + +function addPatient() +{ + $.ajax({ + type: "POST", + url: 'addPatient.action', + data: getParamsForDiv('patientForm'), + success: function(json) { + var patientId = json.message.split('_')[0]; + jQuery('#resultSearchDiv').dialog('close'); + showPatientDashboardForm( patientId ); + } + }); + return false; +} + +// ---------------------------------------------------------------- +// Click Back to main form +// ---------------------------------------------------------------- + +function onClickBackBtn() +{ + showById('mainLinkLbl'); + showById('selectDiv'); + showById('searchDiv'); + showById('listPatientDiv'); + + hideById('editPatientDiv'); + hideById('enrollmentDiv'); + hideById('listRelationshipDiv'); + hideById('addRelationshipDiv'); + hideById('migrationPatientDiv'); + setInnerHTML('patientDashboard',''); +} + +function loadPatientList() +{ + hideById('editPatientDiv'); + hideById('enrollmentDiv'); + hideById('listRelationshipDiv'); + hideById('addRelationshipDiv'); + hideById('dataRecordingSelectDiv'); + hideById('dataEntryFormDiv'); + hideById('migrationPatientDiv'); + + showById('mainLinkLbl'); + showById('selectDiv'); + showById('searchDiv'); + + if( statusSearching == 0) + { + listAllPatient(); + } + else if( statusSearching == 1 ) + { + validateAdvancedSearch(); + } +} + +//------------------------------------------------------------------------------ +// Load data entry form +//------------------------------------------------------------------------------ + +function loadDataEntry( programStageInstanceId ) +{ + setInnerHTML('dataEntryFormDiv', ''); + showById('dataEntryFormDiv'); + showById('executionDateTB'); + showById('inputCriteriaDiv'); + setFieldValue( 'dueDate', '' ); + setFieldValue( 'executionDate', '' ); + disable('validationBtn'); + disableCompletedButton(true); + disable('uncompleteBtn'); + + jQuery(".stage-object-selected").removeClass('stage-object-selected'); + var selectedProgramStageInstance = jQuery( '#' + prefixId + programStageInstanceId ); + selectedProgramStageInstance.addClass('stage-object-selected'); + setFieldValue( 'programStageId', selectedProgramStageInstance.attr('psid') ); + + showLoader(); + $( '#dataEntryFormDiv' ).load( "dataentryform.action", + { + programStageInstanceId: programStageInstanceId + },function( ) + { + var executionDate = jQuery('#executionDate').val(); + var completed = jQuery('#entryFormContainer input[id=completed]').val(); + var irregular = jQuery('#entryFormContainer input[id=irregular]').val(); + var reportDateDes = jQuery("#ps_" + programStageInstanceId).attr("reportDateDes"); + setInnerHTML('reportDateDescriptionField',reportDateDes); + enable('validationBtn'); + if( executionDate == '' ) + { + disable('validationBtn'); + } + else if( executionDate != '' && completed == 'false' ) + { + disableCompletedButton(false); + } + else if( completed == 'true' ) + { + disableCompletedButton(true); + } + resize(); + hideLoader(); + hideById('contentDiv'); + jQuery('#dueDate').focus(); + } ); +} + +// ---------------------------------------------------------------- +// Cosmetic UI +// ---------------------------------------------------------------- + +function reloadOneRecord(){} === 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 15:52:58 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/relationshipPatient.js 2012-09-24 05:02:17 +0000 @@ -1,54 +1,3 @@ -//------------------------------------------------------------------------------ -// Load data entry form -//------------------------------------------------------------------------------ - -function loadDataEntry( programStageInstanceId ) -{ - setInnerHTML('dataEntryFormDiv', ''); - showById('dataEntryFormDiv'); - showById('executionDateTB'); - showById('inputCriteriaDiv'); - setFieldValue( 'dueDate', '' ); - setFieldValue( 'executionDate', '' ); - disable('validationBtn'); - disableCompletedButton(true); - disable('uncompleteBtn'); - - jQuery(".stage-object-selected").removeClass('stage-object-selected'); - var selectedProgramStageInstance = jQuery( '#' + prefixId + programStageInstanceId ); - selectedProgramStageInstance.addClass('stage-object-selected'); - setFieldValue( 'programStageId', selectedProgramStageInstance.attr('psid') ); - - showLoader(); - $( '#dataEntryFormDiv' ).load( "dataentryform.action", - { - programStageInstanceId: programStageInstanceId - },function( ) - { - var executionDate = jQuery('#executionDate').val(); - var completed = jQuery('#entryFormContainer input[id=completed]').val(); - var irregular = jQuery('#entryFormContainer input[id=irregular]').val(); - var reportDateDes = jQuery("#ps_" + programStageInstanceId).attr("reportDateDes"); - setInnerHTML('reportDateDescriptionField',reportDateDes); - enable('validationBtn'); - if( executionDate == '' ) - { - disable('validationBtn'); - } - else if( executionDate != '' && completed == 'false' ) - { - disableCompletedButton(false); - } - else if( completed == 'true' ) - { - disableCompletedButton(true); - } - resize(); - hideLoader(); - hideById('contentDiv'); - jQuery('#dueDate').focus(); - } ); -} //------------------------------------------------------------------------------ // Add Relationship === 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-23 12:58:02 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js 2012-09-24 05:02:17 +0000 @@ -1,7 +1,21 @@ function orgunitSelected( orgUnits, orgUnitNames ) { - hideById("listPatientDiv"); + showById('mainLinkLbl'); + showById('searchDiv'); + hideById('listEventDiv'); + hideById('listEventDiv'); + hideById('patientDashboard'); + hideById('patientProgramTrackingDiv'); + hideById('smsManagementDiv'); + hideById('sendSmsFormDiv'); + hideById('editPatientDiv'); + hideById('resultSearchDiv'); + hideById('enrollmentDiv'); + hideById('listRelationshipDiv'); + hideById('addRelationshipDiv'); + hideById('migrationPatientDiv'); + clearListById('programIdAddPatient'); $('#contentDataRecord').html(''); setFieldValue('orgunitName', orgUnitNames[0]); @@ -28,10 +42,11 @@ function listAllPatient() { setFieldValue('listAll', "true"); - hideById('listPatientDiv'); - contentDiv = 'listPatientDiv'; + hideById('listEventDiv'); + contentDiv = 'listEventDiv'; $('#contentDataRecord').html(''); hideById('advanced-search'); + eventList = 1; var date = new Date(); var d = date.getDate() - 1; @@ -47,7 +62,7 @@ + getFieldValue('orgunitId') + "_4"; showLoader(); - jQuery('#listPatientDiv').load('getSMSPatientRecords.action', + jQuery('#listEventDiv').load('getSMSPatientRecords.action', { programId:programId, listAll:false, @@ -58,7 +73,7 @@ { setInnerHTML('searchInforLbl',i18n_list_all_patients); showById('colorHelpLink'); - showById('listPatientDiv'); + showById('listEventDiv'); resize(); hideLoader(); }); @@ -78,9 +93,10 @@ type:"POST", data: params, success: function( html ){ - jQuery('#listPatientDiv').html(html); + jQuery('#listEventDiv').html(html); showById('colorHelpLink'); - showById('listPatientDiv'); + showById('listEventDiv'); + eventList = 2; resize(); hideLoader(); } @@ -93,7 +109,7 @@ function showPatientProgramTracking(programInstanceId) { - hideById("listPatientDiv"); + hideById("listEventDiv"); hideById("searchDiv"); setInnerHTML("smsManagementDiv", ""); showLoader(); @@ -102,6 +118,7 @@ programInstanceId:programInstanceId },function( ) { + hideById('mainLinkLbl'); showById('patientProgramTrackingDiv'); hideLoader(); }); @@ -116,8 +133,10 @@ programStageInstanceId: programStageInstanceId } , function(){ + hideById('mainLinkLbl'); + hideById('mainFormLink'); hideById('searchDiv'); - hideById('listPatientDiv'); + hideById('listEventDiv'); showById('smsManagementDiv'); }); } @@ -346,6 +365,60 @@ } // -------------------------------------------------------------------- +// Dashboard +// -------------------------------------------------------------------- + +function loadDataEntry( programStageInstanceId ) +{ + setInnerHTML('dataEntryFormDiv', ''); + showById('dataEntryFormDiv'); + showById('executionDateTB'); + showById('inputCriteriaDiv'); + setFieldValue( 'dueDate', '' ); + setFieldValue( 'executionDate', '' ); + disable('validationBtn'); + disableCompletedButton(true); + disable('uncompleteBtn'); + + jQuery(".stage-object-selected").removeClass('stage-object-selected'); + var selectedProgramStageInstance = jQuery( '#' + prefixId + programStageInstanceId ); + selectedProgramStageInstance.addClass('stage-object-selected'); + setFieldValue( 'programStageId', selectedProgramStageInstance.attr('psid') ); + + showLoader(); + $( '#dataEntryFormDiv' ).load( "dataentryform.action", + { + programStageInstanceId: programStageInstanceId + },function() + { + var executionDate = jQuery('#executionDate').val(); + var completed = jQuery('#entryFormContainer input[id=completed]').val(); + var irregular = jQuery('#entryFormContainer input[id=irregular]').val(); + var reportDateDes = jQuery("#ps_" + programStageInstanceId).attr("reportDateDes"); + setInnerHTML('reportDateDescriptionField',reportDateDes); + enable('validationBtn'); + if( executionDate == '' ) + { + disable('validationBtn'); + } + else if( executionDate != '' && completed == 'false' ) + { + disableCompletedButton(false); + } + else if( completed == 'true' ) + { + disableCompletedButton(true); + } + resize(); + hideLoader(); + hideById('contentDiv'); + jQuery('#dueDate').focus(); + }); +} + +function entryFormContainerOnReady(){} + +// -------------------------------------------------------------------- // Cosmetic UI // -------------------------------------------------------------------- @@ -387,8 +460,6 @@ hideById('ps_' + id ); } }); - jQuery(".arrow-left").hide(); - jQuery(".arrow-right").hide(); } function reloadOneRecord( programInstanceId ) @@ -412,8 +483,18 @@ function onClickBackBtn() { + showById('mainLinkLbl'); showById('searchDiv'); - showById('listPatientDiv'); + showById('listEventDiv'); + showById('migrationPatientDiv'); hideById('smsManagementDiv'); - hideById('patientProgramTrackingDiv'); + hideById('patientDashboard'); + hideById('patientProgramTrackingDiv'); + + if( eventList == 1){ + listAllPatient(); + } + else if( eventList == 2){ + validateAdvancedSearch(); + } } === 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-23 13:07:21 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientDashboard.vm 2012-09-24 05:02:17 +0000 @@ -1,5 +1,5 @@

- $i18n.getString( 'patient_management' ) + $i18n.getString( 'patient_management' ) • $i18n.getString( 'patient_dashboard' )

@@ -186,5 +186,5 @@
\ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm 2012-09-21 03:50:11 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientLocation.vm 2012-09-24 05:02:17 +0000 @@ -1,5 +1,5 @@

=== 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-23 11:52:27 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientProgramTracking.vm 2012-09-24 05:02:17 +0000 @@ -1,4 +1,9 @@ -

$programInstance.program.name

+

+ $i18n.getString( 'program_tracking' ) + • $i18n.getString( 'patient_dashboard' ) + » $!programInstance.program.name +

+ === 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-23 11:52:27 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingList.vm 2012-09-24 05:02:17 +0000 @@ -8,7 +8,11 @@ }); -

$programStageInstance.programStage.name

+

+ $i18n.getString( 'program_tracking' ) + • $i18n.getString( 'patient_dashboard' ) + » $programStageInstance.programStage.name +

@@ -52,8 +56,6 @@
- - #set($status = $programStageInstance.getEventStatus()) #if( $programStageInstance.irregular!='true' && ($status==3 || $status==4 || $status==5 ) ) === 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-21 01:28:20 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingRecords.vm 2012-09-24 05:02:17 +0000 @@ -42,7 +42,7 @@ #if($value=="") #set($value=$patient.getFullName()) #end - + » === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm 2012-09-21 01:28:20 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programTrackingSelect.vm 2012-09-24 05:02:17 +0000 @@ -1,3 +1,6 @@ + + + -

$i18n.getString( "program_tracking" )

+

$i18n.getString( "program_tracking" )

@@ -33,10 +36,18 @@
-
+
+
+
+
+
+
+
+
+ #parse( "dhis-web-commons/loader/loader.vm" )