dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #19965
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 8938: Added property CategoryCombo.skipTotal. This indicates whether the total value for each data elem...
------------------------------------------------------------
revno: 8938
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-11-07 17:39:18 +0300
message:
Added property CategoryCombo.skipTotal. This indicates whether the total value for each data element should be displayed in reports.
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryCombo.hbm.xml
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/AddDataElementCategoryComboAction.java
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/UpdateDataElementCategoryComboAction.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/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm
dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm
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-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java 2012-10-04 16:52:13 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementCategoryCombo.java 2012-11-07 14:39:18 +0000
@@ -69,6 +69,8 @@
*/
private Set<DataElementCategoryOptionCombo> optionCombos = new HashSet<DataElementCategoryOptionCombo>();
+ private boolean skipTotal;
+
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
@@ -111,7 +113,7 @@
public boolean doTotal()
{
- return optionCombos != null && optionCombos.size() > 1;
+ return optionCombos != null && optionCombos.size() > 1 && !skipTotal;
}
public boolean doSubTotals()
@@ -298,6 +300,19 @@
this.optionCombos = optionCombos;
}
+ @JsonProperty
+ @JsonView( { DetailedView.class, ExportView.class } )
+ @JacksonXmlProperty( namespace = Dxf2Namespace.NAMESPACE )
+ public boolean isSkipTotal()
+ {
+ return skipTotal;
+ }
+
+ public void setSkipTotal( boolean skipTotal )
+ {
+ this.skipTotal = skipTotal;
+ }
+
@Override
public void mergeWith( IdentifiableObject other )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2012-11-07 13:38:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java 2012-11-07 14:39:18 +0000
@@ -466,6 +466,8 @@
executeSql( "UPDATE dataset SET skipaggregation = false WHERE skipaggregation IS NULL" );
executeSql( "UPDATE dataset SET skipoffline = false WHERE skipoffline IS NULL" );
+ executeSql( "UPDATE categorycombo SET skiptotal = false WHERE skiptotal IS NULL" );
+
// short names
executeSql( "ALTER TABLE dataelement ALTER COLUMN shortname TYPE character varying(50)" );
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryCombo.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryCombo.hbm.xml 2011-11-03 01:02:13 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryCombo.hbm.xml 2012-11-07 14:39:18 +0000
@@ -29,6 +29,8 @@
<many-to-many class="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" column="categoryoptioncomboid"
foreign-key="fk_categorycombo_categoryoptioncomboid" unique="true" />
</set>
+
+ <property name="skipTotal" />
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/AddDataElementCategoryComboAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/AddDataElementCategoryComboAction.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/AddDataElementCategoryComboAction.java 2012-11-07 14:39:18 +0000
@@ -60,13 +60,20 @@
// Input
// -------------------------------------------------------------------------
- private String name;;
+ private String name;
public void setName( String name )
{
this.name = name;
}
+ private boolean skipTotal;
+
+ public void setSkipTotal( boolean skipTotal )
+ {
+ this.skipTotal = skipTotal;
+ }
+
private Collection<String> selectedList = new HashSet<String>();
public void setSelectedList( Collection<String> selectedList )
@@ -82,6 +89,7 @@
{
DataElementCategoryCombo dataElementCategoryCombo = new DataElementCategoryCombo();
dataElementCategoryCombo.setName( name );
+ dataElementCategoryCombo.setSkipTotal( skipTotal );
List<DataElementCategory> categories = new ArrayList<DataElementCategory>();
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/UpdateDataElementCategoryComboAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/UpdateDataElementCategoryComboAction.java 2012-10-02 16:52:49 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/java/org/hisp/dhis/dd/action/categorycombo/UpdateDataElementCategoryComboAction.java 2012-11-07 14:39:18 +0000
@@ -74,6 +74,13 @@
this.name = name;
}
+ private boolean skipTotal;
+
+ public void setSkipTotal( boolean skipTotal )
+ {
+ this.skipTotal = skipTotal;
+ }
+
private Collection<String> selectedList = new HashSet<String>();
public void setSelectedList( Collection<String> selectedList )
@@ -91,6 +98,7 @@
.getDataElementCategoryCombo( id );
dataElementCategoryCombo.setName( name );
+ dataElementCategoryCombo.setSkipTotal( skipTotal );
List<DataElementCategory> updatedCategories = new ArrayList<DataElementCategory>();
=== 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 2012-11-05 18:32:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/resources/org/hisp/dhis/dd/i18n_module.properties 2012-11-07 14:39:18 +0000
@@ -195,4 +195,5 @@
formula=Formula
long_text = Long text
text_type = Text type
-legend_set=Legend set
\ No newline at end of file
+legend_set=Legend set
+skip_total_in_reports=Skip category total in reports
\ 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/multidimensional/addDataElementCategoryComboForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm 2012-09-25 02:21:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/addDataElementCategoryComboForm.vm 2012-11-07 14:39:18 +0000
@@ -36,9 +36,19 @@
</thead>
<tbody>
<tr>
- <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td style="width:120px"><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td><input type="text" id="name" name="name" style="width:20em"/></td>
- </tr>
+ </tr>
+ <tr>
+ <td><label>$i18n.getString( "skip_total_in_reports" )</label></td>
+ <td>
+ <select id="skipTotal" name="skipTotal">
+ <option value="false" selected="selected">$i18n.getString( "no" )</option>
+ <option value="true" >$i18n.getString( "yes" )</option>
+ </select>
+ </td>
+ </tr>
+ </tr>
<tr>
<td colspan="2" style="height:15px"></td>
</tr>
=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm 2012-09-25 02:21:14 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/multidimensional/updateDataElementCategoryComboForm.vm 2012-11-07 14:39:18 +0000
@@ -41,10 +41,20 @@
</thead>
<tbody>
<tr>
- <td><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
+ <td style="width:120px"><label>$i18n.getString( "name" ) <em title="$i18n.getString( 'required' )" class="required">*</em></label></td>
<td><input type="text" id="name" name="name" style="width:20em" value="$encoder.htmlEncode( $dataElementCategoryCombo.name )"/></td>
</tr>
<tr>
+ <td><label>$i18n.getString( "skip_total_in_reports" )</label></td>
+ <td>
+ <select id="skipTotal" name="skipTotal">
+ <option value="false" selected="selected">$i18n.getString( "no" )</option>
+ <option value="true" #if( $dataElementCategoryCombo.skipTotal ) selected="selected"#end>$i18n.getString( "yes" )</option>
+ </select>
+ </td>
+ </tr>
+ </tr>
+ <tr>
<td colspan="2" style="height:15px"></td>
</tr>
</tbody>
=== 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 2012-11-05 18:32:08 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm 2012-11-07 14:39:18 +0000
@@ -120,8 +120,8 @@
<td><label for="zeroIsSignificant ">$i18n.getString( "store_zero_data_values" )</label></td>
<td>
<select id="zeroIsSignificant" name="zeroIsSignificant">
- <option value="false"#if(!$dataElement.zeroIsSignificant) selected="selected" #end >$i18n.getString( "no" )</option>
- <option value="true" #if($dataElement.zeroIsSignificant) selected="selected" #end >$i18n.getString( "yes" )</option>
+ <option value="false">$i18n.getString( "no" )</option>
+ <option value="true" #if( $dataElement.zeroIsSignificant ) selected="selected" #end>$i18n.getString( "yes" )</option>
</select>
<script>
if( '$dataElement.type' == 'int' ){