← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16186: tracker capture - remember selected program when returning back from dashboard; minor validation ...

 

------------------------------------------------------------
revno: 16186
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Fri 2014-07-18 18:47:49 +0200
message:
  tracker capture - remember selected program when returning back from dashboard; minor validation fix for enrollment
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js
  dhis-2/dhis-web/dhis-web-tracker-capture/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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2014-07-17 10:35:43 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2014-07-18 16:47:49 +0000
@@ -99,7 +99,7 @@
     };     
     
     $scope.back = function(){
-        $location.path('/');
+        $location.path('/').search({program: $scope.selectedProgramId});                   
     };
     
     $scope.displayEnrollment = false;

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2014-07-18 13:59:12 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2014-07-18 16:47:49 +0000
@@ -138,7 +138,6 @@
                     </tr>
                 </table>
             </div>
-            <div class='row'><hr></div>
             <div class="form-group">
                 <div">
                         <a href ng-click="completeIncompleteEvent()" class="btn btn-warning" ng-if="currentEvent.eventDate && currentEvent.status === 'ACTIVE'">{{'complete'| translate}}</a>

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2014-07-17 10:35:43 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2014-07-18 16:47:49 +0000
@@ -310,7 +310,6 @@
             
             if($scope.dhis2Events.events.length > 0){
                 DHIS2EventFactory.create($scope.dhis2Events).then(function(data) {
-                    console.log('the response is:  ', data);
                 });
             }
         }

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2014-07-18 13:09:24 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2014-07-18 16:47:49 +0000
@@ -87,15 +87,15 @@
                             <ng-form name="innerForm">
                                 <div ng-switch="attribute.valueType">
                                     <div ng-switch-when="date">
-                                        <input type="text" class="form-control" ng-date ng-model="attribute.value" ng-required="attribute.mandatory"/>
+                                        <input type="text" class="form-control" name="foo" ng-date ng-model="attribute.value" ng-required="attribute.mandatory"/>
                                         <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
                                     </div>
                                     <div ng-switch-when="trueOnly">
-                                        <input type="checkbox" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/>
+                                        <input type="checkbox" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
                                         <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
                                     </div>
                                     <div ng-switch-when="bool">
-                                        <select ng-model="attribute.value" class="form-control" ng-required="attribute.mandatory">
+                                        <select ng-model="attribute.value" name="foo" class="form-control" ng-required="attribute.mandatory">
                                             <option value="">{{'please_select'| translate}}</option>                        
                                             <option value="0">{{'no'| translate}}</option>
                                             <option value="1">{{'yes'| translate}}</option>
@@ -104,6 +104,7 @@
                                     </div>
                                     <div ng-switch-when="optionSet">
                                         <input type="text" 
+                                               name="foo"
                                                class="form-control"
                                                ng-model="attribute.value"                                                 
                                                typeahead="option for option in attribute.optionSet.options | filter:$viewValue | limitTo:20" 
@@ -113,11 +114,11 @@
                                         <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
                                     </div>
                                     <div ng-switch-when="number">
-                                        <input type="number" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/>
+                                        <input type="number" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
                                         <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
                                     </div>
                                     <div ng-switch-default>
-                                        <input type="text" class="form-control" ng-model="attribute.value" ng-required="attribute.mandatory"/>
+                                        <input type="text" class="form-control" name="foo" ng-model="attribute.value" ng-required="attribute.mandatory"/>
                                         <span ng-show="outerForm.submitted && innerForm.foo.$invalid" style="color:red;font-size:12px">{{'required'| translate}}</span>
                                     </div>
                                 </div>

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-07-15 13:13:11 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2014-07-18 16:47:49 +0000
@@ -18,9 +18,12 @@
                 TEIGridService,
                 TEIService) {  
     
+    $scope.dashboardProgramId = ($location.search()).program; 
+            
     //Selection
     $scope.ouModes = [{name: 'SELECTED'}, {name: 'CHILDREN'}, {name: 'DESCENDANTS'}, {name: 'ACCESSIBLE'}];         
     $scope.selectedOuMode = $scope.ouModes[0];
+    $scope.dashboardProgramId = ($location.search()).program; 
     
     //Paging
     $scope.pager = {pageSize: 50, page: 1, toolBarDisplay: 5};   
@@ -79,6 +82,24 @@
         }
     });
     
+    //watch for program feedback (this is when coming back from dashboar)
+    $scope.$watch('dashboardProgramId', function() {           
+        
+        if( !angular.isUndefined($scope.dashboardProgramId) && $scope.dashboardProgramId){               
+            $scope.selectedOrgUnit = storage.get('SELECTED_OU');            
+            
+            ProgramFactory.get($scope.dashboardProgramId).then(function(program){
+                $scope.selectedProgram = program;
+                AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){
+                    $scope.attributes = atts;   
+                    $scope.attributes = $scope.generateAttributeFilters($scope.attributes);
+                    $scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name);      
+                    $scope.getProgramAttributes($scope.selectedProgram);
+                });              
+            });
+        }
+    });
+    
     //load programs associated with the selected org unit.
     $scope.loadPrograms = function(orgUnit) {        
                 

=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2014-07-18 13:18:34 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js	2014-07-18 16:47:49 +0000
@@ -1096,7 +1096,7 @@
                     column.show = true;    
                 }
 
-                if(column.displayInListNoProgram){
+                if(column.displayInListNoProgram || column.displayInList){
                     column.show = true;
                 }           
             });