← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20092: tracker-capture: new widget for displaying active programs for the selected TEI

 

------------------------------------------------------------
revno: 20092
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-09-11 17:16:03 +0200
message:
  tracker-capture: new widget for displaying active programs for the selected TEI
added:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html
  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/enrollment/enrollment-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/enrollment-dates-form.html
  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/relationship/registration.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-details.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html
  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/index.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.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
=== added directory 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms'
=== added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js	2015-09-11 15:16:03 +0000
@@ -0,0 +1,22 @@
+/* global trackerCapture, angular */
+
+trackerCapture.controller('ActiveProgramsController',
+        function($scope, 
+        $location,
+        CurrentSelection) {
+    //listen for the selected items
+    $scope.$on('selectedItems', function(event, args) {        
+        var selections = CurrentSelection.get();
+        $scope.selectedTeiId = selections.tei ? selections.tei.trackedEntityInstance : null;
+        $scope.activeEnrollments =  [];        
+        angular.forEach(selections.enrollments, function(en){
+            if(en.status === "ACTIVE" && selections.pr && selections.pr.id !== en.program){
+                $scope.activeEnrollments.push(en);
+            }
+        });
+    });
+    
+    $scope.changeProgram = function(program){
+        $location.path('/dashboard').search({tei: $scope.selectedTeiId, program: program});
+    };
+});
\ No newline at end of file

=== added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html	2015-09-11 15:16:03 +0000
@@ -0,0 +1,24 @@
+<div class="panel panel-info" ng-controller="ActiveProgramsController">
+    <div class="panel-heading handle bold">
+        {{activeProgramsWidget.title| translate}}
+        <span class="pull-right widget-link">
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(activeProgramsWidget)">
+                <span ng-show="activeProgramsWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!activeProgramsWidget.expand"><i class="fa fa-chevron-down" title="{{'expand'| translate}}"></i></span>
+            </a>
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(activeProgramsWidget)" title="{{'remove'| translate}}"><i class="fa fa-times-circle"></i></a>            
+        </span>        
+    </div>    
+    <div ng-show="activeProgramsWidget.expand && activeEnrollments.length > 0" class="panel-body dashboard-element-container">
+        
+        <div class="row">
+            <table class="table table-striped dhis2-table-hover">
+                <tr ng-repeat="activeEnrollment in activeEnrollments" ng-click="changeProgram(activeEnrollment.program)">
+                    <td>
+                        {{programNames[activeEnrollment.program].name}}
+                    </td>
+                </tr>
+            </table> 
+        </div>        
+    </div>
+</div>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-09-03 15:45:33 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-09-11 15:16:03 +0000
@@ -77,52 +77,16 @@
             selectedLayout = !selectedLayout ?  defaultLayout : selectedLayout;
 
             angular.forEach(selectedLayout.widgets, function(widget){
-                switch(widget.title){
-                    case 'enrollment':
-                        $rootScope.enrollmentWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.enrollmentWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;
-                    case 'indicators':
-                        $rootScope.indicatorWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.indicatorWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;
-                    case 'feedback':
-                        $rootScope.feedbackWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.feedbackWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;
-                    case 'dataentry':
-                        $rootScope.dataentryWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.dataentryWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;
-                    case 'report':
-                        $rootScope.reportWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.reportWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;
-                    case 'current_selections':
-                        $rootScope.selectedWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.selectedWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;
-                    case 'profile':
-                        $rootScope.profileWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.profileWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;
-                    case 'relationships':
-                        $rootScope.relationshipWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.relationshipWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;    
-                    case 'notes':
-                        $rootScope.notesWidget = widget;
-                        $rootScope.dashboardWidgets.push($rootScope.notesWidget);
-                        $scope.dashboardStatus[widget.title] = angular.copy(widget);
-                        break;    
+                $rootScope[widget.title +'Widget'] = widget;
+                $rootScope.dashboardWidgets.push( $rootScope[widget.title +'Widget'] );
+                $scope.dashboardStatus[widget.title] = angular.copy(widget);
+            });
+            
+            angular.forEach(defaultLayout.widgets, function(w){
+                if(!$scope.dashboardStatus[w.title]){
+                    $rootScope[w.title +'Widget'] = w;
+                    $rootScope.dashboardWidgets.push( $rootScope[w.title +'Widget'] );
+                    $scope.dashboardStatus[w.title] = angular.copy(w);
                 }
             });
 
@@ -213,9 +177,9 @@
                                     if( program.trackedEntity.id === $scope.selectedTei.trackedEntity ){
                                         $scope.programs.push(program);
                                         $scope.programNames[program.id] = {id: program.id, name: program.name};
-										angular.forEach(program.programStages, function(stage){                
-											$scope.programStageNames[stage.id] = {id: stage.id, name: stage.name};
-										});
+                                        angular.forEach(program.programStages, function(stage){                
+                                                $scope.programStageNames[stage.id] = {id: stage.id, name: stage.name};
+                                        });
 
                                         if($scope.selectedProgramId && program.id === $scope.selectedProgramId || selectedEnrollment && selectedEnrollment.program === program.id){
                                             $scope.selectedProgram = program;
@@ -235,7 +199,7 @@
                 });  
             });
         });
