← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21913: tracker-capture: use d2-radio button for attributes of type boolean in registration and enrollmen...

 

------------------------------------------------------------
revno: 21913
committer: Abyot Asalefew Gizaw <abyot@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2016-02-09 11:48:20 +0100
message:
  tracker-capture: use d2-radio button for attributes of type boolean in registration and enrollment forms.
modified:
  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/registration/default-registration-form.html
  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/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2016-02-08 08:54:46 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2016-02-09 10:48:20 +0000
@@ -6,7 +6,6 @@
                 $modal,
                 $filter,
                 $log,
-                $http,
                 $timeout,
                 $translate,
                 $window,
@@ -114,7 +113,7 @@
         else {
             return {showInStageLegend: true};
         }
-    }
+    };
     
     $scope.getLegendText = function(description){
         var useInStage = true;
@@ -278,7 +277,7 @@
                     var processedValue = $filter('trimquotes')(effect.data);
                     affectedEvent[effect.dataElement.id] = processedValue;
                     $scope.assignedFields[event][effect.dataElement.id] = true;
-                    $scope.saveDataValueForEvent($scope.prStDes[effect.dataElement.id], null, affectedEvent, true)
+                    $scope.saveDataValueForEvent($scope.prStDes[effect.dataElement.id], null, affectedEvent, true);
                 }
             }
         });

=== 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	2016-02-04 10:43:43 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/default-registration-form.html	2016-02-09 10:48:20 +0000
@@ -63,7 +63,16 @@
                                ng-required="attribute.mandatory || attribute.unique"/>
                     </span>
                     <span ng-switch-when="BOOLEAN" class="form-control">
-                        <label class="radio-inline">
+                        <d2-radio-button
+                            dh-required="attribute.mandatory || attribute.unique"
+                            dh-disabled="editingDisabled"
+                            dh-value="selectedTei[attribute.id]"
+                            dh-name="foo"
+                            dh-current-element="currentElement"
+                            dh-event="currentEvent.event"
+                            dh-id="attribute.id">
+                        </d2-radio-button>
+                        <!--<label class="radio-inline">
                             <input  type="radio"
                                     ng-model="selectedTei[attribute.id]"
                                     d2-attribute-validator 
@@ -102,7 +111,7 @@
                                     ng-required="attribute.mandatory || attribute.unique" 
                                     value="false"> 
                             {{'no'| translate}}
-                        </label>
+                        </label>-->
                     </span>                    
                     <span ng-switch-when="NUMBER">
                         <input type="number"

=== 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	2016-02-08 15:14:39 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/dhis2/dhis2.angular.services.js	2016-02-09 10:48:20 +0000
@@ -601,15 +601,15 @@
                                             '</span>';
                                     }
                                     else if (att.valueType === "BOOLEAN") {
-                                        newInputField = '<label class="radio-inline"><span><input type="radio" ng-change="teiValueUpdated(selectedTei,\'' + attId + '\')" ' + commonInputFieldProperty + ' value="">{{\'no_value\'| translate}}' +
-                                            '<d2-audit class="hideInPrint" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}}></d2-audit>'+
-                                            '</span></label>' +
-                                            '<label class="radio-inline"><span><input type="radio" ng-change="teiValueUpdated(selectedTei,\'' + attId + '\')" ' + commonInputFieldProperty + ' value="true">{{\'yes\'| translate}}' +
-                                            '<d2-audit class="hideInPrint" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}}></d2-audit>'+
-                                            '</span></label>' +
-                                            '<label class="radio-inline"><input type="radio" ng-change="teiValueUpdated(selectedTei,\'' + attId + '\')" ' + commonInputFieldProperty + ' value="false">{{\'no\'| translate}}' +
-                                            '<d2-audit class="hideInPrint" dataelement-id="'+att.id+'" dataelement-name="'+att.name+'" data-type="attribute" selected-tei-id={{selectedTei.trackedEntityInstance}} ></d2-audit>'+
-                                            '</span></label>';
+                                    	newInputField = '<d2-radio-button ' +
+                                                                ' dh-required=" ' + (att.mandatory || att.unique) + '" ' +
+                                                                ' dh-disabled="editingDisabled || isHidden(attributesById.' + attId + '.id) || ' + isTrackerAssociate + '"' +
+                                                                ' dh-value="selectedTei.' + attId + '" ' +
+                                                                ' dh-name="foo" ' +
+                                                                ' dh-current-element="currentElement" ' +
+                                                                ' dh-event="currentEvent.event" ' +
+                                                                ' dh-id="' + attId + '" ' +
+                                                        ' </d2-radio-button>';
                                     }
                                     else if (att.valueType === "DATE") {
                                         newInputField = '<span ng-controller="InputController"><input  type="text" ng-class="{\'input-with-audit\':inputObj.isAuditIconPresent}"' +