← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5533: Harmonization of png and DV charts

 

------------------------------------------------------------
revno: 5533
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-22 01:00:00 +0100
message:
  Harmonization of png and DV charts
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartIndicatorModeForm.vm
  dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartPeriodModeForm.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/chart/Chart.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-12-21 22:11:29 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/Chart.java	2011-12-22 00:00:00 +0000
@@ -251,6 +251,7 @@
         for ( Period period : periods )
         {
             period.setName( format.formatPeriod( period ) );
+            period.setShortName( format.formatPeriod( period ) );
         }
     }
     

=== 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	2011-12-21 22:11:29 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/startup/TableAlteror.java	2011-12-22 00:00:00 +0000
@@ -259,6 +259,11 @@
         executeSql( "ALTER TABLE chart DROP COLUMN size" );
         executeSql( "ALTER TABLE chart DROP COLUMN verticallabels" );
         executeSql( "ALTER TABLE chart DROP COLUMN horizontalplotorientation" );
+
+        executeSql( "ALTER TABLE chart DROP COLUMN monthsLastYear" );
+        executeSql( "ALTER TABLE chart DROP COLUMN quartersLastYear" );
+        executeSql( "ALTER TABLE chart DROP COLUMN lastYear" );
+        executeSql( "ALTER TABLE chart DROP COLUMN last6BiMonths" );
         
         // remove outdated relative periods
         
@@ -354,8 +359,6 @@
         // replace null with false for boolean fields
         
         executeSql( "update chart set hidelegend = false where hidelegend is null" );
-        executeSql( "update chart set verticallabels = false where verticallabels is null" );
-        executeSql( "update chart set horizontalplotorientation = false where horizontalplotorientation is null" );
         executeSql( "update chart set regression = false where regression is null" );
         executeSql( "update chart set targetline = false where targetline is null" );
         executeSql( "update chart set hidesubtitle = false where hidesubtitle is null" );
@@ -391,6 +394,8 @@
         executeSql( "update chart set monthslastyear = false where monthslastyear is null" );
         executeSql( "update chart set quarterslastyear = false where quarterslastyear is null" );
         executeSql( "update chart set lastyear = false where lastyear is null" );
+        executeSql( "update chart set lastsixmonth = false where lastsixmonth is null" );
+        executeSql( "update chart set last12months = false where last12months is null" );
         executeSql( "update chart set last5years = false where last5years is null" );
         executeSql( "update chart set last4quarters = false where last4quarters is null" );
         executeSql( "update chart set last12months = false where last12months is null" );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2011-12-21 20:41:22 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml	2011-12-22 00:00:00 +0000
@@ -83,19 +83,13 @@
 
     <component name="relatives">
       <property name="reportingMonth" />
-      <property name="reportingBimonth" />
       <property name="reportingQuarter" />
-      <property name="monthsThisYear" />
-      <property name="quartersThisYear" />
+      <property name="lastSixMonth" />
       <property name="thisYear" />
-      <property name="monthsLastYear" />
-      <property name="quartersLastYear" />
-      <property name="lastYear" />
-      <property name="last5Years" />
       <property name="last12Months" />
-      <property name="last6BiMonths" />
       <property name="last4Quarters" />
       <property name="last2SixMonths" />
+      <property name="last5Years" />
     </component>
 
     <property name="userOrganisationUnit" not-null="true" />

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-12-21 20:41:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/chart/action/SaveChartAction.java	2011-12-22 00:00:00 +0000
@@ -248,27 +248,34 @@
         this.selectedDataSets = selectedDataSets;
     }
 
