=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java' --- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java 2009-10-29 10:39:30 +0000 +++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/deletion/DeletionHandler.java 2009-12-04 14:09:09 +0000 @@ -29,6 +29,7 @@ import org.hisp.dhis.chart.Chart; import org.hisp.dhis.datadictionary.DataDictionary; +import org.hisp.dhis.dataelement.CalculatedDataElement; import org.hisp.dhis.dataelement.DataElement; import org.hisp.dhis.dataelement.DataElementCategory; import org.hisp.dhis.dataelement.DataElementCategoryCombo; @@ -119,6 +120,15 @@ { return true; } + + public void deleteCalculatedDataElement( CalculatedDataElement dataElement ) + { + } + + public boolean allowDeleteCalculatedDataElement( CalculatedDataElement dataElement ) + { + return true; + } public void deleteDataElementGroup( DataElementGroup dataElementGroup ) { === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java 2009-12-04 07:10:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java 2009-12-04 14:09:09 +0000 @@ -119,11 +119,11 @@ this.domainType = domainType; } - private String type; + private String valueType; - public void setType( String type ) + public void setValueType( String valueType ) { - this.type = type; + this.valueType = valueType; } private String aggregationOperator; @@ -287,7 +287,7 @@ dataElement.setDescription( description ); dataElement.setActive( true ); dataElement.setDomainType( domainType ); - dataElement.setType( type ); + dataElement.setType( valueType ); dataElement.setAggregationOperator( aggregationOperator ); dataElement.setUrl( url ); dataElement.setCategoryCombo( categoryCombo ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java 2009-12-04 07:10:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java 2009-12-04 14:09:09 +0000 @@ -130,11 +130,11 @@ this.domainType = domainType; } - private String type; + private String valueType; - public void setType( String type ) + public void setValueType( String valueType ) { - this.type = type; + this.valueType = valueType; } private String aggregationOperator; @@ -233,7 +233,7 @@ dataElement.setDescription( description ); dataElement.setActive( active ); dataElement.setDomainType( domainType ); - dataElement.setType( type ); + dataElement.setType( valueType ); dataElement.setAggregationOperator( aggregationOperator ); dataElement.setUrl( url ); dataElement.setCategoryCombo( categoryCombo ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ValidateDataElementAction.java' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ValidateDataElementAction.java 2009-12-04 07:10:40 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/ValidateDataElementAction.java 2009-12-04 14:09:09 +0000 @@ -110,11 +110,11 @@ this.code = code; } - private String type; + private String valueType; - public void setType( String type ) + public void setValueType( String valueType ) { - this.type = type; + this.valueType = valueType; } // ------------------------------------------------------------------------- @@ -254,7 +254,7 @@ if ( calculated != null && calculated.equals( "on" ) ) { - if ( type != null && (!type.equals( DataElement.VALUE_TYPE_INT )) ) + if ( valueType != null && (!valueType.equals( DataElement.VALUE_TYPE_INT )) ) { message = i18n.getString( "cde_must_be_number" ); === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2009-11-03 13:11:45 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/META-INF/dhis/beans.xml 2009-12-04 14:09:09 +0000 @@ -45,9 +45,6 @@ - - - - @@ -225,7 +225,7 @@ -

+

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js 2009-11-07 14:09:00 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js 2009-12-04 14:09:09 +0000 @@ -169,7 +169,7 @@ '&shortName=' + getFieldValue( 'shortName' ) + '&alternativeName=' + getFieldValue( 'alternativeName' ) + '&code=' + getFieldValue( 'code' ) + - '&type=' + getSelectValue( 'type' ) + + '&valueType=' + getSelectValue( 'valueType' ) + '&calculated=' + getCheckboxValue( 'calculated' ) + '&selectedCategoryComboId=' + getSelectValue( 'selectedCategoryComboId' ) + makeValueString('dataElementIds', getInputValuesByParentId('selectedDataElements', 'dataElementIds')) @@ -204,6 +204,9 @@ if ( type == 'success' ) { + selectAllById( "aggregationLevels" ); + selectAllById( "dataElementGroupSets" ); + var form = document.getElementById( 'addDataElementForm' ); form.submit(); } @@ -273,7 +276,7 @@ { var checkbox = document.getElementById( checkboxId ); - return ( checkbox.checked ? checkbox.value : null ); + return ( checkbox != null && checkbox.checked ? checkbox.value : null ); } /** @@ -339,6 +342,9 @@ if ( type == 'success' ) { + selectAllById( "aggregationLevels" ); + selectAllById( "dataElementGroupSets" ); + var form = document.getElementById( 'updateDataElementForm' ); form.submit(); } @@ -504,19 +510,3 @@ return; } - -function submitAddDataElement() -{ - selectAllById( "aggregationLevels" ); - selectAllById( "dataElementGroupSets" ); - - document.getElementById( "addDataElementForm" ).submit(); -} - -function submitUpdateDataElement() -{ - selectAllById( "aggregationLevels" ); - selectAllById( "dataElementGroupSets" ); - - document.getElementById( "updateDataElementForm" ).submit(); -} === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateLoad.js' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateLoad.js 2009-03-03 16:46:36 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/updateLoad.js 2009-12-04 14:09:09 +0000 @@ -2,9 +2,13 @@ window.onload = function () { var container = byId('selectedDataElements'); - var buttons = container.getElementsByTagName('button'); - for ( var i = 0, button; button = buttons[i]; i++ ) + + if ( container != null ) { - button.onclick = removeCDEDataElement; + var buttons = container.getElementsByTagName('button'); + for ( var i = 0, button; button = buttons[i]; i++ ) + { + button.onclick = removeCDEDataElement; + } } } \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm' --- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm 2009-11-07 21:25:35 +0000 +++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm 2009-12-04 14:09:09 +0000 @@ -248,7 +248,7 @@ -

+