-    }    
+    }
     
     
     //listen for any change to program selection
@@ -344,7 +308,7 @@
         CurrentSelection.set({tei: $scope.selectedTei, te: $scope.trackedEntity, prs: $scope.programs, pr: $scope.selectedProgram, prNames: $scope.programNames, prStNames: $scope.programStageNames, enrollments: selections.enrollments, selectedEnrollment: null, optionSets: $scope.optionSets});        
         $timeout(function() { 
             $rootScope.$broadcast('selectedItems', {programExists: $scope.programs.length > 0});            
-        }, 100);
+        }, 200);
     };     
     
     $scope.activiateTEI = function(){
@@ -407,6 +371,7 @@
             return;
         });
     };
+    
     $scope.showHideWidgets = function(){
         var modalInstance = $modal.open({
             templateUrl: "components/dashboard/dashboard-widgets.html",

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html	2015-09-08 15:02:34 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html	2015-09-11 15:16:03 +0000
@@ -37,7 +37,6 @@
     <!-- dashboard top menu ends-->
     
     <!-- dashboard widgets begin -->
-    <!--<div class="row col-sm-12">-->
     <div class="box">
         <div class="row-fluid">
             <!-- dashboard bigger widgets begin -->
@@ -67,10 +66,7 @@
                 </div>
             </div>
             <!-- dashboard smaller widgets end -->   
-        </div>
-            
-                 
-        
+        </div>        
     </div>
     <!-- dashboard widgets end -->
     

=== 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-09-07 02:54:26 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-09-11 15:16:03 +0000
@@ -1017,7 +1017,7 @@
 
             $timeout(function () {
                 $rootScope.$broadcast('tei-report-widget', {});
-            }, 100);
+            }, 200);
         }
         
         $scope.allEventsSorted = orderByFilter($scope.allEventsSorted, '-sortingDate').reverse();

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-08-07 10:37:31 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-09-11 15:16:03 +0000
@@ -102,7 +102,7 @@
         
         $timeout(function() { 
             $rootScope.$broadcast('enrollmentEditing', {enrollmentEditing: $scope.showEnrollmentDiv});
-        }, 100);
+        }, 200);
             
         if($scope.showEnrollmentDiv){
             
@@ -114,7 +114,7 @@
             
             $timeout(function() { 
                 $rootScope.$broadcast('registrationWidget', {registrationMode: 'ENROLLMENT', selectedTei: $scope.selectedTei});
-            }, 100);
+            }, 200);
         }
         else{
             hideEnrollmentDiv();
@@ -140,7 +140,7 @@
         CurrentSelection.set({tei: tei, te: $scope.selectedEntity, prs: $scope.programs, pr: $scope.selectedProgram, prNames: $scope.programNames, prStNames: $scope.programStageNames, enrollments: $scope.enrollments, selectedEnrollment: $scope.selectedEnrollment, optionSets: $scope.optionSets});
         $timeout(function() { 
             $rootScope.$broadcast(listeners, {});
-        }, 100);
+        }, 200);
     };
     
     var processSelectedTei = function(){

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2015-09-11 12:20:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2015-09-11 15:16:03 +0000
@@ -39,7 +39,7 @@
                         {{selectedProgram.enrollmentDateLabel}}
                     </td>
                     <td class="col-md-6">
-                        <input type="text" placeholder="{{dhis2CalendarFormat.keyDateFormat}}" class="form-control" d2-date ng-model="selectedEnrollment.dateOfEnrollment" ng-disabled="true"/>
+                        <input type="text" placeholder="{{dhis2CalendarFormat.keyDateFormat}}" class="form-control" d2-date ng-model="selectedEnrollment.enrollmentDate" ng-disabled="true"/>
                     </td>
                 </tr>
                 <tr class="col-md-12" ng-if="selectedProgram.displayIncidentDate">                    
@@ -47,7 +47,7 @@
                         {{selectedProgram.incidentDateLabel}}
                     </td>
                     <td class="col-md-6">
-                        <input type="text" placeholder="{{dhis2CalendarFormat.keyDateFormat}}" class="form-control" d2-date ng-model="selectedEnrollment.dateOfIncident" ng-disabled="true"/>
+                        <input type="text" placeholder="{{dhis2CalendarFormat.keyDateFormat}}" class="form-control" d2-date ng-model="selectedEnrollment.incidentDate" ng-disabled="true"/>
                     </td>
                 </tr>                
             </table>
@@ -107,10 +107,10 @@
                     </tr>
                     <tr ng-click="loadEnrollmentDetails(en)" ng-repeat="en in historicalEnrollments" title="{{'details'| translate}}">
                         <td>
-                            {{en.dateOfEnrollment}}
+                            {{en.enrollmentDate}}
                         </td>
                         <td ng-if="selectedProgram.displayIncidentDate">
-                            {{en.dateOfIncident}}
+                            {{en.incidentDate}}
                         </td>
                     </tr>
                 </table>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2015-03-26 12:26:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js	2015-09-11 15:16:03 +0000
@@ -49,7 +49,7 @@
 
         $timeout(function() { 
             $rootScope.$broadcast('registrationWidget', {registrationMode: 'PROFILE', selectedTei: $scope.selectedTei, enrollment: $scope.selectedEnrollment});
-        }, 100);
+        }, 200);
     };
     
     $scope.enableEdit = function(){
@@ -63,6 +63,6 @@
         $scope.editingDisabled = !$scope.editingDisabled;
         $timeout(function() { 
             $rootScope.$broadcast('registrationWidget', {registrationMode: 'PROFILE', selectedTei: $scope.selectedTei, enrollment: $scope.selectedEnrollment});
-        }, 100);
+        }, 200);
     };  
 });
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/enrollment-dates-form.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/enrollment-dates-form.html	2015-09-11 12:20:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/enrollment-dates-form.html	2015-09-11 15:16:03 +0000
@@ -14,14 +14,14 @@
         <td>
             <input type="text" 
                    placeholder="{{dhis2CalendarFormat.keyDateFormat}}" 
