← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18997: tracker-capture: removed event auto-generation from client side. It is now done from server-side

 

------------------------------------------------------------
revno: 18997
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-04-23 17:18:14 +0200
message:
  tracker-capture: removed event auto-generation from client side. It is now done from server-side
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js


--
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-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-04-22 07:22:39 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-04-23 15:18:14 +0000
@@ -954,6 +954,9 @@
                 dataValues: [],
                 status: 'ACTIVE'
             };            
+        
+        newEvent.status = newEvent.eventDate ? 'ACTIVE' : 'SCHEDULE';
+        
         newEvents.events.push(newEvent);
         DHIS2EventFactory.create(newEvents).then(function(data){
             if (data.importSummaries[0].status === 'ERROR') {

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-03-30 13:21:20 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-04-23 15:18:14 +0000
@@ -161,14 +161,7 @@
                             else{
                                 enrollment.enrollment = data.reference;
                                 $scope.selectedEnrollment = enrollment;
-                                var dhis2Events = EventUtils.autoGenerateEvents($scope.tei.trackedEntityInstance, $scope.selectedProgram, $scope.selectedOrgUnit, enrollment);
-                                if(dhis2Events.events.length > 0){
-                                    DHIS2EventFactory.create(dhis2Events).then(function(data){
-                                        notifyRegistrtaionCompletion(destination, $scope.tei.trackedEntityInstance);
-                                    });
-                                }else{
-                                    notifyRegistrtaionCompletion(destination, $scope.tei.trackedEntityInstance);
-                                }                            
+                                notifyRegistrtaionCompletion(destination, $scope.tei.trackedEntityInstance);
                             }
                         });
                     }

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-04-22 07:22:39 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-04-23 15:18:14 +0000
@@ -1471,8 +1471,7 @@
                                 program: program.id,
                                 programStage: stage.id,
                                 orgUnit: orgUnit.id,
-                                enrollment: enrollment.enrollment,                                
-                                status: 'SCHEDULE'
+                                enrollment: enrollment.enrollment
                             };
                         if(stage.periodType){
                             var periods = getEventDuePeriod(null, stage, enrollment);
@@ -1492,6 +1491,8 @@
                             }
                         }
 
+                        newEvent.status = newEvent.eventDate ? 'ACTIVE' : 'SCHEDULE';
+                        
                         dhis2Events.events.push(newEvent);    
                     }
                 });