← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4901: (light)made periods constant in number irrespective of year; changed logout to back buttons; redire...

 

------------------------------------------------------------
revno: 4901
committer: mithilesh-hisp<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-10-11 23:00:01 +0530
message:
  (light)made periods constant in number irrespective of year;changed logout to back buttons;redirection after clicking save
modified:
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties
  dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntry.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/main.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectDataSet.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/style/light.css


--
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-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java	2011-09-28 10:34:08 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java	2011-10-11 17:30:01 +0000
@@ -26,9 +26,12 @@
  */
 package org.hisp.dhis.light.dataentry.action;
 
+
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Date;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -45,6 +48,10 @@
 import org.hisp.dhis.system.util.FilterUtils;
 
 import com.opensymphony.xwork2.Action;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import org.hisp.dhis.period.DefaultPeriodService;
+import org.hisp.dhis.period.PeriodService;
 
 /**
  * @author mortenoh
@@ -87,7 +94,6 @@
     // -------------------------------------------------------------------------
     // Input & Output
     // -------------------------------------------------------------------------
-
     private Integer organisationUnitId;
 
     public void setOrganisationUnitId( Integer organisationUnitId )
@@ -126,10 +132,16 @@
         return periods;
     }
 
+    private PeriodService periodService;
+
+    public void setPeriodService( PeriodService periodService )
+    {
+        this.periodService = periodService;
+    }
+
     // -------------------------------------------------------------------------
     // Action Implementation
     // -------------------------------------------------------------------------
-
     @Override
     public String execute()
     {
@@ -139,8 +151,15 @@
             DataSet dataSet = dataSetService.getDataSet( dataSetId );
             CalendarPeriodType periodType = (CalendarPeriodType) dataSet.getPeriodType();
             periods = periodType.generatePeriods( new Date() );
-            FilterUtils.filter( periods, new PastAndCurrentPeriodFilter() );
+            Calendar cal = new GregorianCalendar();
+            Date dateEnd = cal.getTime();
+            cal.add( Calendar.MONTH, -12 );
+            Date dateStart = cal.getTime();
 
+            //      System.out.println(">>>>"+dateEnd.toString()+"\n||||"+dateStart.toString());
+            //FilterUtils.filter( periods, new PastAndCurrentPeriodFilter() );
+            Collection<Period> periodsBetweenDates = periodService.getPeriodsBetweenDates( periodType, dateStart, dateEnd );
+            periods = (List<Period>) periodsBetweenDates;
             for ( Period period : periods )
             {
                 period.setName( format.formatPeriod( period ) );
@@ -150,6 +169,7 @@
 
                 periodCompletedMap.put( period, registration != null ? true : false );
             }
+
         }
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2011-09-30 10:39:41 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml	2011-10-11 17:30:01 +0000
@@ -30,6 +30,7 @@
     <property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
     <property name="dataSetService" ref="org.hisp.dhis.dataset.DataSetService" />
     <property name="registrationService" ref="org.hisp.dhis.dataset.CompleteDataSetRegistrationService" />
+    <property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
   </bean>
 
   <bean id="org.hisp.dhis.light.dataentry.action.GetSectionFormAction" class="org.hisp.dhis.light.dataentry.action.GetSectionFormAction">

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2011-10-11 06:38:29 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties	2011-10-11 17:30:01 +0000
@@ -1,14 +1,14 @@
 report_table_parameters = Report parameters
 reporting_month = Reporting month
 get_report = Get report
-select_organisation_unit = Please select organisation unit@
+select_organisation_unit = Please select organisation unit
 #test
-DHIS_2=DHIS 2@
-data_entry=Data Entry@
-dashboard=Dashboard@
-available_datasets=Available Datasets@
-available_oganisation_units= Available organization Units@
-logout=Logout@
-available_periods=Available_Periods@
-menu=Menu@
-save=Save@
+DHIS_2=DHIS 2
+data_entry=Data Entry
+dashboard=Dashboard
+available_datasets=Available Datasets
+available_organisation_units= Available organization Units
+logout=Logout
+available_periods=Available_Periods
+menu=Menu
+save=Save

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2011-09-28 13:15:32 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml	2011-10-11 17:30:01 +0000
@@ -35,7 +35,7 @@
     </action>
 
     <action name="saveSectionForm" class="org.hisp.dhis.light.dataentry.action.SaveSectionFormAction">
-      <result name="success" type="redirect">/dhis-web-light/index.action</result>
+      <result name="success" type="redirect">/dhis-web-light/selectPeriod.action</result>
       <result name="error" type="velocity">/dhis-web-light/main.vm</result>
       <param name="page">/dhis-web-light/dataEntry.vm</param>
       <param name="requiredAuthorities">F_DATAVALUE_ADD,F_DATAVALUE_UPDATE,F_DATAVALUE_DELETE</param>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntry.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntry.vm	2011-10-11 06:38:29 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntry.vm	2011-10-11 17:30:01 +0000
@@ -67,8 +67,14 @@
 
 <div class="header-box" align="center">
 	<p>
-		<input type="submit" style="width: 100%;" value=$i18n.getString("Save")/>
+		<input type="submit" style="width: 100%;" value=$i18n.getString("save")/>
 	</p>
 </div>
 
 </form>
+
+<div id="footer">
+<ul><li>
+<a href="selectPeriod.action">$i18n.getString("available_periods")</a></li>
+</ul>
+</div>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/main.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/main.vm	2011-10-11 06:38:29 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/main.vm	2011-10-11 17:30:01 +0000
@@ -20,13 +20,8 @@
 
 </div>
 
-<div id="footer">
-	<ul>
-		<li><a href="../dhis-web-commons-security/logout.action">$i18n.getString("logout")</a></li>
-	</ul>
-</div>
-
-</div>
+
+
 
 </body>
 

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm	2011-10-11 06:38:29 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/menu.vm	2011-10-11 17:30:01 +0000
@@ -8,3 +8,10 @@
         <li><a href="selectOrganisationUnit.action">$i18n.getString("data_entry")</a></li>
     </ul>
 </p>
+
+
+<div id="footer">
+<ul>
+		<li><a href="../dhis-web-commons-security/logout.action">$i18n.getString("logout")</a></li>
+	</ul>
+</div>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectDataSet.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectDataSet.vm	2011-10-11 06:38:29 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectDataSet.vm	2011-10-11 17:30:01 +0000
@@ -8,3 +8,9 @@
 		#end
 	</ul>
 </p>
+
+<div id="footer">
+<ul><li>
+<a href="selectOrganisationUnit.action">$i18n.getString("available_organisation_units")</a></li>
+</ul>
+</div>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm	2011-10-11 06:38:29 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectOrganisationUnit.vm	2011-10-11 17:30:01 +0000
@@ -1,6 +1,7 @@
 
 <h2>$i18n.getString("available_oganisation_units")</h2>
 
+
 <p>
 	<ul>
 	#foreach( $organisationUnit in $organisationUnits )
@@ -8,3 +9,8 @@
 	#end
 	</ul>
 </p>
+<div id="footer">
+<ul><li>
+<a href="index.action">$i18n.getString("menu")</a></li>
+</ul>
+</div>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm	2011-10-11 06:38:29 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm	2011-10-11 17:30:01 +0000
@@ -11,3 +11,9 @@
 		#end
 	</ul>
 </p>
+
+<div id="footer">
+<ul><li>
+<a href="selectDataSet.action">$i18n.getString("available_datasets")</a></li>
+</ul>
+</div>

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/style/light.css'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/style/light.css	2011-09-28 19:31:03 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/style/light.css	2011-10-11 17:30:01 +0000
@@ -111,8 +111,10 @@
 body div#footer ul {
 	margin-left: 2em;
 	padding-left: 0;
+    padding-right: 0;
 	margin-bottom: 0;
 	margin-top: 0;
+   
 }
 
 body div#footer ul li {
@@ -129,7 +131,6 @@
 body div#footer ul li {
 	list-style-type: none;
 	text-align: right;
-	padding-right: 1em;
 }
 
 /*