-                   name="dateOfEnrollment" 
+                   name="enrollmentDate" 
                    class="form-control" 
                    d2-date 
-                   ng-model="selectedEnrollment.dateOfEnrollment" 
+                   ng-model="selectedEnrollment.enrollmentDate" 
                    max-date="selectedProgram.selectEnrollmentDatesInFuture ? '' : 0"
                    min-date=""
                    ng-required="true"/>
-            <span ng-show="outerForm.submitted && outerForm.dateOfEnrollment.$invalid" class="error">{{'required'| translate}}</span>
+            <span ng-show="outerForm.submitted && outerForm.enrollmentDate.$invalid" class="error">{{'required'| translate}}</span>
         </td>
     </tr>     
     <tr ng-if="selectedProgram.displayIncidentDate">
@@ -31,12 +31,12 @@
         <td>
             <input type="text" 
                    placeholder="{{dhis2CalendarFormat.keyDateFormat}}"
-                   name="dateOfIncident"
+                   name="incidentDate"
                    class="form-control" 
                    d2-date 
                    max-date="selectedProgram.selectIncidentDatesInFuture ? '' : 0"
                    min-date=""
-                   ng-model="selectedEnrollment.dateOfIncident"/>
+                   ng-model="selectedEnrollment.incidentDate"/>
         </td>
     </tr>
 </table>

=== 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-09-03 15:45:33 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js	2015-09-11 15:16:03 +0000
@@ -56,7 +56,7 @@
     }
     
     $scope.selectedOrgUnit = SessionStorageService.get('SELECTED_OU');
