dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14698
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5073: (mobile) wip; added notification for saved / saved and complete dataset
------------------------------------------------------------
revno: 5073
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-11-01 16:01:22 +0100
message:
(mobile) wip; added notification for saved / saved and complete dataset
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/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.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/struts.xml
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.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-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-10-12 21:08:12 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetPeriodsAction.java 2011-11-01 15:01:22 +0000
@@ -105,6 +105,11 @@
private Integer dataSetId;
+ public void setDataSetId( String dataSetId )
+ {
+ this.dataSetId = Integer.parseInt( dataSetId );
+ }
+
public void setDataSetId( Integer dataSetId )
{
this.dataSetId = dataSetId;
@@ -115,6 +120,13 @@
return dataSetId;
}
+ private DataSet dataSet;
+
+ public DataSet getDataSet()
+ {
+ return dataSet;
+ }
+
private Map<Period, Boolean> periodCompletedMap = new HashMap<Period, Boolean>();
public Map<Period, Boolean> getPeriodCompletedMap()
@@ -129,6 +141,30 @@
return periods;
}
+ private Boolean complete = false;
+
+ public void setComplete( Boolean complete )
+ {
+ this.complete = complete;
+ }
+
+ public Boolean getComplete()
+ {
+ return complete;
+ }
+
+ private Boolean validated;
+
+ public void setValidated( Boolean validated )
+ {
+ this.validated = validated;
+ }
+
+ public Boolean getValidated()
+ {
+ return validated;
+ }
+
// -------------------------------------------------------------------------
// Action Implementation
// -------------------------------------------------------------------------
@@ -140,7 +176,7 @@
{
OrganisationUnit organisationUnit = organisationUnitService.getOrganisationUnit( organisationUnitId );
- DataSet dataSet = dataSetService.getDataSet( dataSetId );
+ dataSet = dataSetService.getDataSet( dataSetId );
CalendarPeriodType periodType = (CalendarPeriodType) dataSet.getPeriodType();
periods = periodType.generateLast5Years( new Date() );
FilterUtils.filter( periods, new PastAndCurrentPeriodFilter() );
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2011-10-27 17:40:17 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/SaveSectionFormAction.java 2011-11-01 15:01:22 +0000
@@ -423,6 +423,8 @@
return ERROR;
}
+ validated = true;
+
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-10-24 11:36:21 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2011-11-01 15:01:22 +0000
@@ -18,16 +18,19 @@
<property name="expressionService" ref="org.hisp.dhis.expression.ExpressionService" />
</bean>
- <bean id="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction" class="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction">
+ <bean id="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction" class="org.hisp.dhis.light.dataentry.action.GetOrganisationUnitsAction"
+ scope="prototype">
<property name="currentUserService" ref="org.hisp.dhis.user.CurrentUserService" />
<property name="sectionFormUtils" ref="org.hisp.dhis.light.dataentry.utils.SectionFormUtils" />
</bean>
- <bean id="org.hisp.dhis.light.dataentry.action.GetDataSetsAction" class="org.hisp.dhis.light.dataentry.action.GetDataSetsAction">
+ <bean id="org.hisp.dhis.light.dataentry.action.GetDataSetsAction" class="org.hisp.dhis.light.dataentry.action.GetDataSetsAction"
+ scope="prototype">
<property name="organisationUnitService" ref="org.hisp.dhis.organisationunit.OrganisationUnitService" />
</bean>
- <bean id="org.hisp.dhis.light.dataentry.action.GetPeriodsAction" class="org.hisp.dhis.light.dataentry.action.GetPeriodsAction">
+ <bean id="org.hisp.dhis.light.dataentry.action.GetPeriodsAction" class="org.hisp.dhis.light.dataentry.action.GetPeriodsAction"
+ scope="prototype">
<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" />
@@ -81,13 +84,15 @@
<!-- Settings -->
- <bean id="org.hisp.dhis.light.action.settings.action.GetSettingsAction" class="org.hisp.dhis.light.action.settings.action.GetSettingsAction">
+ <bean id="org.hisp.dhis.light.action.settings.action.GetSettingsAction" class="org.hisp.dhis.light.action.settings.action.GetSettingsAction"
+ scope="prototype">
<property name="resourceBundleManager" ref="org.hisp.dhis.i18n.resourcebundle.ResourceBundleManager" />
<property name="localeManager" ref="org.hisp.dhis.i18n.locale.LocaleManager" />
<property name="i18nService" ref="org.hisp.dhis.i18n.I18nService" />
</bean>
- <bean id="org.hisp.dhis.light.action.settings.action.SaveSettingsFormAction" class="org.hisp.dhis.light.action.settings.action.SaveSettingsFormAction">
+ <bean id="org.hisp.dhis.light.action.settings.action.SaveSettingsFormAction" class="org.hisp.dhis.light.action.settings.action.SaveSettingsFormAction"
+ scope="prototype">
<property name="localeManagerInterface" ref="org.hisp.dhis.i18n.locale.LocaleManager" />
<property name="localeManagerDB" ref="org.hisp.dhis.i18n.locale.LocaleManagerDb" />
</bean>
=== 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-10-14 10:44:57 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2011-11-01 15:01:22 +0000
@@ -35,7 +35,7 @@
</action>
<action name="saveSectionForm" class="org.hisp.dhis.light.dataentry.action.SaveSectionFormAction">
- <result name="success" type="redirect">/mobile/selectPeriod.action</result>
+ <result name="success" type="redirect">/mobile/selectPeriod.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&validated=${validated}&complete=${complete}</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/selectPeriod.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm 2011-10-14 13:06:43 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/selectPeriod.vm 2011-11-01 15:01:22 +0000
@@ -1,6 +1,19 @@
<h2>$i18n.getString( "available_periods" )</h2>
+#if( $validated )
+<div class="header-box">
+ <h3 style="text-align: left;">Successfully Saved</h3>
+ <p style="text-align: left;">
+ #if( $complete )
+ Marked DataSet $dataSet.name as complete <br />
+ #else
+ Saved data set $dataSet.name <br />
+ #end
+ </p>
+</div>
+#end
+
<p>
<ul>
#foreach( $period in $periods )