← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12373: Updated PDF Form period importing format.

 

------------------------------------------------------------
revno: 12373
committer: James Chang <jamesbchang@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-10-02 13:24:18 +0700
message:
  Updated PDF Form period importing format.
modified:
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java
  dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.java


--
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-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java	2013-10-01 09:13:50 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/DefaultPdfDataEntryFormService.java	2013-10-02 06:24:18 +0000
@@ -748,7 +748,7 @@
 
         for ( int i = 0; i < periods.size(); i++ )
         {
-            periodValues[i] = periods.get( i ).getIsoDate(); //TODO update forms
+            periodValues[i] = periods.get( i ).getIsoDate();
         }
 
         return periodValues;

=== modified file 'dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.java'
--- dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.java	2013-08-23 16:05:01 +0000
+++ dhis-2/dhis-services/dhis-service-dxf2/src/main/java/org/hisp/dhis/dxf2/pdfform/PdfDataEntryFormUtil.java	2013-10-02 06:24:18 +0000
@@ -224,13 +224,13 @@
                     throw new IllegalArgumentException( ERROR_EMPTY_ORG_UNIT );
                 }
 
-                Period period = PeriodType.createPeriodExternalId( periodID );
-
+                Period period = PeriodType.getPeriodFromIsoString( periodID );
+                
                 if ( period == null )
                 {
                     throw new IllegalArgumentException( ERROR_INVALID_PERIOD + periodID );
                 }
-
+                
                 // Loop Through the Fields and get data.
 
                 @SuppressWarnings( "unchecked" )
@@ -238,6 +238,7 @@
 
                 for ( String fldName : fldNames )
                 {
+                    
                     if ( fldName.startsWith( PdfDataEntryFormUtil.LABELCODE_DATAENTRYTEXTFIELD ) )
                     {
                         String[] strArrFldName = fldName.split( "_" );
@@ -248,7 +249,7 @@
                         dataValue.setCategoryOptionCombo( strArrFldName[2] );
                         dataValue.setOrgUnit( orgUnitUID );
                         dataValue.setPeriod( period.getIsoDate() );
-
+                        
                         dataValue.setValue( form.getField( fldName ) );
 
                         dataValue.setStoredBy( DATAVALUE_IMPORT_STOREBY );