=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java' --- dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java 2012-03-27 01:29:30 +0000 +++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/patient/PatientAttribute.java 2012-05-24 03:10:00 +0000 @@ -69,8 +69,6 @@ private boolean inheritable; - private Integer noChars; - private Boolean groupBy; private PatientAttributeGroup patientAttributeGroup; @@ -147,16 +145,6 @@ attributeOptions.add( option ); } - public Integer getNoChars() - { - return noChars; - } - - public void setNoChars( Integer noChars ) - { - this.noChars = noChars; - } - public Boolean isGroupBy() { return groupBy; === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java' --- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-05-23 19:48:53 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2012-05-24 03:10:00 +0000 @@ -88,10 +88,13 @@ executeSql( "ALTER TABLE program DROP COLUMN singleevent" ); executeSql( "ALTER TABLE program DROP COLUMN anonymous" ); executeSql( "UPDATE program SET type=1 where type is null" ); + executeSql( "DROP TABLE programattributevalue" ); executeSql( "DROP TABLE programinstance_attributes"); executeSql( "DROP TABLE programattributeoption" ); executeSql( "DROP TABLE programattribute" ); + + executeSql( "ALTER TABLE patientattribute DROP COLUMN noChars" ); } // ------------------------------------------------------------------------- === modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml' --- dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml 2012-03-27 01:29:30 +0000 +++ dhis-2/dhis-services/dhis-service-patient/src/main/resources/org/hisp/dhis/patient/hibernate/PatientAttribute.hbm.xml 2012-05-24 03:10:00 +0000 @@ -22,8 +22,6 @@ - - #else - + #end @@ -180,7 +180,7 @@ #end #else - + #end === modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm' --- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-04-17 04:39:03 +0000 +++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/updatePatientForm.vm 2012-05-24 03:10:00 +0000 @@ -144,7 +144,7 @@ - + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java 2012-03-27 01:29:30 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/AddPatientAttributeAction.java 2012-05-24 03:10:00 +0000 @@ -95,16 +95,16 @@ this.valueType = valueType; } - private boolean mandatory; + private Boolean mandatory; - public void setMandatory( boolean mandatory ) + public void setMandatory( Boolean mandatory ) { this.mandatory = mandatory; } - private boolean inheritable; + private Boolean inheritable; - public void setInheritable( boolean inheritable ) + public void setInheritable( Boolean inheritable ) { this.inheritable = inheritable; } @@ -116,20 +116,6 @@ this.attrOptions = attrOptions; } - private Integer noChars; - - public void setNoChars( Integer noChars ) - { - this.noChars = noChars; - } - - private boolean groupBy; - - public void setGroupBy( boolean groupBy ) - { - this.groupBy = groupBy; - } - private Integer programId; public void setProgramId( Integer programId ) @@ -149,24 +135,16 @@ patientAttribute.setName( name ); patientAttribute.setDescription( description ); patientAttribute.setValueType( valueType ); + + mandatory = (mandatory == null) ? false : true; patientAttribute.setMandatory( mandatory ); + + inheritable = (inheritable == null) ? false : true; patientAttribute.setInheritable( inheritable ); - patientAttribute.setNoChars( noChars ); - + Program program = (programId != null) ? programService.getProgram( programId ) : null; patientAttribute.setProgram( program ); - patientAttribute.setGroupBy( groupBy ); - if ( groupBy ) - { - PatientAttribute patientAtt = patientAttributeService.getPatientAttributeByGroupBy( true ); - if ( patientAtt != null ) - { - patientAtt.setGroupBy( false ); - patientAttributeService.updatePatientAttribute( patientAtt ); - } - patientAttribute.setMandatory( true ); - } patientAttributeService.savePatientAttribute( patientAttribute ); if ( PatientAttribute.TYPE_COMBO.equalsIgnoreCase( valueType ) ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/UpdatePatientAttributeAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/UpdatePatientAttributeAction.java 2012-03-27 01:29:30 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/patientattribute/UpdatePatientAttributeAction.java 2012-05-24 03:10:00 +0000 @@ -117,16 +117,16 @@ this.valueType = valueType; } - private boolean mandatory; + private Boolean mandatory; - public void setMandatory( boolean mandatory ) + public void setMandatory( Boolean mandatory ) { this.mandatory = mandatory; } - private boolean inheritable; + private Boolean inheritable; - public void setInheritable( boolean inheritable ) + public void setInheritable( Boolean inheritable ) { this.inheritable = inheritable; } @@ -137,21 +137,7 @@ { this.attrOptions = attrOptions; } - - private Integer noChars; - - public void setNoChars( Integer noChars ) - { - this.noChars = noChars; - } - - private boolean groupBy; - - public void setGroupBy( boolean groupBy ) - { - this.groupBy = groupBy; - } - + private Integer programId; public void setProgramId( Integer programId ) @@ -171,24 +157,16 @@ patientAttribute.setName( name ); patientAttribute.setDescription( description ); patientAttribute.setValueType( valueType ); + + mandatory = (mandatory == null) ? false : true; patientAttribute.setMandatory( mandatory ); + + inheritable = (inheritable == null) ? false : true; patientAttribute.setInheritable( inheritable ); - patientAttribute.setNoChars( noChars ); + Program program = (programId != null) ? programService.getProgram( programId ) : null; patientAttribute.setProgram( program ); - if ( groupBy ) - { - PatientAttribute patientAtt = patientAttributeService.getPatientAttributeByGroupBy( true ); - if ( patientAtt != null ) - { - patientAtt.setGroupBy( false ); - patientAttributeService.updatePatientAttribute( patientAtt ); - } - patientAttribute.setMandatory( true ); - } - patientAttribute.setGroupBy( groupBy ); - HttpServletRequest request = ServletActionContext.getRequest(); Collection attributeOptions = patientAttributeOptionService.get( patientAttribute ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2012-05-23 19:48:53 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/resources/struts.xml 2012-05-24 03:10:00 +0000 @@ -144,8 +144,7 @@ /main.vm /dhis-web-maintenance-patient/updatePatientAttibuteForm.vm - javascript/patientAttribute.js - ,../dhis-web-commons/javascripts/jQuery/ui/jquery.cluetip.min.js + javascript/patientAttribute.js style/basic.css F_PATIENTATTRIBUTE_UPDATE === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm 2012-03-27 01:29:30 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/webapp/dhis-web-maintenance-patient/addPatientAttributeForm.vm 2012-05-24 03:10:00 +0000 @@ -24,10 +24,7 @@ - + @@ -35,17 +32,7 @@ - - - - - - - - + @@ -83,10 +70,6 @@ - -