-    private boolean reportingMonth;
-
-    public void setReportingMonth( boolean reportingMonth )
-    {
-        this.reportingMonth = reportingMonth;
-    }
-
-    private boolean reportingBimonth;
-
-    public void setReportingBimonth( boolean reportingBimonth )
-    {
-        this.reportingBimonth = reportingBimonth;
-    }
-
-    private boolean reportingQuarter;
-
-    public void setReportingQuarter( boolean reportingQuarter )
-    {
-        this.reportingQuarter = reportingQuarter;
-    }
-    
+    private boolean lastMonth;
+
+    public void setLastMonth( boolean lastMonth )
+    {
+        this.lastMonth = lastMonth;
+    }
+
+    private boolean last12Months;
+
+    public void setLast12Months( boolean last12Months )
+    {
+        this.last12Months = last12Months;
+    }
+
+    private boolean lastQuarter;
+
+    public void setLastQuarter( boolean lastQuarter )
+    {
+        this.lastQuarter = lastQuarter;
+    }
+
+    private boolean last4Quarters;
+
+    public void setLast4Quarters( boolean last4Quarters )
+    {
+        this.last4Quarters = last4Quarters;
+    }
+
     private boolean lastSixMonth;
 
     public void setLastSixMonth( boolean lastSixMonth )
@@ -276,18 +283,11 @@
         this.lastSixMonth = lastSixMonth;
     }
 
-    private boolean monthsThisYear;
-
-    public void setMonthsThisYear( boolean monthsThisYear )
-    {
-        this.monthsThisYear = monthsThisYear;
-    }
-
-    private boolean quartersThisYear;
-
-    public void setQuartersThisYear( boolean quartersThisYear )
-    {
-        this.quartersThisYear = quartersThisYear;
+    private boolean last2SixMonths;
+
+    public void setLast2SixMonths( boolean last2SixMonths )
+    {
+        this.last2SixMonths = last2SixMonths;
     }
 
     private boolean thisYear;
@@ -297,25 +297,11 @@
         this.thisYear = thisYear;
     }
 
