← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7427: Error when to load single form.

 

------------------------------------------------------------
revno: 7427
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2012-06-27 16:28:54 +0700
message:
  Error when to load single form.
renamed:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProrgramListAction.java => dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProgramListAction.java
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProgramListAction.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
=== renamed file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProrgramListAction.java' => 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProgramListAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProrgramListAction.java	2012-06-27 05:12:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/GetSingleEventProgramListAction.java	2012-06-27 09:28:54 +0000
@@ -39,14 +39,15 @@
 /**
  * @author Chau Thu Tran
  * 
- * @version $LoadSingleEventProrgramAction.java Jun 26, 2012 10:36:31 AM$
+ * @version $GetSingleEventProgramListAction.java Jun 26, 2012 10:36:31 AM$
  */
-public class GetSingleEventProrgramListAction
+public class GetSingleEventProgramListAction
     implements Action
 {
     // -------------------------------------------------------------------------
     // Dependencies
     // -------------------------------------------------------------------------
+
     private OrganisationUnitSelectionManager selectionManager;
 
     public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
@@ -81,8 +82,11 @@
     {
         OrganisationUnit orgunit = selectionManager.getSelectedOrganisationUnit();
 
-        programs = programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION, orgunit );
-
+        if ( orgunit != null )
+        {
+            programs = programService.getPrograms( Program.SINGLE_EVENT_WITH_REGISTRATION, orgunit );
+        }
+        
         return SUCCESS;
     }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java	2012-06-23 11:05:13 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/caseentry/LoadAnonymousProgramsAction.java	2012-06-27 09:28:54 +0000
@@ -106,8 +106,11 @@
     {
         orgunit = selectionManager.getSelectedOrganisationUnit();
 
-        programs = programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, orgunit );
-
+        if ( orgunit != null )
+        {
+            programs = programService.getPrograms( Program.SINGLE_EVENT_WITHOUT_REGISTRATION, orgunit );
+        }
+        
         levels = organisationUnitService.getFilledOrganisationUnitLevels();
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-06-27 05:12:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml	2012-06-27 09:28:54 +0000
@@ -193,8 +193,8 @@
 	<!-- Single-event DataEntry -->
 	
 	<bean
-		id="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProrgramListAction"
-		class="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProrgramListAction"
+		id="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProgramListAction"
+		class="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProgramListAction"
 		scope="prototype">
 		<property name="selectionManager"
 			ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-06-27 05:12:36 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml	2012-06-27 09:28:54 +0000
@@ -259,7 +259,7 @@
 		</action>
 		
 		<action name="singleEventPrograms"
-			class="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProrgramListAction">
+			class="org.hisp.dhis.caseentry.action.caseentry.GetSingleEventProgramListAction">
 			<result name="success" type="velocity-json">/dhis-web-caseentry/jsonSingleEventPrograms.vm</result>
 			<param name="requiredAuthorities">F_NAME_BASED_DATA_ENTRY</param>
 		</action>