← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20598: tracker-capture: provide notifcation that registration is successful when user clicks save and ad...

 

------------------------------------------------------------
revno: 20598
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-10-09 11:07:58 +0200
message:
  tracker-capture: provide notifcation that registration is successful when user clicks save and add new
modified:
  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/i18n/i18n_app.properties


--
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/registration/registration-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-10-06 10:52:09 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-10-09 09:07:58 +0000
@@ -124,13 +124,22 @@
     var goToDashboard = function(destination, teiId){
         //reset form
         $scope.selectedTei = {};
-        $scope.selectedEnrollment = {};
-        $scope.outerForm.submitted = false;         
+        $scope.selectedEnrollment = {enrollmentDate: $scope.today, incidentDate: $scope.today, orgUnitName: $scope.selectedOrgUnit.name};
+        $scope.outerForm.submitted = false;
+        $scope.outerForm.$setPristine();
 
         if(destination === 'DASHBOARD') {
             $location.path('/dashboard').search({tei: teiId,                                            
                                     program: $scope.selectedProgram ? $scope.selectedProgram.id: null});
-        }        
+        }
+        else{
+            //notify user
+            var dialogOptions = {
+                    headerText: 'success',
+                    bodyText: 'registration_complete'
+                };
+            DialogService.showDialog({}, dialogOptions);
+        }
     };
     
     var reloadProfileWidget = function(){

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-10-08 11:26:14 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-10-09 09:07:58 +0000
@@ -276,6 +276,7 @@
 no_enity_for_tracker_associate_attribute=Selected attribute has invalid tracked entity
 error=Error
 success=Success
+registration_complete=Registration is completed
 validation_error=Validation Error
 validation_warnings=Validation Warnings
 dashboard_layout_saved=Dashboard layout saved as default.