← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19974: tracker-capture: type->valueType change - WIP

 

------------------------------------------------------------
revno: 19974
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-09-03 17:45:33 +0200
message:
  tracker-capture: type->valueType change - WIP
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/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/scripts/controllers.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/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js	2015-08-26 10:26:31 +0000
+++ 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
@@ -14,7 +14,7 @@
                 SessionStorageService,
                 TEIService, 
                 TEService,
-                OptionSetService,
+                MetaDataFactory,
                 EnrollmentService,
                 ProgramFactory,
                 DHIS2EventFactory,
@@ -169,8 +169,8 @@
     if($scope.selectedTeiId){
         
         //get option sets
-        $scope.optionSets = [];
-        OptionSetService.getAll().then(function(optionSets){            
+        $scope.optionSets = [];     
+        MetaDataFactory.getAll('optionSets').then(function(optionSets){            
             angular.forEach(optionSets, function(optionSet){
                 $scope.optionSets[optionSet.id] = optionSet;
             });

=== 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-08-27 19:05:47 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-form.html	2015-09-03 15:45:33 +0000
@@ -21,7 +21,7 @@
                     </ui-select>
                 </span>
                 <span ng-if="!attribute.optionSetValue" ng-switch="attribute.valueType">
-                    <span ng-switch-when="date">
+                    <span ng-switch-when="DATE">
                         <input type="text" 
                                placeholder="{{dhis2CalendarFormat.keyDateFormat}}" 
                                name="foo" 
@@ -34,7 +34,7 @@
                                blur-or-change="teiValueUpdated(selectedTei, attribute.id)"
                                ng-required="attribute.mandatory || attribute.unique"/>
                     </span>
-                    <span ng-switch-when="trueOnly">
+                    <span ng-switch-when="TRUE_ONLY">
                         <input type="checkbox" 
                                name="foo" 
                                class="form-control" 
@@ -43,7 +43,7 @@
                                ng-change="teiValueUpdated(selectedTei, attribute.id)"
                                ng-required="attribute.mandatory || attribute.unique"/>
                     </span>
-                    <span ng-switch-when="bool">
+                    <span ng-switch-when="BOOLEAN">
                         <select name="foo" 
                                 ng-model="selectedTei[attribute.id]" 
                                 class="form-control" 
@@ -55,7 +55,7 @@
                             <option value="true">{{'yes'| translate}}</option>
                         </select>
                     </span>                    
-                    <span ng-switch-when="number">
+                    <span ng-switch-when="NUMBER">
                         <input type="number" 
                                name="foo" 
                                class="form-control" 
@@ -64,7 +64,7 @@
                                ng-blur="teiValueUpdated(selectedTei, attribute.id)"
                                ng-required="attribute.mandatory || attribute.unique"/>
                     </span>
-                    <span ng-switch-when="email">
+                    <span ng-switch-when="EMAIL">
                         <input type="email" 
                                name="foo" 
                                class="form-control" 
@@ -73,6 +73,16 @@
                                ng-blur="teiValueUpdated(selectedTei, attribute.id)"
                                ng-required="attribute.mandatory || attribute.unique"/>
                     </span>
+                     <span ng-switch-when="LONG_TEXT">
+                        <textarea row="3"
+                               name="foo" 
+                               class="form-control" 
+                               ng-model="selectedTei[attribute.id]" 
+                               ng-disabled="editingDisabled" 
+                               ng-blur="teiValueUpdated(selectedTei, attribute.id)"
+                               ng-required="attribute.mandatory || attribute.unique">                                   
+                        </textarea>/>                                    
+                    </span>
                     <span ng-switch-default>
                         <input type="text" 
                                name="foo" 

=== 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-08-28 12:34:43 +0000
+++ 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
@@ -13,7 +13,7 @@
                 EnrollmentService,
                 DialogService,
                 CurrentSelection,
-                OptionSetService,
+                MetaDataFactory,
                 EventUtils,
                 RegistrationService,
                 DateUtils,
@@ -26,7 +26,7 @@
     $scope.customForm = null;    
     $scope.selectedTei = {};
     $scope.tei = {};
-    $scope.registrationMode = null;    
+    $scope.registrationMode = 'REGISTRATION';    
     $scope.hiddenFields = {};
     $scope.errorMessages = {};
     $scope.warningMessages = {};
@@ -46,7 +46,7 @@
     $scope.optionSets = CurrentSelection.getOptionSets();        
     if(!$scope.optionSets){
         $scope.optionSets = [];
-        OptionSetService.getAll().then(function(optionSets){
+        MetaDataFactory.getAll('optionSets').then(function(optionSets){
             angular.forEach(optionSets, function(optionSet){                        
                 $scope.optionSets[optionSet.id] = optionSet;
             });

=== 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-08-25 20:05:49 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js	2015-09-03 15:45:33 +0000
@@ -15,6 +15,7 @@
                 $timeout,
                 Paginator,
                 SessionStorageService,
+                MetaDataFactory,
                 DateUtils,
                 OptionSetService,
                 OrgUnitFactory,
@@ -69,13 +70,12 @@
             
             if(!$scope.optionSets){
                 $scope.optionSets = [];
-                OptionSetService.getAll().then(function(optionSets){
-                    angular.forEach(optionSets, function(optionSet){                        
+                MetaDataFactory.getAll('optionSets').then(function(optionSets){
+                    angular.forEach(optionSets, function(optionSet){  
                         $scope.optionSets[optionSet.id] = optionSet;
                     });
-                    
                     CurrentSelection.setOptionSets($scope.optionSets);
-                });
+                });                
             }
             $scope.loadPrograms($scope.selectedOrgUnit);
         }