← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 20518: tracker-capture: tracker associate is now complete. It is possible to either search and select fr...

 

------------------------------------------------------------
revno: 20518
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-10-06 12:52:09 +0200
message:
  tracker-capture: tracker associate is now complete. It is possible to either search and select from existing or register new TEI. If a program is selected when registering new, enrollment will also be conducted.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-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/relationship-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add.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-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.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/registration/default-registration-form.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-form.html	2015-09-24 14:38:58 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-form.html	2015-10-06 10:52:09 +0000
@@ -92,7 +92,7 @@
                                ng-blur="teiValueUpdated(selectedTei, attribute.id)"
                                style="width:75%;"
                                ng-required="attribute.mandatory || attribute.unique"/>
-                        <a href ng-class="{true: 'disable-clicks', false: ''} [editingDisabled]" ng-click="getTrackerAssociate(attribute)" title="{{'add'| translate}} {{attribute.name}}">
+                        <a href ng-class="{true: 'disable-clicks', false: ''} [editingDisabled]" ng-click="getTrackerAssociate(attribute, selectedTei[attribute.id])" title="{{'add'| translate}} {{attribute.name}}">
                             <i class="fa fa-external-link fa-2x vertical-center"></i>
                         </a>
                         <a href ng-if="selectedTei[attribute.id]" ng-class="{true: 'disable-clicks', false: ''} [editingDisabled]" ng-click="selectedTei[attribute.id] = null" title="{{'add'| translate}} {{attribute.name}}">

=== 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-05 13:56:43 +0000
+++ 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
@@ -343,9 +343,8 @@
         return status;        
     };
     