-    $scope.selectedEnrollment = {dateOfEnrollment: $scope.today, dateOfIncident: $scope.today, orgUnitName: $scope.selectedOrgUnit.name};   
+    $scope.selectedEnrollment = {enrollmentDate: $scope.today, incidentDate: $scope.today, orgUnitName: $scope.selectedOrgUnit.name};   
             
     $scope.trackedEntities = {available: []};
     TEService.getAll().then(function(entities){
@@ -136,7 +136,7 @@
         CurrentSelection.set({tei: $scope.selectedTei, te: $scope.selectedTei.trackedEntity, prs: selections.prs, pr: $scope.selectedProgram, prNames: selections.prNames, prStNames: selections.prStNames, enrollments: selections.enrollments, selectedEnrollment: $scope.selectedEnrollment, optionSets: selections.optionSets});        
         $timeout(function() { 
             $rootScope.$broadcast('profileWidget', {});            
-        }, 100);
+        }, 200);
     };
     
     var notifyRegistrtaionCompletion = function(destination, teiId){
@@ -161,8 +161,8 @@
                         enrollment.program = $scope.selectedProgram.id;
                         enrollment.status = 'ACTIVE';
                         enrollment.orgUnit = $scope.selectedOrgUnit.id;
-                        enrollment.dateOfEnrollment = $scope.selectedEnrollment.dateOfEnrollment;
-                        enrollment.dateOfIncident = $scope.selectedEnrollment.dateOfIncident === '' ? $scope.selectedEnrollment.dateOfEnrollment : $scope.selectedEnrollment.dateOfIncident;
+                        enrollment.enrollmentDate = $scope.selectedEnrollment.enrollmentDate;
+                        enrollment.incidentDate = $scope.selectedEnrollment.incidentDate === '' ? $scope.selectedEnrollment.enrollmentDate : $scope.selectedEnrollment.incidentDate;
 
                         EnrollmentService.enroll(enrollment).then(function(enrollmentResponse){
                             var en = enrollmentResponse.response && enrollmentResponse.response.importSummaries && enrollmentResponse.response.importSummaries[0] ? enrollmentResponse.response.importSummaries[0] : {};
@@ -271,7 +271,7 @@
         CurrentSelection.setRelationshipInfo({tei: $scope.tei, src: $scope.selectedRelationshipSource});
         $timeout(function() { 
             $rootScope.$broadcast('relationship', {});
-        }, 100);
+        }, 200);
     };
     
     var processRuleEffect = function(){

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/registration.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/registration.html	2015-09-11 12:20:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/registration.html	2015-09-11 15:16:03 +0000
@@ -113,14 +113,14 @@
                     </td>
                     <td>
                         <input type="text" 
-                               name="dateOfEnrollment" 
+                               name="enrollmentDate" 
                                class="form-control" 
                                d2-date 
                                max-date="selectedProgramForRelative.selectEnrollmentDatesInFuture ? '' : 0"
                                min-date=""
                                ng-model="enrollment.enrollmentDate" 
                                ng-required="true"/>
-                        <span ng-show="outerForm.submitted && outerForm.dateOfEnrollment.$invalid" class="error">{{'required'| translate}}</span>
+                        <span ng-show="outerForm.submitted && outerForm.enrollmentDate.$invalid" class="error">{{'required'| translate}}</span>
                     </td>
                 </tr>     
                 <tr ng-if="selectedProgramForRelative.displayIncidentDate">

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js	2015-07-14 19:05:51 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js	2015-09-11 15:16:03 +0000
@@ -642,8 +642,8 @@
                     var enrollment = {trackedEntityInstance: teiId,
                                 program: $scope.selectedProgramForRelative.id,
                                 status: 'ACTIVE',
-                                dateOfEnrollment: DateUtils.formatFromUserToApi($scope.enrollment.enrollmentDate),
-                                dateOfIncident: $scope.enrollment.incidentDate === '' ? DateUtils.formatFromUserToApi($scope.enrollment.enrollmentDate) : DateUtils.formatFromUserToApi($scope.enrollment.incidentDate)
+                                enrollmentDate: DateUtils.formatFromUserToApi($scope.enrollment.enrollmentDate),
+                                incidentDate: $scope.enrollment.incidentDate === '' ? DateUtils.formatFromUserToApi($scope.enrollment.enrollmentDate) : DateUtils.formatFromUserToApi($scope.enrollment.incidentDate)
                             };
                     EnrollmentService.enroll(enrollment).then(function(enrollmentResponse){
                         var en = enrollmentResponse.response && enrollmentResponse.response.importSummaries && enrollmentResponse.response.importSummaries[0] ? enrollmentResponse.response.importSummaries[0] : {};
@@ -682,7 +682,7 @@
                 $scope.tei.id = teiId;
                 $scope.broadCastSelections();
                 
-            }, 100);        
+            }, 200);        
             
         });
     };
