← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10649: fix bug web-light

 

------------------------------------------------------------
revno: 10649
committer: Lai <lai.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-04-22 10:11:28 +0700
message:
  fix bug web-light
modified:
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java
  dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java
  dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java
  dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java
  dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/programStageForm.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-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2013-04-17 09:03:38 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/api/mobile/ActivityReportingService.java	2013-04-22 03:11:28 +0000
@@ -57,7 +57,7 @@
     public Patient findPatient( String name, int orgUnitId )
         throws NotAllowedException;
 
-    public String saveProgramStage( ProgramStage programStage, int patientId )
+    public String saveProgramStage( ProgramStage programStage, int patientId, int orgUnitId )
         throws NotAllowedException;
 
     public Patient enrollProgram( String enrollInfo )

=== modified file 'dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java'
--- dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-04-17 09:03:38 +0000
+++ dhis-2/dhis-services/dhis-service-mobile/src/main/java/org/hisp/dhis/mobile/service/ActivityReportingServiceImpl.java	2013-04-22 03:11:28 +0000
@@ -465,7 +465,7 @@
 
     @Override
     public String saveProgramStage( org.hisp.dhis.api.mobile.model.LWUITmodel.ProgramStage mobileProgramStage,
-        int patientId )
+        int patientId, int orgUnitId )
         throws NotAllowedException
     {
         if ( mobileProgramStage.isSingleEvent() )
@@ -496,7 +496,14 @@
 
             programStageInstance.setCompleted( true );
 
-            programStageInstance.setOrganisationUnit( patientService.getPatient( patientId ).getOrganisationUnit() );
+            if( patientId != 0 )
+            {
+                programStageInstance.setOrganisationUnit( patientService.getPatient( patientId ).getOrganisationUnit() );
+            }
+            else
+            {
+                programStageInstance.setOrganisationUnit( orgUnitService.getOrganisationUnit( orgUnitId ) );
+            }
 
             programStageInstanceService.addProgramStageInstance( programStageInstance );
 

=== modified file 'dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java'
--- dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java	2013-04-17 09:03:38 +0000
+++ dhis-2/dhis-web/dhis-web-api-mobile/src/main/java/org/hisp/dhis/api/mobile/controller/MobileOrganisationUnitController.java	2013-04-22 03:11:28 +0000
@@ -356,7 +356,7 @@
     public String saveProgramStage( @PathVariable int patientId, @PathVariable int id, @RequestBody ProgramStage programStage )
         throws NotAllowedException
     {
-        return activityReportingService.saveProgramStage( programStage, patientId );
+        return activityReportingService.saveProgramStage( programStage, patientId, id );
     }
 
     @RequestMapping( method = RequestMethod.GET, value = "{clientVersion}/LWUIT/orgUnits/{id}/enrollProgram" )

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java'
--- dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java	2013-04-04 18:06:19 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/java/org/hisp/dhis/light/namebaseddataentry/action/SaveProgramStageFormAction.java	2013-04-22 03:11:28 +0000
@@ -572,7 +572,14 @@
 
         }
 
-        programStageInstance.setCompleted( true );
+        if ( programStageSectionId != null && programStageSectionId != 0 )
+        {
+            programStageInstance.setCompleted( false );
+        }
+        else
+        {
+            programStageInstance.setCompleted( true );
+        }
         programStageInstance.setExecutionDate( new Date() );
         programStageInstanceService.updateProgramStageInstance( programStageInstance );
 

=== modified file 'dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/programStageForm.vm'
--- dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/programStageForm.vm	2013-03-20 07:14:26 +0000
+++ dhis-2/dhis-web/dhis-web-light/src/main/webapp/dhis-web-light/namebased/programStageForm.vm	2013-04-22 03:11:28 +0000
@@ -109,10 +109,6 @@
 		#end
 
 	</p>
-	
-	
-	
-		
 </div>
 
 <div class="header-box" align="center">