=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java 2012-09-05 14:30:23 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/ShowEventWithRegistrationFormAction.java 2012-10-11 14:31:43 +0000 @@ -47,6 +47,7 @@ import org.hisp.dhis.program.ProgramService; import org.hisp.dhis.program.ProgramStage; import org.hisp.dhis.program.ProgramStageDataElement; +import org.hisp.dhis.user.User; import com.opensymphony.xwork2.Action; @@ -117,6 +118,8 @@ private ProgramStage programStage; + private Collection healthWorkers; + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -132,19 +135,20 @@ patientAttributes.removeAll( program.getPatientAttributes() ); } - for( PatientAttribute patientAttribute : patientAttributes ) + for ( PatientAttribute patientAttribute : patientAttributes ) { PatientAttributeGroup attributeGroup = patientAttribute.getPatientAttributeGroup(); - if( attributeGroup!=null){ - if( attributeGroupsMap.containsKey( attributeGroup ) ) + if ( attributeGroup != null ) + { + if ( attributeGroupsMap.containsKey( attributeGroup ) ) { Collection attributes = attributeGroupsMap.get( attributeGroup ); - attributes.add(patientAttribute); + attributes.add( patientAttribute ); } else { - Collection attributes = new HashSet(); - attributes.add(patientAttribute); + Collection attributes = new HashSet(); + attributes.add( patientAttribute ); attributeGroupsMap.put( attributeGroup, attributes ); } } @@ -153,7 +157,7 @@ noGroupAttributes.add( patientAttribute ); } } - + organisationUnit = selectionManager.getSelectedOrganisationUnit(); // Get data entry form @@ -162,18 +166,12 @@ programStage = program.getProgramStages().iterator().next(); - DataEntryForm dataEntryForm = programStage.getDataEntryForm(); - - if ( dataEntryForm != null ) - { - customDataEntryFormCode = programDataEntryService.prepareDataEntryFormForEdit( dataEntryForm.getHtmlCode() ); - } - else - { - programStageDataElements = new ArrayList( - programStage.getProgramStageDataElements() ); - } - + programStageDataElements = new ArrayList( programStage.getProgramStageDataElements() ); + + // Get health workers + + healthWorkers = organisationUnit.getUsers(); + return SUCCESS; } @@ -181,6 +179,11 @@ // Getter/Setter // ------------------------------------------------------------------------- + public Collection getHealthWorkers() + { + return healthWorkers; + } + public Collection getIdentifierTypes() { return identifierTypes; === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm 2012-08-02 06:46:14 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/addSingleEventRegistration.vm 2012-10-11 14:31:43 +0000 @@ -35,20 +35,24 @@ }); - +

+ $i18n.getString( "single_event_with_registration" ) + • + » $i18n.getString( "add_new_patient" ) +

+
-

$i18n.getString( "add_new_patient" )

#parse( "/dhis-web-caseentry/patientForm.vm" ) + + + #parse( "/dhis-web-caseentry/singleDataEntryForm.vm" )
$programStage.program.name
- -

-
#parse( "/dhis-web-caseentry/dataEntryForm.vm" )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm 2012-10-05 07:22:56 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/dataRecordingSelect.vm 2012-10-11 14:31:43 +0000 @@ -1,6 +1,7 @@

$i18n.getString( 'single_event_with_registration' ) - » + • + » $i18n.getString( "edit" )

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js 2012-10-05 06:46:22 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/singleEvent.js 2012-10-11 14:31:43 +0000 @@ -3,6 +3,7 @@ function orgunitSelected( orgUnits, orgUnitNames ) { + hideById('mainLinkLbl'); organisationUnitSelected( orgUnits, orgUnitNames ); clearListById('programIdAddPatient'); $.postJSON( 'singleEventPrograms.action', {}, function( json ) @@ -19,21 +20,23 @@ function showAddPatientForm() { hideById('contentDiv'); + hideById('mainLinkLbl'); hideById('searchDiv'); hideById('advanced-search'); setInnerHTML('addNewDiv',''); setInnerHTML('dataRecordingSelectDiv',''); - unSave = true; + jQuery('#loaderDiv').show(); jQuery('#addNewDiv').load('showEventWithRegistrationForm.action', { programId: getFieldValue('programIdAddPatient') }, function() { + setInnerHTML('singleProgramName',jQuery('#programIdAddPatient option:selected').text()); unSave = true; showById('addNewDiv'); showById('entryForm'); hideById('newEncounterBtn'); - jQuery("#dataForm :input").each(function() + jQuery("#entryForm :input").each(function() { $( this ).attr('onchange',''); $( this ).attr('onblur',''); @@ -109,7 +112,7 @@ { var params = "programId=" + getFieldValue('programIdAddPatient'); params += "&patientId=" + patientId; - params += "&" + getParamsForDiv('dataForm'); + params += "&" + getParamsForDiv('entryForm'); $.ajax({ type: "POST", @@ -128,7 +131,7 @@ } enable(this.id); }); - jQuery('#dataForm :input').each(function() + jQuery('#entryForm :input').each(function() { var type=$( this ).attr('type'); if(type!='button'){ @@ -235,6 +238,7 @@ function backMainPage() { + showById('mainLinkLbl'); showSearchForm(); if( getFieldValue('listAll')=='true'){ listAllPatient(); === added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/singleDataEntryForm.vm 2012-10-11 14:31:43 +0000 @@ -0,0 +1,88 @@ + + + $programStage.program.name + +#set( $dataElementRowCount = 0 ) +#set( $mark = true ) +#set( $tabIndex = 1 ) +#foreach( $programStageDataElement in $programStageDataElements ) + #set( $dataElementRowCount = $dataElementRowCount + 1 ) + #set( $mark = !$mark ) + #set( $patientDataValue = false ) + #set( $key = $programStageDataElement.dataElement.id ) + #set( $patientDataValue = $patientDataValueMap.get( $key ) ) + + ##data element name + + + $encoder.htmlEncode( $programStageDataElement.dataElement.formNameFallback ) + #if ( $programStageDataElement.compulsory ) + * + #end + + ##type + + + ##entry + + #set( $id = $programStageDataElement.programStage.id + '-' + $programStageDataElement.dataElement.id + '-val' ) + #if( $!programStageDataElement.dataElement.optionSet ) + #set($hasOptionSet = 'true') + #else + #set($hasOptionSet = 'false') + #end + + #set($type=$programStageDataElement.dataElement.getDetailedNumberType()) + #set($validate = '') + #if( $type=='number' ) + #set($validate="number:true") + #elseif( $type=='positiveNumber' ) + #set($validate="positive_integer:true") + #elseif( $type=='negativeNumber' ) + #set($validate="negative_integer:true") + #elseif( $type=='int' ) + #set($validate="integer:true") + #end + + #if($programStageDataElement.compulsory=='true') + #if($validate != '') + #set($validate=$validate + ",") + #end + #set($validate=$validate + "required:true") + #end + + #if( $programStageDataElement.dataElement.textType == "longText" ) + + #elseif( $programStageDataElement.dataElement.type == "bool" ) + + #elseif( $programStageDataElement.dataElement.type == "trueOnly" ) + + #elseif( $programStageDataElement.dataElement.type == "date" ) + + + #elseif($hasOptionSet=='true') + + #else + + #end + #if( $programStage.program.displayProvidedOtherFacility=='true' ) + #set( $id = $programStageDataElement.programStage.id + '_' + $programStageDataElement.dataElement.id + '_facility' ) + #if( $programStageDataElement.allowProvidedElsewhere == 'true') + + #end + #end + + + #set( $tabIndex = $tabIndex + 1 ) +#end + + +