=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeGroupService.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeGroupService.java 2012-09-11 13:35:26 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/DefaultPatientAttributeGroupService.java 2013-02-04 16:14:38 +0000 @@ -26,8 +26,11 @@ */ package org.hisp.dhis.patient; +import static org.hisp.dhis.i18n.I18nUtils.i18n; + import java.util.Collection; +import org.hisp.dhis.i18n.I18nService; import org.springframework.transaction.annotation.Transactional; /** @@ -49,6 +52,13 @@ this.patientAttributeGroupStore = patientAttributeGroupStore; } + private I18nService i18nService; + + public void setI18nService( I18nService service ) + { + i18nService = service; + } + // ------------------------------------------------------------------------- // Implementation methods // ------------------------------------------------------------------------- @@ -70,17 +80,17 @@ public PatientAttributeGroup getPatientAttributeGroup( int id ) { - return patientAttributeGroupStore.get( id ); + return i18n( i18nService, patientAttributeGroupStore.get( id ) ); } public PatientAttributeGroup getPatientAttributeGroupByName( String name ) { - return patientAttributeGroupStore.getByName( name ); + return i18n( i18nService, patientAttributeGroupStore.getByName( name ) ); } public Collection getAllPatientAttributeGroups() { - return patientAttributeGroupStore.getAll(); + return i18n( i18nService, patientAttributeGroupStore.getAll() ); } - + } === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-04 03:09:04 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/META-INF/dhis/beans.xml 2013-02-04 16:14:38 +0000 @@ -302,6 +302,7 @@ class="org.hisp.dhis.patient.DefaultPatientAttributeGroupService"> + >(); for ( PatientAttribute patientAttribute : patientAttributes ) { - PatientAttributeGroup attributeGroup = patientAttribute.getPatientAttributeGroup(); - if ( attributeGroup != null ) + if ( !patientAttribute.getValueType().equals( PatientAttribute.TYPE_CALCULATED ) ) { - if ( attributeGroupsMap.containsKey( attributeGroup ) ) + PatientAttributeGroup attributeGroup = patientAttribute.getPatientAttributeGroup(); + if ( attributeGroup != null ) { - Collection attributes = attributeGroupsMap.get( attributeGroup ); - attributes.add( patientAttribute ); + if ( attributeGroupsMap.containsKey( attributeGroup ) ) + { + Collection attributes = attributeGroupsMap.get( attributeGroup ); + attributes.add( patientAttribute ); + } + else + { + Collection attributes = new HashSet(); + attributes.add( patientAttribute ); + attributeGroupsMap.put( attributeGroup, attributes ); + } } else { - Collection attributes = new HashSet(); - attributes.add( patientAttribute ); - attributeGroupsMap.put( attributeGroup, attributes ); + noGroupAttributes.add( patientAttribute ); } } - else - { - noGroupAttributes.add( patientAttribute ); - } } } return SUCCESS; } - } === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2013-02-01 08:40:49 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/patientForm.vm 2013-02-04 16:14:38 +0000 @@ -138,10 +138,10 @@ #end - + #foreach ($attributeGroup in $attributeGroupsMap.keySet() )   - $attributeGroup.name + $attributeGroup.displayName #set($attributes = $attributeGroupsMap.get($attributeGroup)) #foreach($attribute in $attributes ) #set($value = "") @@ -182,7 +182,7 @@ #if ( $noGroupAttributes && $noGroupAttributes.size() > 0) - $i18n.getString( "Other details" ) + $i18n.getString( "other_details" ) #foreach($attribute in $noGroupAttributes ) #if( $!attribute && $attribute.program ) #elseif( $!attribute ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroup.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroup.vm 2012-10-30 04:15:41 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/patientAttributeGroup.vm 2013-02-04 16:14:38 +0000 @@ -7,36 +7,29 @@ - - - + - - + #foreach( $patientAttributeGroup in $patientAttributeGroups ) - + - - - - -
+
$i18n.getString( "name" )$i18n.getString( "operations" )$i18n.getString( "operations" )
$encoder.htmlEncode( $patientAttributeGroup.name )$encoder.htmlEncode( $patientAttributeGroup.displayName ) + $i18n.getString( 'edit' ) - - $i18n.getString( 'remove' ) - + $i18n.getString( 'translation_translate' ) + $i18n.getString( 'remove' ) $i18n.getString( 'show_details' )