@@ -700,7 +700,7 @@
             
             $timeout(function() { 
                 $rootScope.$broadcast('relationship', {});
-            }, 100);
+            }, 200);
         }        
     };
 });
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2015-08-26 10:26:31 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html	2015-09-11 15:16:03 +0000
@@ -1,6 +1,6 @@
 <div class="panel panel-info" ng-controller="RelationshipController">
     <div class="panel-heading handle bold">
-        {{relationshipWidget.title| translate}}
+        {{relationshipsWidget.title| translate}}
         <span class="nav-pills" ng-if="selectedTei && selectedProgram.relationshipText  && !selectedTei.inactive">
             | <a href ng-click="showAddRelationship(true)" title="{{'add_relationship'| translate}}"><span ng-class="{true: 'widget-link-active', false: 'widget-link'} [showAddRelationshipDiv]">{{selectedProgram.relationshipText}}</span></a>
         </span>        
@@ -10,14 +10,14 @@
         </span>
         
         <span class="pull-right widget-link">
-            <a class="small-horizonal-spacing" href ng-click="expandCollapse(relationshipWidget)">
-                <span ng-show="relationshipWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span>
-                <span ng-show="!relationshipWidget.expand"><i class="fa fa-chevron-down" title="{{'expand'| translate}}"></i></span>
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(relationshipsWidget)">
+                <span ng-show="relationshipsWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!relationshipsWidget.expand"><i class="fa fa-chevron-down" title="{{'expand'| translate}}"></i></span>
             </a>
-            <a class="small-horizonal-spacing" href ng-click="removeWidget(relationshipWidget)" title="{{'remove'| translate}}"><i class="fa fa-times-circle"></i></a>            
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(relationshipsWidget)" title="{{'remove'| translate}}"><i class="fa fa-times-circle"></i></a>            
         </span>        
     </div>
-    <div ng-show="relationshipWidget.expand" class="panel-body dashboard-widget-container">
+    <div ng-show="relationshipsWidget.expand" class="panel-body dashboard-widget-container">
         <div ng-show="selectedTei && !selectedTei.relationships || selectedTei.relationships.length < 1" class="alert alert-warning">{{'no_relationship'| translate}}</div> 
         <div ng-show="!selectedTei" class="alert alert-danger">{{'relationship_not_possible'| translate}}</div> 
         

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-details.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-details.html	2015-09-11 12:20:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-details.html	2015-09-11 15:16:03 +0000
@@ -35,10 +35,10 @@
         <div class="row" ng-repeat="enrollment in enrollments">
             <h2 class='col-sm-12'>{{'enrollment'| translate}} {{'_details'| translate}}</h2>
             <div class="col-sm-4">
-                <span class="bold">{{selectedProgram.enrollmentDateLabel}}:</span>  {{enrollment.dateOfEnrollment}}            
+                <span class="bold">{{selectedProgram.enrollmentDateLabel}}:</span>  {{enrollment.enrollmentDate}}            
             </div>
             <div class="col-sm-4">
