dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #15476
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5621: (mobile) simple section load / save in new dataentry screen working
------------------------------------------------------------
revno: 5621
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-12-27 12:13:41 +0100
message:
(mobile) simple section load / save in new dataentry screen working
modified:
dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.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/dataEntryOverview.vm
dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.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/GetSectionFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java 2011-12-27 10:32:41 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/dataentry/action/GetSectionFormAction.java 2011-12-27 11:13:41 +0000
@@ -28,8 +28,11 @@
package org.hisp.dhis.light.dataentry.action;
import com.opensymphony.xwork2.Action;
+import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementOperand;
-import org.hisp.dhis.dataset.*;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.Section;
import org.hisp.dhis.datavalue.DeflatedDataValue;
import org.hisp.dhis.light.dataentry.utils.FormUtils;
import org.hisp.dhis.organisationunit.OrganisationUnit;
@@ -66,13 +69,6 @@
this.dataSetService = dataSetService;
}
- private CompleteDataSetRegistrationService registrationService;
-
- public void setRegistrationService( CompleteDataSetRegistrationService registrationService )
- {
- this.registrationService = registrationService;
- }
-
private PeriodService periodService;
public void setPeriodService( PeriodService periodService )
@@ -132,6 +128,13 @@
return dataSetId;
}
+ private Integer sectionId;
+
+ public void setSectionId( Integer sectionId )
+ {
+ this.sectionId = sectionId;
+ }
+
private DataSet dataSet;
public DataSet getDataSet()
@@ -160,25 +163,6 @@
return validationRuleViolations;
}
- private Boolean complete = false;
-
- public void setComplete( Boolean complete )
- {
- this.complete = complete;
- }
-
- public Boolean getComplete()
- {
- return complete;
- }
-
- private String page;
-
- public String getPage()
- {
- return page;
- }
-
private Map<String, Boolean> greyedFields = new HashMap<String, Boolean>();
public Map<String, Boolean> getGreyedFields()
@@ -194,6 +178,20 @@
return typeViolations;
}
+ private String name;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ private List<DataElement> dataElements = new ArrayList<DataElement>();
+
+ public List<DataElement> getDataElements()
+ {
+ return dataElements;
+ }
+
// -------------------------------------------------------------------------
// Action Implementation
// -------------------------------------------------------------------------
@@ -213,16 +211,30 @@
validationRuleViolations = formUtils.getValidationRuleViolations( organisationUnit, dataSet, period );
- CompleteDataSetRegistration registration = registrationService.getCompleteDataSetRegistration( dataSet, period,
- organisationUnit );
-
- complete = registration != null ? true : false;
-
if ( dataSet.getDataSetType().equals( DataSet.TYPE_SECTION ) )
{
setGreyedFields();
}
+ if ( sectionId != null )
+ {
+ for ( Section section : dataSet.getSections() )
+ {
+ if ( section.getId() == sectionId )
+ {
+ name = section.getName();
+ dataElements = section.getDataElements();
+
+ break;
+ }
+ }
+ }
+ else
+ {
+ name = "Default";
+ dataElements = new ArrayList<DataElement>( dataSet.getDataElements() );
+ }
+
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-12-27 10:32:41 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/META-INF/dhis/beans.xml 2011-12-27 11:13:41 +0000
@@ -51,7 +51,6 @@
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" />
<property name="periodService" ref="org.hisp.dhis.period.PeriodService" />
<property name="formUtils" ref="org.hisp.dhis.light.dataentry.utils.FormUtils" />
</bean>
=== 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-12-20 13:57:04 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/org/hisp/dhis/light/i18n_module.properties 2011-12-27 11:13:41 +0000
@@ -9,7 +9,7 @@
dashboard_reports=Dashboard reports
dashboard_charts=Dashboard charts
dashboard_documents=Dashboard documents
-data_entry=Data Entry
+data_entry_overview=Data Entry Overview
logout=Logout
desktop_version=Desktop version
report_table_parameters=Report parameters
@@ -36,3 +36,6 @@
validation_rule_violation_warnings=Validation Rule Violation Warnings
minmax_violation_warnings=Min/Max Violation Warnings
type_violation_errors=Type Violation Errors
+
+mark_as_complete=Mark as complete
+mark_as_not_complete=Mark as not complete
=== 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-12-27 10:32:41 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/resources/struts.xml 2011-12-27 11:13:41 +0000
@@ -34,8 +34,13 @@
<param name="page">/dhis-web-light/dataEntryOverview.vm</param>
</action>
+ <action name="dataEntrySection" class="org.hisp.dhis.light.dataentry.action.GetSectionFormAction">
+ <result name="success" type="velocity">/dhis-web-light/main.vm</result>
+ <param name="page">/dhis-web-light/dataEntrySection.vm</param>
+ </action>
+
<action name="saveSectionForm" class="org.hisp.dhis.light.dataentry.action.SaveSectionFormAction">
- <result name="success" type="redirect">/mobile/selectPeriod.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&validated=${validated}&complete=${complete}</result>
+ <result name="success" type="redirect">/mobile/dataEntry.action?organisationUnitId=${organisationUnitId}&dataSetId=${dataSetId}&periodId=${periodId}</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/dataEntryOverview.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntryOverview.vm 2011-12-27 10:32:41 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntryOverview.vm 2011-12-27 11:13:41 +0000
@@ -1,16 +1,24 @@
-<h2>$encoder.htmlEncode( "Sections" )</h2>
+#if( $dataSet.alternativeName )
+ #set( $dataSetName = $dataSet.alternativeName )
+#else
+ #set( $dataSetName = $dataSet.name )
+#end
+
+<h2>$encoder.htmlEncode( $dataSetName )</h2>
<p>
-<ul>
-#if( $dataSet.sections.size() > 0 )
- #foreach( $section in $dataSet.sections )
- <li><a href="entry">$i18n.getString( $section.name )</a></li>
+ <ul>
+ #if( $dataSet.sections.size() > 0 )
+ #foreach( $section in $dataSet.sections )
+ <li>
+ <a href="dataEntrySection.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$periodId§ionId=$section.id">$i18n.getString( $section.name )</a>
+ </li>
+ #end
+ #else
+ <a href="dataEntrySection.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$periodId">$i18n.getString( "Default" )</a>
#end
-#else
- <li><a href="entry">$i18n.getString( "Default" )</a></li>
-#end
-</ul>
+ </ul>
</p>
<form method="GET" action="dataEntry.action">
=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm 2011-12-27 10:32:41 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/dataEntrySection.vm 2011-12-27 11:13:41 +0000
@@ -109,24 +109,11 @@
</div>
#end
-#if( $dataSet.sections.size() > 0 )
- #foreach( $section in $dataSet.sections )
- #createSection( $section.name $section.dataElements )
- #end
-#else
- #createSection( "Default" $dataSet.dataElements )
-#end
-
-<div class="header-box" align="center">
- <p style="text-align: left;">
- <input type="checkbox" id="complete" name="complete" value="true" #if($complete)checked="true"#end style="width: 15px; height: 15px; vertical-align: middle;" />
- <label for="complete" style="vertical-align: middle; width: auto;">$i18n.getString("dataset_is_complete")</label>
- </p>
-</div>
+#createSection( $name $dataElements )
<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>
@@ -135,7 +122,7 @@
<div id="footer">
<h2>$i18n.getString( "navigate_to" )</h2>
<ul>
- <li><a href="selectPeriod.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$periodId">$i18n.getString("available_periods")</a></li>
+ <li><a href="dataEntry.action?organisationUnitId=$organisationUnitId&dataSetId=$dataSetId&periodId=$periodId">$i18n.getString("dataentry_overview")</a></li>
<li><a href="index.action">$i18n.getString("home")</a></li>
</ul>
</div>