dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #10335
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2839: add zeroIsSignificant selection when add/update datelement, show Number data element only in avai...
------------------------------------------------------------
revno: 2839
committer: Tri <Tri@Tri-Laptop>
branch nick: dhis2
timestamp: Mon 2011-02-14 11:01:17 +0700
message:
add zeroIsSignificant selection when add/update datelement, show Number data element only in available when set zeroIsSignificant DE in data daministation
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java
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/UpdateDataElementAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module_vi_VN.properties
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm
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/updateDataElementForm.vm
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java 2011-01-13 10:50:02 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/hibernate/HibernateDataElementStore.java 2011-02-14 04:01:17 +0000
@@ -288,6 +288,7 @@
Criteria criteria = session.createCriteria( DataElement.class );
criteria.add( Restrictions.eq( "zeroIsSignificant", zeroIsSignificant ) );
+ criteria.add( Restrictions.eq( "type", DataElement.VALUE_TYPE_INT ) );
return criteria.list();
}
=== 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 2011-02-01 08:11:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/AddDataElementAction.java 2011-02-14 04:01:17 +0000
@@ -189,6 +189,13 @@
this.selectedCategoryComboId = selectedCategoryComboId;
}
+ private Boolean zeroIsSignificant;
+
+ public void setZeroIsSignificant( Boolean zeroIsSignificant )
+ {
+ this.zeroIsSignificant = zeroIsSignificant;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -289,6 +296,8 @@
dataElement.setCategoryCombo( categoryCombo );
dataElement.setAggregationLevels( new ArrayList<Integer>( ConversionUtils
.getIntegerCollection( aggregationLevels ) ) );
+
+ dataElement.setZeroIsSignificant( zeroIsSignificant );
dataElementService.addDataElement( dataElement );
=== 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 2011-02-01 08:11:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/dataelement/UpdateDataElementAction.java 2011-02-14 04:01:17 +0000
@@ -202,6 +202,13 @@
this.selectedCategoryComboId = selectedCategoryComboId;
}
+ private Boolean zeroIsSignificant;
+
+ public void setZeroIsSignificant( Boolean zeroIsSignificant )
+ {
+ this.zeroIsSignificant = zeroIsSignificant;
+ }
+
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
@@ -250,6 +257,8 @@
dataElement.setCategoryCombo( categoryCombo );
dataElement.setAggregationLevels( new ArrayList<Integer>( ConversionUtils
.getIntegerCollection( aggregationLevels ) ) );
+ dataElement.setZeroIsSignificant( zeroIsSignificant );
+
// ---------------------------------------------------------------------
// Calculated data element
@@ -301,7 +310,7 @@
Set<DataSet> dataSets = dataElement.getDataSets();
for ( DataSet dataSet : dataSets )
{
- if ( dataSet.getMobile() != null && dataSet.getMobile())
+ if ( dataSet.getMobile() != null && dataSet.getMobile() )
{
dataSet.setVersion( dataSet.getVersion() + 1 );
dataSetService.updateDataSet( dataSet );
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2010-12-10 07:45:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2011-02-14 04:01:17 +0000
@@ -349,4 +349,5 @@
positiveNumber = Positive Number
negativeNumber = Negative Number
view_1 = View 1
-view_2 = View 2
\ No newline at end of file
+view_2 = View 2
+store_zero_data_values = Store Zero Data Value
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module_vi_VN.properties'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module_vi_VN.properties 2010-12-09 06:15:40 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module_vi_VN.properties 2011-02-14 04:01:17 +0000
@@ -114,4 +114,5 @@
saving_concept_failed = Qu\u00e1 tr\u00ecnh l\u01b0u concept th\u1ea5t b\u1ea1i
regex_add_edit_concept = Ch\u1ec9 nh\u1eadp c\u00e1c k\u00fd t\u1ef1 Alphabet (a-z A-Z), S\u1ed1 (0-9) v\u00e0 D\u1ea5u g\u1ea1ch d\u01b0\u1edbi (_)
data_element_category_concept = Data Element Category Concept
-intro_data_element_category_concept = T\u1ea1o m\u1edbi, ch\u1ec9nh s\u1eeda, xem v\u00e0 x\u00f3a Concept. M\u1ed9t Concept c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng b\u1edfi Category.
\ No newline at end of file
+intro_data_element_category_concept = T\u1ea1o m\u1edbi, ch\u1ec9nh s\u1eeda, xem v\u00e0 x\u00f3a Concept. M\u1ed9t Concept c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng b\u1edfi Category.
+store_zero_data_values = L\u01b0u gi\u00e1 tr\u1ecb 0
\ 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/addDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2011-02-01 08:11:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm 2011-02-14 04:01:17 +0000
@@ -78,6 +78,16 @@
</select>
</td>
</tr>
+ <tr>
+ <td><label for="zeroIsSignificant ">$i18n.getString( "store_zero_data_values" )</label></td>
+ <td>
+ <select id="zeroIsSignificant" name="zeroIsSignificant" style="min-width:20em">
+ <option value="" selected=selected>$i18n.getString( "select" )</option>
+ <option value="true" >$i18n.getString( "yes" )</option>
+ <option value="false">$i18n.getString( "no" )</option>
+ </select>
+ </td>
+ </tr>
<tr id="aggregationOperator">
<td><label for="aggregationOperator">$i18n.getString( "aggregation_operator" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
=== 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 2010-12-06 05:46:01 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/javascript/dataElement.js 2011-02-14 04:01:17 +0000
@@ -2,8 +2,10 @@
{
if( value == 'int' ){
enable( 'calculated' );
+ enable( 'zeroIsSignificant' );
}else{
disable( 'calculated' );
+ disable( 'zeroIsSignificant' );
}
updateAggreationOperation( value );
=== 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 2011-02-01 08:11:57 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm 2011-02-14 04:01:17 +0000
@@ -100,6 +100,23 @@
</td>
</tr>
<tr>
+ <td><label for="zeroIsSignificant ">$i18n.getString( "store_zero_data_values" )</label></td>
+ <td>
+ <select id="zeroIsSignificant" name="zeroIsSignificant" style="min-width:20em">
+ <option value="" selected=selected>$i18n.getString( "select" )</option>
+ <option value="true" #if($dataElement.zeroIsSignificant) selected="selected" #end >$i18n.getString( "yes" )</option>
+ <option value="false"#if(!$dataElement.zeroIsSignificant) selected="selected" #end >$i18n.getString( "no" )</option>
+ </select>
+ <script>
+ if( '$dataElement.type' == 'int' ){
+ enable('zeroIsSignificant');
+ }else{
+ disable('zeroIsSignificant');
+ }
+ </script>
+ </td>
+ </tr>
+ <tr>
<td><label for="aggregationOperator" id="lblOperator">$i18n.getString( "aggregation_operator" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td>
<select id="aggregationOperator" name="aggregationOperator" style="min-width:20em">