-                <span class="bold">{{selectedProgram.incidentDateLabel}}:</span>    {{enrollment.dateOfIncident}}            
+                <span class="bold">{{selectedProgram.incidentDateLabel}}:</span>    {{enrollment.incidentDate}}            
             </div>
             <div class="col-sm-4">
                 <span class="bold">{{'status'| translate}}:</span>  {{enrollment.status}}

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js	2015-08-31 12:49:17 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js	2015-09-11 15:16:03 +0000
@@ -149,8 +149,8 @@
 
                 //get enrollment details
                 EnrollmentService.get(enr).then(function(enrollment){
-                    enrollment.dateOfEnrollment = DateUtils.formatFromApiToUser(enrollment.dateOfEnrollment);
-                    enrollment.dateOfIncident = DateUtils.formatFromApiToUser(enrollment.dateOfIncident);            
+                    enrollment.enrollmentDate = DateUtils.formatFromApiToUser(enrollment.enrollmentDate);
+                    enrollment.incidentDate = DateUtils.formatFromApiToUser(enrollment.incidentDate);            
                     angular.forEach(enrollment.notes, function(note){
                         note.storedDate = DateUtils.formatToHrsMins(note.storedDate);
                     });            

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html	2015-02-06 20:22:45 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html	2015-09-11 15:16:03 +0000
@@ -1,15 +1,15 @@
 <div class="panel panel-info" ng-controller="SelectedInfoController">
     <div class="panel-heading handle bold">
-        {{selectedWidget.title| translate}}
+        {{current_selectionsWidget.title| translate}}
         <span class="pull-right widget-link">
-            <a class="small-horizonal-spacing" href ng-click="expandCollapse(selectedWidget)">
-                <span ng-show="selectedWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span>
-                <span ng-show="!selectedWidget.expand"><i class="fa fa-chevron-down" title="{{'expand'| translate}}"></i></span>
+            <a class="small-horizonal-spacing" href ng-click="expandCollapse(current_selectionsWidget)">
+                <span ng-show="current_selectionsWidget.expand"><i class="fa fa-chevron-up" title="{{'collapse'| translate}}"></i></span>
+                <span ng-show="!current_selectionsWidget.expand"><i class="fa fa-chevron-down" title="{{'expand'| translate}}"></i></span>
             </a>
-            <a class="small-horizonal-spacing" href ng-click="removeWidget(selectedWidget)" title="{{'remove'| translate}}"><i class="fa fa-times-circle"></i></a>            
+            <a class="small-horizonal-spacing" href ng-click="removeWidget(current_selectionsWidget)" title="{{'remove'| translate}}"><i class="fa fa-times-circle"></i></a>            
         </span>        
     </div>    
-    <div ng-show="selectedWidget.expand" class="panel-body dashboard-element-container">
+    <div ng-show="current_selectionsWidget.expand" class="panel-body dashboard-element-container">
         <div class="row" ng-repeat="selection in selections">
             <div class="col-sm-6">
                 {{selection.title| translate}}

=== 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-08-26 10:26:31 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-09-11 15:16:03 +0000
@@ -187,6 +187,7 @@
 visit=Visit
 visits=Visits
 current_selections=Current selections
+activePrograms=Active programs
 org_unit=Organisation unit
 org_unit_scope=Organisation unit scope
 SELECTED=Selected
@@ -346,6 +347,7 @@
 dec=December
 week=Week
 save_layout_as_default=Save dashboard layout as default
+reset_layout=Reset dashboard layout
 is_expected_to_be=is expected to be
 but_found=but found
 equals_to=equals to

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html	2015-08-27 19:05:47 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html	2015-09-11 15:16:03 +0000
@@ -120,6 +120,7 @@
         <script type="text/javascript" src="components/profile/profile-controller.js"></script>        
         <script type="text/javascript" src="components/notes/notes-controller.js"></script>
         <script type="text/javascript" src="components/rulebound/rulebound-controller.js"></script>
+        <script type="text/javascript" src="components/activeprograms/active-programs-controller.js"></script>
 
         <!-- Menu scripts -->
         <script type="text/javascript" src="../dhis-web-commons/javascripts/dhis2/dhis2.translate.js"></script>

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2015-09-03 16:09:29 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2015-09-11 15:16:03 +0000
@@ -311,7 +311,7 @@
             $scope.showSearchDiv = false;
             $timeout(function() { 
                 $rootScope.$broadcast('registrationWidget', {registrationMode: 'REGISTRATION'});
-            }, 1000);
+            }, 200);
         }
         else{
             $scope.doSearch = true;

=== 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-09-03 16:09:29 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2015-09-11 15:16:03 +0000
@@ -29,9 +29,11 @@
     w.selectedWidget = {title: 'current_selections', view: "components/selected/selected.html", show: false, expand: true, parent: 'smallerWidget', order: 0};
     w.feedbackWidget = {title: 'feedback', view: "components/rulebound/rulebound.html", show: true, expand: true, parent: 'smallerWidget', order: 1};
     w.profileWidget = {title: 'profile', view: "components/profile/profile.html", show: true, expand: true, parent: 'smallerWidget', order: 2};
-    w.relationshipWidget = {title: 'relationships', view: "components/relationship/relationship.html", show: true, expand: true, parent: 'smallerWidget', order: 3};
-    w.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true, expand: true, parent: 'smallerWidget', order: 4};            
+    w.activeProgramsWidget = {title: 'activePrograms', view: "components/activeprograms/active-programs.html", show: false, expand: true, parent: 'smallerWidget', order: 3};
+    w.relationshipWidget = {title: 'relationships', view: "components/relationship/relationship.html", show: true, expand: true, parent: 'smallerWidget', order: 4};
+    w.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true, expand: true, parent: 'smallerWidget', order: 5};            
     var defaultLayout = new Object();
