=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml 2012-02-17 13:25:29 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml 2012-03-06 03:17:52 +0000 @@ -17,6 +17,8 @@ + + === modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml' --- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml 2011-11-23 18:07:35 +0000 +++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/organisationunit/hibernate/OrganisationUnit.hbm.xml 2012-03-06 03:17:52 +0000 @@ -26,6 +26,8 @@ + + === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataSet.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataSet.vm 2012-02-21 12:53:55 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonDataSet.vm 2012-03-06 03:17:52 +0000 @@ -3,6 +3,7 @@ "id": $!{dataSet.id}, "name": "$!encoder.jsonEncode( ${dataSet.displayName} )", "shortName": "$!encoder.jsonEncode( ${dataSet.displayShortName} )", + "description": "$!encoder.jsonEncode( ${dataSet.description} )", "periodTypeId": "$!{dataSet.periodTypeId}", "frequency": "$i18n.getString( $!{dataSet.periodType.name} )", "dataElementCount": "$!{dataSet.dataElements.size()}", === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnit.vm' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnit.vm 2010-12-22 15:06:42 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/ajax/jsonOrganisationUnit.vm 2012-03-06 03:17:52 +0000 @@ -3,6 +3,7 @@ "id": $!{organisationUnit.id}, "name": "$!encoder.jsonEncode( ${organisationUnit.name} )", "shortName": "$!encoder.jsonEncode( ${organisationUnit.shortName} )", + "description": "$!encoder.jsonEncode( ${organisationUnit.description} )", "code": "$!encoder.jsonEncode( ${organisationUnit.code} )", "openingDate": "$!{organisationUnit.openingDate}", "closedDate": "$!{organisationUnit.closedDate}", === modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js' --- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2012-02-05 13:27:40 +0000 +++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/validationRules.js 2012-03-06 03:17:52 +0000 @@ -69,6 +69,9 @@ "required" : true, "rangelength" : [ 2, 25 ] }, + "description" : { + "required" : true + }, "code" : { "rangelength" : [ 0, 25 ], "alphanumericwithbasicpuncspaces" : true, @@ -147,6 +150,9 @@ "alphanumericwithbasicpuncspaces" : true, "rangelength" : [ 2, 25 ] }, + "description" : { + "required" : true + }, "code" : { "alphanumericwithbasicpuncspaces" : true, "notOnlyDigits" : false, === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/AddDataSetAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/AddDataSetAction.java 2012-02-21 19:20:15 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/AddDataSetAction.java 2012-03-06 03:17:52 +0000 @@ -27,6 +27,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty; + import java.util.Collection; import java.util.HashSet; import java.util.Set; @@ -105,6 +107,13 @@ this.code = code; } + private String description; + + public void setDescription( String description ) + { + this.description = description; + } + private int expiryDays; public void setExpiryDays( int expiryDays ) @@ -150,23 +159,17 @@ // --------------------------------------------------------------------- // Prepare values // --------------------------------------------------------------------- - - if ( shortName != null && shortName.trim().length() == 0 ) - { - shortName = null; - } - - if ( code != null && code.trim().length() == 0 ) - { - code = null; - } + code = nullIfEmpty( code ); + shortName = nullIfEmpty( shortName ); + description = nullIfEmpty( description ); + PeriodType periodType = PeriodType.getPeriodTypeByName( frequencySelect ); DataSet dataSet = new DataSet( name, shortName, code, periodType ); dataSet.setExpiryDays( expiryDays ); - + for ( String id : dataElementsSelectedList ) { dataSet.addDataElement( dataElementService.getDataElement( Integer.parseInt( id ) ) ); @@ -179,9 +182,10 @@ indicators.add( indicatorService.getIndicator( Integer.parseInt( id ) ) ); } + dataSet.setVersion( 1 ); dataSet.setMobile( mobile ); - dataSet.setVersion( 1 ); dataSet.setIndicators( indicators ); + dataSet.setDescription( description ); dataSetService.addDataSet( dataSet ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UpdateDataSetAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UpdateDataSetAction.java 2012-02-21 19:20:15 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/java/org/hisp/dhis/dataset/action/UpdateDataSetAction.java 2012-03-06 03:17:52 +0000 @@ -43,6 +43,7 @@ import com.opensymphony.xwork2.Action; import static org.hisp.dhis.system.util.TextUtils.equalsNullSafe; +import static org.hisp.dhis.system.util.TextUtils.nullIfEmpty; /** * @author Kristian @@ -82,7 +83,7 @@ { this.indicatorService = indicatorService; } - + // ------------------------------------------------------------------------- // Input & output // ------------------------------------------------------------------------- @@ -108,6 +109,13 @@ this.code = code; } + private String description; + + public void setDescription( String description ) + { + this.description = description; + } + private int expiryDays; public void setExpiryDays( int expiryDays ) @@ -154,15 +162,9 @@ // Prepare values // --------------------------------------------------------------------- - if ( shortName != null && shortName.trim().length() == 0 ) - { - shortName = null; - } - - if ( code != null && code.trim().length() == 0 ) - { - code = null; - } + code = nullIfEmpty( code ); + shortName = nullIfEmpty( shortName ); + description = nullIfEmpty( description ); Set dataElements = new HashSet(); @@ -184,14 +186,15 @@ dataSet.setExpiryDays( expiryDays ); - if ( !( equalsNullSafe( name, dataSet.getName() ) && periodType.equals( dataSet.getPeriodType() ) && - dataElements.equals( dataSet.getDataElements() ) && indicators.equals( dataSet.getIndicators() ) ) ) + if ( !(equalsNullSafe( name, dataSet.getName() ) && periodType.equals( dataSet.getPeriodType() ) + && dataElements.equals( dataSet.getDataElements() ) && indicators.equals( dataSet.getIndicators() )) ) { - dataSet.increaseVersion(); // Check if version must be updated + dataSet.increaseVersion(); // Check if version must be updated } - + dataSet.setName( name ); dataSet.setShortName( shortName ); + dataSet.setDescription( description ); dataSet.setCode( code ); dataSet.setPeriodType( periodService.getPeriodTypeByClass( periodType.getClass() ) ); dataSet.updateDataElements( dataElements ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm 2012-02-05 13:27:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/addDataSet.vm 2012-03-06 03:17:52 +0000 @@ -61,19 +61,23 @@ - + - + + + + + - + - + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm 2011-03-18 14:20:18 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/dataSetList.vm 2012-03-06 03:17:52 +0000 @@ -71,6 +71,7 @@ $i18n.getString( 'hide_details' )