-    $scope.getTrackerAssociate = function(selectedAttribute){
-        
-        
+    $scope.getTrackerAssociate = function(selectedAttribute, existingAssociateUid){        
+
         var modalInstance = $modal.open({
             templateUrl: 'components/teiadd/tei-add.html',
             controller: 'TEIAddController',
@@ -366,6 +365,9 @@
                 selectedAttribute: function(){
                     return selectedAttribute;
                 },
+                existingAssociateUid: function(){
+                    return existingAssociateUid;
+                },
                 selectedProgram: function(){
                     return $scope.selectedProgram;
                 },

=== 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-09-23 14:06:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js	2015-10-06 10:52:09 +0000
@@ -62,6 +62,9 @@
                     selectedAttribute: function(){
                         return null;
                     },
+                    existingAssociateUid: function(){
+                        return null;
+                    },
                     addingRelationship: function(){
                         return true;
                     },

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add-controller.js	2015-10-05 13:56:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add-controller.js	2015-10-06 10:52:09 +0000
@@ -23,11 +23,11 @@
             relatedProgramRelationship,
             selections,
             selectedAttribute,
+            existingAssociateUid,
             addingRelationship,
             selectedTei){
     
     $scope.maxOptionSize = 30;
-    
     $scope.attributesById = CurrentSelection.getAttributesById();
     if(!$scope.attributesById){
         $scope.attributesById = [];
@@ -115,6 +115,15 @@
             $scope.selectedProgram = response.selectedProgram;
         });
         
+        if(existingAssociateUid){
+            TEIService.get(existingAssociateUid, $scope.optionSets, $scope.attributesById).then(function(data){
+                $scope.selectedTeiForDisplay = data;
+            });
+        }
+        else{
+            $scope.selectedTeiForDisplay = null;
+        }
+        
         CurrentSelection.setRelationshipOwner({});
         //$scope.selectedTei = {};
     }

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add.html	2015-10-05 13:56:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/teiadd/tei-add.html	2015-10-06 10:52:09 +0000
@@ -13,12 +13,18 @@
         </div>
     </div>
 
-    <div class="row" ng-if="relationship.selected || !addingRelationship">
-        <hr>
-        <div class="col-md-3" ng-if="addingRelationship">
+    <div class="row">
+        <hr ng-if="addingRelationship">
+        <h3 ng-if="!addingRelationship && selectedTeiForDisplay">
+            <span class='col-sm-12'>
+                {{'existing_associate' | translate}}
+            </span>            
+        </h3>
+        <div class="col-md-3" ng-if="addingRelationship || selectedTeiForDisplay">            
             <select name="foo" 
                     ng-model="selectedRelationship.aIsToB" 
                     class="form-control" 
+                    ng-if="addingRelationship"
                     ng-change="setRelationshipSides('A')"
                     ng-disabled="selectedProgramForRelative && selectedProgram.relatedProgram && relatedProgramRelationship">
                 <option>{{relationship.selected.aIsToB}}</option>
@@ -38,8 +44,7 @@
             </div>
         </div>
         
-        <div ng-class="{true: 'col-md-9 pull-right', false: 'col-sm-12'} [addingRelationship]">
-            
+        <div ng-class="{true: 'col-md-9 pull-right', false: 'col-sm-12'} [addingRelationship || selectedTeiForDisplay]">            
             <div ng-if="addingRelationship">
                 <select name="foo" 
                         ng-model="selectedRelationship.bIsToA" 
@@ -96,12 +101,14 @@
 
                 <!-- entity grid begins -->
                 <i ng-if="!teiFetched" class="fa fa-spinner fa-spin fa-2x"></i>
-                <div class="row col-sm-12" ng-if="!showRegistrationDiv" ng-include="'views/tei.html'"></div>
+                <div class="row" ng-if="!showRegistrationDiv">
+                    <div class="col-sm-12" ng-include="'views/tei.html'"></div>               
+                </div>
                 <!-- entity grid ends -->
 
                 <!--- Error display for search begins -->
                 <div class="row" ng-if="emptySearchAttribute || !searchText.value && emptySearchText">
-                    <div class="col-md-12 vertical-spacing">
+                    <div class="col-sm-12 vertical-spacing">
                         <div class="alert alert-danger">{{'search_input_required'| translate}}</div>         
                     </div>
                 </div>

=== 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-05 08:58:13 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties	2015-10-06 10:52:09 +0000
@@ -366,4 +366,5 @@
 extend_menu=Extend menu
 show_main_menu=Show main menu
 stick_right_widgets=Stick right side widgets
-unstick_right_widgets=Unstick right side widgets
\ No newline at end of file
+unstick_right_widgets=Unstick right side widgets
+existing_associate=Existing associate
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-10-05 13:54:45 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2015-10-06 10:52:09 +0000
@@ -553,11 +553,11 @@
                                     newInputField = '<input type="text" ' +
                                             ' ng-blur="teiValueUpdated(selectedTei,\'' + attId + '\')" ' +
                                             commonInputFieldProperty + ' >' + 
-                                            '<a href ng-class="{true: \'disable-clicks\', false: \'\'} [editingDisabled]" ng-click="getTrackerAssociate(attributesById.' + attId + ')" title="{{\'add\' | translate}} {{attributesById.' + attId + '.name}}" ' + 
-                                            '<i class="fa fa-external-link vertical-center"></i> ' + 
+                                            '<a href ng-class="{true: \'disable-clicks\', false: \'\'} [editingDisabled]" ng-click="getTrackerAssociate(attributesById.' + attId + ', selectedTei.' + attId + ')" title="{{\'add\' | translate}} {{attributesById.' + attId + '.name}}" ' + 
+                                            '<i class="fa fa-external-link fa-2x vertical-center"></i> ' + 
                                             '</a> ' +
-                                            '<a href ng-class="{true: \'disable-clicks\', false: \'\'} [editingDisabled]" ng-click="selectedTei.' + attId + ' = null" title="{{\'remove\' | translate}} {{attributesById.' + attId + '.name}}" ' + 
-                                            '<i class="fa fa-trash-o vertical-center"></i> ' + 
+                                            '<a href ng-if="selectedTei.' + attId + '" ng-class="{true: \'disable-clicks\', false: \'\'} [editingDisabled]" ng-click="selectedTei.' + attId + ' = null" title="{{\'remove\' | translate}} {{attributesById.' + attId + '.name}}" ' + 
+                                            '<i class="fa fa-trash-o fa-2x vertical-center"></i> ' + 
                                             '</a>';
                                 }
                                 else if (att.valueType === "LONG_TEXT") {