+    
     defaultLayout['DEFAULT'] = {widgets: w, program: 'DEFAULT'};
     
     var getDefaultLayout = function(customLayout){
@@ -107,11 +109,11 @@
             return;
         }
         
-        var referenceDate = enrollment.dateOfIncident ? enrollment.dateOfIncident : enrollment.dateOfEnrollment;
+        var referenceDate = enrollment.incidentDate ? enrollment.incidentDate : enrollment.enrollmentDate;
         var offset = stage.minDaysFromStart;
         
         if(stage.generatedByEnrollmentDate){
-            referenceDate = enrollment.dateOfEnrollment;
+            referenceDate = enrollment.enrollmentDate;
         }        
                
         var occupiedPeriods = [];
@@ -590,20 +592,20 @@
     var convertFromApiToUser = function(enrollment){
         if(enrollment.enrollments){
             angular.forEach(enrollment.enrollments, function(enrollment){
-                enrollment.dateOfIncident = DateUtils.formatFromApiToUser(enrollment.dateOfIncident);
-                enrollment.dateOfEnrollment = DateUtils.formatFromApiToUser(enrollment.dateOfEnrollment);                
+                enrollment.incidentDate = DateUtils.formatFromApiToUser(enrollment.incidentDate);
+                enrollment.enrollmentDate = DateUtils.formatFromApiToUser(enrollment.enrollmentDate);                
             });
         }
         else{
-            enrollment.dateOfIncident = DateUtils.formatFromApiToUser(enrollment.dateOfIncident);
-            enrollment.dateOfEnrollment = DateUtils.formatFromApiToUser(enrollment.dateOfEnrollment);
+            enrollment.incidentDate = DateUtils.formatFromApiToUser(enrollment.incidentDate);
+            enrollment.enrollmentDate = DateUtils.formatFromApiToUser(enrollment.enrollmentDate);
         }
         
         return enrollment;
     };
     var convertFromUserToApi = function(enrollment){
-        enrollment.dateOfIncident = DateUtils.formatFromUserToApi(enrollment.dateOfIncident);
-        enrollment.dateOfEnrollment = DateUtils.formatFromUserToApi(enrollment.dateOfEnrollment);
+        enrollment.incidentDate = DateUtils.formatFromUserToApi(enrollment.incidentDate);
+        enrollment.enrollmentDate = DateUtils.formatFromUserToApi(enrollment.enrollmentDate);
         return enrollment;
     };
     return {        
@@ -1376,8 +1378,8 @@
 
 /* current selections */
 .service('CurrentSelection', function(){
-    this.currentSelection = '';
-    this.relationshipInfo = '';
+    this.currentSelection = {};
+    this.relationshipInfo = {};
     this.optionSets = null;
     this.attributesById = null;
     this.ouLevels = null;
@@ -1564,13 +1566,13 @@
     
     var getEventDueDate = function(eventsByStage, programStage, enrollment){       
         
-        var referenceDate = enrollment.dateOfIncident ? enrollment.dateOfIncident : enrollment.dateOfEnrollment,
+        var referenceDate = enrollment.incidentDate ? enrollment.incidentDate : enrollment.enrollmentDate,
             offset = programStage.minDaysFromStart,
             calendarSetting = CalendarService.getSetting(),
             dueDate;
 
         if(programStage.generatedByEnrollmentDate){
-            referenceDate = enrollment.dateOfEnrollment;
+            referenceDate = enrollment.enrollmentDate;
         }
 
         if(programStage.repeatable){
@@ -1706,11 +1708,11 @@
                         }
                         
                         if(stage.openAfterEnrollment){
-                            if(stage.reportDateToUse === 'dateOfIncident'){
-                                newEvent.eventDate = DateUtils.formatFromUserToApi(enrollment.dateOfIncident);
+                            if(stage.reportDateToUse === 'incidentDate'){
+                                newEvent.eventDate = DateUtils.formatFromUserToApi(enrollment.incidentDate);
                             }
                             else{
-                                newEvent.eventDate = DateUtils.formatFromUserToApi(enrollment.dateOfEnrollment);
+                                newEvent.eventDate = DateUtils.formatFromUserToApi(enrollment.enrollmentDate);
                             }
                         }