-    private boolean monthsLastYear;
-
-    public void setMonthsLastYear( boolean monthsLastYear )
-    {
-        this.monthsLastYear = monthsLastYear;
-    }
-
-    private boolean quartersLastYear;
-
-    public void setQuartersLastYear( boolean quartersLastYear )
-    {
-        this.quartersLastYear = quartersLastYear;
-    }
-
-    private boolean lastYear;
-
-    public void setLastYear( boolean lastYear )
-    {
-        this.lastYear = lastYear;
+    private boolean last5Years;
+
+    public void setLast5Years( boolean last5Years )
+    {
+        this.last5Years = last5Years;
     }
 
     // -------------------------------------------------------------------------
@@ -374,10 +360,17 @@
         chart.setPeriods( periods );
         chart.setOrganisationUnits( organisationUnits );
 
-        RelativePeriods relatives = new RelativePeriods( reportingMonth, reportingBimonth, reportingQuarter, lastSixMonth,
-            monthsThisYear, quartersThisYear, thisYear, monthsLastYear, quartersLastYear, lastYear, false, false, false, false, false );
-
-        chart.setRelatives( relatives );
+        RelativePeriods rp = new RelativePeriods();
+        rp.setReportingMonth( lastMonth );
+        rp.setLast12Months( last12Months );
+        rp.setReportingQuarter( lastQuarter );
+        rp.setLast4Quarters( last4Quarters );
+        rp.setLastSixMonth( lastSixMonth );
+        rp.setLast2SixMonths( last2SixMonths );
+        rp.setThisYear( thisYear );
+        rp.setLast5Years( last5Years );
+        
+        chart.setRelatives( rp );
 
         chartService.saveChart( chart );
 

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2011-12-14 08:10:22 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/resources/org/hisp/dhis/reporting/i18n_module.properties	2011-12-22 00:00:00 +0000
@@ -393,4 +393,8 @@
 last_5_years=Last 5 years
 last_12_months=Last 12 months
 last_4_quarters=Last 4 quarters
-reporting_rate_summary=Reporting Rate Summary
\ No newline at end of file
+reporting_rate_summary=Reporting Rate Summary
+last_month=Last month
+last_quarter=Last quarter
+last_six_month=Last six-month
+last_2_sixmonths=Last 2 six-months
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartIndicatorModeForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartIndicatorModeForm.vm	2011-07-01 08:11:03 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartIndicatorModeForm.vm	2011-12-22 00:00:00 +0000
@@ -59,21 +59,23 @@
 </tr>
 <tr>
 	<td>
-	    <label for="reportingMonth">$i18n.getString( "reporting_month" )</label>
-		<input type="checkbox" id="reportingMonth" name="reportingMonth" value="true"#if( $chart.relatives.isReportingMonth() ) checked#end>&nbsp;
-		<label for="monthsThisYear">$i18n.getString( "months_this_year" )</label>
-		<input type="checkbox" id="monthsThisYear" name="monthsThisYear" value="true""#if( $chart.relatives.isMonthsThisYear() ) checked#end>&nbsp;
-		<label for="quartersThisYear">$i18n.getString( "quarters_this_year" )</label>
-		<input type="checkbox" id="quartersThisYear" name="quartersThisYear" value="true"#if( $chart.relatives.isQuartersThisYear() ) checked#end>&nbsp;
+	    <label for="lastMonth">$i18n.getString( "last_month" )</label>
+		<input type="checkbox" id="lastMonth" name="lastMonth" value="true"#if( $chart.relatives.isReportingMonth() ) checked#end>&nbsp;
+		<label for="lastQuarter">$i18n.getString( "last_quarter" )</label>
+		<input type="checkbox" id="lastQuarter" name="lastQuarter" value="true""#if( $chart.relatives.isReportingQuarter() ) checked#end>&nbsp;
+		<label for="lastSixMonth">$i18n.getString( "last_six_month" )</label>
+		<input type="checkbox" id="lastSixMonth" name="lastSixMonth" value="true"#if( $chart.relatives.isLastSixMonth() ) checked#end>&nbsp;
 		<label for="thisYear">$i18n.getString( "this_year" )</label>
-		<input type="checkbox" id="thisYear" name="thisYear" value="true"#if( $chart.relatives.isThisYear() ) checked#end><br><br>
+		<input type="checkbox" id="thisYear" name="thisYear" value="true"#if( $chart.relatives.isThisYear() ) checked#end><br>
 		
-		<label for="monthsLastYear">$i18n.getString( "months_last_year" )</label>
-		<input type="checkbox" id="monthsLastYear" name="monthsLastYear" value="true""#if( $chart.relatives.isMonthsLastYear() ) checked#end>&nbsp;
-		<label for="quartersLastYear">$i18n.getString( "quarters_last_year" )</label>
-		<input type="checkbox" id="quartersLastYear" name="quartersLastYear" value="true"#if( $chart.relatives.isQuartersLastYear() ) checked#end>&nbsp;
-		<label for="lastYear">$i18n.getString( "last_year" )</label>
-		<input type="checkbox" id="lastYear" name="lastYear" value="true"#if( $chart.relatives.isLastYear() ) checked#end>         
+		<label for="last12Months">$i18n.getString( "last_12_months" )</label>
+		<input type="checkbox" id="last12Months" name="last12Months" value="true""#if( $chart.relatives.isLast12Months() ) checked#end>&nbsp;
+		<label for="last4Quarters">$i18n.getString( "last_4_quarters" )</label>
+		<input type="checkbox" id="last4Quarters" name="last4Quarters" value="true"#if( $chart.relatives.isLast4Quarters() ) checked#end>&nbsp;
+		<label for="last2SixMonths">$i18n.getString( "last_2_sixmonths" )</label>
+		<input type="checkbox" id="last2SixMonths" name="last2SixMonths" value="true"#if( $chart.relatives.isLast2SixMonths() ) checked#end>
+		<label for="last5Years">$i18n.getString( "last_5_years" )</label>
+		<input type="checkbox" id="last5Years" name="last5Years" value="true"#if( $chart.relatives.isLast5Years() ) checked#end>
     </td>
 </tr>
 <tr>

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartPeriodModeForm.vm'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartPeriodModeForm.vm	2011-07-01 08:11:03 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/webapp/dhis-web-reporting/addChartPeriodModeForm.vm	2011-12-22 00:00:00 +0000
@@ -57,21 +57,23 @@
 </tr>
 <tr>
 	<td>
-	    <label for="reportingMonth">$i18n.getString( "reporting_month" )</label>
-		<input type="checkbox" id="reportingMonth" name="reportingMonth" value="true"#if( $chart.relatives.isReportingMonth() ) checked#end>&nbsp;
-		<label for="monthsThisYear">$i18n.getString( "months_this_year" )</label>
-		<input type="checkbox" id="monthsThisYear" name="monthsThisYear" value="true""#if( $chart.relatives.isMonthsThisYear() ) checked#end>&nbsp;
-		<label for="quartersThisYear">$i18n.getString( "quarters_this_year" )</label>
-		<input type="checkbox" id="quartersThisYear" name="quartersThisYear" value="true"#if( $chart.relatives.isQuartersThisYear() ) checked#end>&nbsp;
+	    <label for="lastMonth">$i18n.getString( "last_month" )</label>
+		<input type="checkbox" id="lastMonth" name="lastMonth" value="true"#if( $chart.relatives.isReportingMonth() ) checked#end>&nbsp;
+		<label for="lastQuarter">$i18n.getString( "last_quarter" )</label>
+		<input type="checkbox" id="lastQuarter" name="lastQuarter" value="true""#if( $chart.relatives.isReportingQuarter() ) checked#end>&nbsp;
+		<label for="lastSixMonth">$i18n.getString( "last_six_month" )</label>
+		<input type="checkbox" id="lastSixMonth" name="lastSixMonth" value="true"#if( $chart.relatives.isLastSixMonth() ) checked#end>&nbsp;
 		<label for="thisYear">$i18n.getString( "this_year" )</label>
 		<input type="checkbox" id="thisYear" name="thisYear" value="true"#if( $chart.relatives.isThisYear() ) checked#end><br>
 		
-		<label for="monthsLastYear">$i18n.getString( "months_last_year" )</label>
-		<input type="checkbox" id="monthsLastYear" name="monthsLastYear" value="true""#if( $chart.relatives.isMonthsLastYear() ) checked#end>&nbsp;
-		<label for="quartersLastYear">$i18n.getString( "quarters_last_year" )</label>
-		<input type="checkbox" id="quartersLastYear" name="quartersLastYear" value="true"#if( $chart.relatives.isQuartersLastYear() ) checked#end>&nbsp;
-		<label for="lastYear">$i18n.getString( "last_year" )</label>
-		<input type="checkbox" id="lastYear" name="lastYear" value="true"#if( $chart.relatives.isLastYear() ) checked#end>         
+		<label for="last12Months">$i18n.getString( "last_12_months" )</label>
+		<input type="checkbox" id="last12Months" name="last12Months" value="true""#if( $chart.relatives.isLast12Months() ) checked#end>&nbsp;
+		<label for="last4Quarters">$i18n.getString( "last_4_quarters" )</label>
+		<input type="checkbox" id="last4Quarters" name="last4Quarters" value="true"#if( $chart.relatives.isLast4Quarters() ) checked#end>&nbsp;
+		<label for="last2SixMonths">$i18n.getString( "last_2_sixmonths" )</label>
+		<input type="checkbox" id="last2SixMonths" name="last2SixMonths" value="true"#if( $chart.relatives.isLast2SixMonths() ) checked#end>
+		<label for="last5Years">$i18n.getString( "last_5_years" )</label>
+		<input type="checkbox" id="last5Years" name="last5Years" value="true"#if( $chart.relatives.isLast5Years() ) checked#end>
     </td>
 </tr>
 <tr>