=== 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 periodsBetweenDates = periodService.getPeriodsBetweenDates( periodType, dateStart, dateEnd ); + periods = (List) 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 @@ + === 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 @@ - /dhis-web-light/index.action + /dhis-web-light/selectPeriod.action /dhis-web-light/main.vm /dhis-web-light/dataEntry.vm F_DATAVALUE_ADD,F_DATAVALUE_UPDATE,F_DATAVALUE_DELETE === 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 @@

- +

+ + === 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 @@ - - - + + === 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 @@
  • $i18n.getString("data_entry")
  • + + + \ 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

    + + === 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 @@

    $i18n.getString("available_oganisation_units")

    +

      #foreach( $organisationUnit in $organisationUnits ) @@ -8,3 +9,8 @@ #end

    + === 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

    + + === 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; } /*