← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4620: Error when adding a new program.

 

------------------------------------------------------------
revno: 4620
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-09-20 16:07:49 +0700
message:
  Error when adding a new program.
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.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-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/AddProgramAction.java	2011-09-20 09:07:49 +0000
@@ -42,6 +42,7 @@
     implements Action
 {
     private static String SINGLE_EVENT = "Single-Event";
+
     // -------------------------------------------------------------------------
     // Dependency
     // -------------------------------------------------------------------------
@@ -113,6 +114,11 @@
     public String execute()
         throws Exception
     {
+        if ( singleEvent == null )
+        {
+            singleEvent = false;
+        }
+        
         Program program = new Program();
 
         program.setName( name );
@@ -122,7 +128,7 @@
         program.setDateOfIncidentDescription( dateOfIncidentDescription );
         program.setMaxDaysAllowedInputData( maxDaysAllowedInputData );
         program.setSingleEvent( singleEvent );
-        
+
         programService.saveProgram( program );
 
         if ( singleEvent )
@@ -137,7 +143,7 @@
 
             programStageService.saveProgramStage( programStage );
         }
-        
+
         return SUCCESS;
     }
 }
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2011-09-14 06:36:13 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-patient/src/main/java/org/hisp/dhis/patient/action/program/UpdateProgramAction.java	2011-09-20 09:07:49 +0000
@@ -131,6 +131,11 @@
     public String execute()
         throws Exception
     {
+        if ( singleEvent == null )
+        {
+            singleEvent = false;
+        }
+        
         Program program = programService.getProgram( id );
         program.setName( name );
         program.setDescription( description );