+





=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm 2012-02-05 13:27:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/editDataSet.vm 2012-03-06 03:17:52 +0000 @@ -61,19 +61,23 @@ - + - - + + + + + + - + - + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js 2012-03-04 13:46:17 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataset/src/main/webapp/dhis-web-maintenance-dataset/javascript/dataSet.js 2012-03-06 03:17:52 +0000 @@ -9,6 +9,7 @@ }, function( json ) { setInnerHTML( 'nameField', json.dataSet.name ); + setInnerHTML( 'descriptionField', json.dataSet.description ); setInnerHTML( 'frequencyField', json.dataSet.frequency ); setInnerHTML( 'dataElementCountField', json.dataSet.dataElementCount ); setInnerHTML( 'dataEntryFormField', json.dataSet.dataentryform ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java 2012-02-22 12:01:02 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/AddOrganisationUnitAction.java 2012-03-06 03:17:52 +0000 @@ -117,6 +117,13 @@ this.shortName = shortName; } + private String description; + + public void setDescription( String description ) + { + this.description = description; + } + private String code; public void setCode( String code ) @@ -231,6 +238,7 @@ { code = nullIfEmpty( code ); comment = nullIfEmpty( comment ); + description = nullIfEmpty( description ); longitude = nullIfEmpty( longitude ); latitude = nullIfEmpty( latitude ); url = nullIfEmpty( url ); @@ -263,6 +271,7 @@ OrganisationUnit organisationUnit = new OrganisationUnit( name, shortName, code, date, null, active, comment ); + organisationUnit.setDescription( description ); organisationUnit.setUrl( url ); organisationUnit.setParent( parent ); organisationUnit.setContactPerson( contactPerson ); @@ -288,19 +297,19 @@ if ( longitude != null && latitude != null ) { String coordinates = ValidationUtils.getCoordinate( longitude, latitude ); - + if ( ValidationUtils.coordinateIsValid( coordinates ) ) { organisationUnit.setCoordinates( coordinates ); organisationUnit.setFeatureType( OrganisationUnit.FEATURETYPE_POINT ); - } + } } - + // --------------------------------------------------------------------- // Must persist org unit before adding data sets because association are // updated on both sides (and this side is inverse) // --------------------------------------------------------------------- - + organisationUnitId = organisationUnitService.addOrganisationUnit( organisationUnit ); for ( String id : dataSets ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java 2012-01-20 05:42:41 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/UpdateOrganisationUnitAction.java 2012-03-06 03:17:52 +0000 @@ -126,6 +126,13 @@ this.shortName = shortName; } + private String description; + + public void setDescription( String description ) + { + this.description = description; + } + private String code; public void setCode( String code ) @@ -247,6 +254,7 @@ { code = nullIfEmpty( code ); comment = nullIfEmpty( comment ); + description = nullIfEmpty( description ); longitude = nullIfEmpty( longitude ); latitude = nullIfEmpty( latitude ); url = nullIfEmpty( url ); @@ -278,6 +286,7 @@ organisationUnit.setName( name ); organisationUnit.setShortName( shortName ); + organisationUnit.setDescription( description ); organisationUnit.setCode( code ); organisationUnit.setActive( active ); organisationUnit.setOpeningDate( oDate ); @@ -299,24 +308,25 @@ // Set coordinates and feature type to point if valid // --------------------------------------------------------------------- - boolean point = organisationUnit.getCoordinates() == null || coordinateIsValid( organisationUnit.getCoordinates() ); - + boolean point = organisationUnit.getCoordinates() == null + || coordinateIsValid( organisationUnit.getCoordinates() ); + if ( point ) { String coordinates = null; String featureType = null; - - if ( longitude != null && latitude != null && - ValidationUtils.coordinateIsValid( ValidationUtils.getCoordinate( longitude, latitude ) ) ) + + if ( longitude != null && latitude != null + && ValidationUtils.coordinateIsValid( ValidationUtils.getCoordinate( longitude, latitude ) ) ) { coordinates = ValidationUtils.getCoordinate( longitude, latitude ); featureType = OrganisationUnit.FEATURETYPE_POINT; } - + organisationUnit.setCoordinates( coordinates ); organisationUnit.setFeatureType( featureType ); } - + Set sets = new HashSet(); for ( String id : dataSets ) === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm 2012-02-22 12:01:02 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/addOrganisationUnitForm.vm 2012-03-06 03:17:52 +0000 @@ -38,6 +38,10 @@ + + + + === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js 2011-12-04 11:08:52 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/javascript/organisationUnit.js 2012-03-06 03:17:52 +0000 @@ -35,6 +35,7 @@ { id: unitId }, function ( json ) { setInnerHTML( 'nameField', json.organisationUnit.name ); setInnerHTML( 'shortNameField', json.organisationUnit.shortName ); + setInnerHTML( 'descriptionField', json.organisationUnit.description ); setInnerHTML( 'openingDateField', json.organisationUnit.openingDate ); var orgUnitCode = json.organisationUnit.code; === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnit.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnit.vm 2011-09-26 09:31:56 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/organisationUnit.vm 2012-03-06 03:17:52 +0000 @@ -64,6 +64,7 @@



+





=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm 2012-02-22 12:01:02 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/webapp/dhis-web-maintenance-organisationunit/updateOrganisationUnitForm.vm 2012-03-06 03:17:52 +0000 @@ -40,20 +40,24 @@ $i18n.getString( "details" ) - - - - - - + + + + + + + + + + - - + + #if( $numberOfChildren == 0 ) @@ -87,7 +91,7 @@ #end - + @@ -103,19 +107,19 @@ - + - + - + - + @@ -140,8 +144,8 @@ - - + + === modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm' --- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm 2012-02-05 13:08:51 +0000 +++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/viewDataCompletenessForm.vm 2012-03-06 03:17:52 +0000 @@ -14,11 +14,11 @@
- - + + - +