← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21186: tracker-capture: bug fix in recording provided elsewhere information

 

------------------------------------------------------------
revno: 21186
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2015-11-24 14:06:54 +0100
message:
  tracker-capture: bug fix in recording provided elsewhere information
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/dataentry/default-form.html


--
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	2015-11-22 21:25:25 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-11-24 13:06:54 +0000
@@ -235,6 +235,7 @@
         $rootScope.ruleeffects = {};
         $scope.prStDes = [];
         $scope.allProgramRules = [];
+        $scope.allowProvidedElsewhereExists = [];
 
         var selections = CurrentSelection.get();
         $scope.selectedOrgUnit = SessionStorageService.get('SELECTED_OU');
@@ -251,9 +252,12 @@
                     if (stage.openAfterEnrollment) {
                         $scope.currentStage = stage;
                     }
-
+          
                     angular.forEach(stage.programStageDataElements, function (prStDe) {
                         $scope.prStDes[prStDe.dataElement.id] = prStDe;
+                        if(prStDe.allowProvidedElsewhere){
+                            $scope.allowProvidedElsewhereExists[stage.id] = true;
+                        }
                     });
 
                     $scope.stagesById[stage.id] = stage;

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html	2015-10-08 13:59:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/default-form.html	2015-11-24 13:06:54 +0000
@@ -4,9 +4,9 @@
             <tr>
                 <th ng-bind="dataElementLabel">
                 </th>
-                <th ng-bind="valueLabel">
+                <th class="align-center" ng-bind="valueLabel">
                 </th>
-                <th ng-if="allowProvidedElsewhereExists" ng-bind="providedElsewhereLabel">
+                <th class="align-center" ng-if="allowProvidedElsewhereExists[currentStage.id]" ng-bind="providedElsewhereLabel">
                 </th>
             </tr>
         </thead>
@@ -204,9 +204,10 @@
                     </div>
                 </ng-form>                
             </td>
-            <td ng-if="allowProvidedElsewhereExists">                
+            <td ng-if="allowProvidedElsewhereExists[currentStage.id]">                
                 <div class="align-center" ng-show="prStDe.allowProvidedElsewhere">
                     <input type="checkbox" 
+                           class="form-control"
                            ng-model="currentEvent.providedElsewhere[prStDe.dataElement.id]" 
                            ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed" 
                            ng-change="saveDatavalueLocation(prStDe)"/>                
@@ -224,9 +225,9 @@
                         <tr>
                             <th ng-bind="dataElementLabel">
                             </th>
-                            <th ng-bind="valueLabel">
+                            <th class="align-center" ng-bind="valueLabel">
                             </th>
-                            <th ng-if="allowProvidedElsewhereExists" ng-bind="providedElsewhereLabel">
+                            <th class="align-center" ng-if="allowProvidedElsewhereExists[currentStage.id]" ng-bind="providedElsewhereLabel">
                             </th>
                         </tr>
                     </thead>
@@ -425,9 +426,10 @@
                                     </div>    
                                 </ng-form>                                
                             </td>
-                            <td ng-if="allowProvidedElsewhereExists">                
+                            <td ng-if="allowProvidedElsewhereExists[currentStage.id]">                
                                 <div class="align-center" ng-show="prStDes[de.dataElement.id].allowProvidedElsewhere">
                                     <input type="checkbox" 
+                                           class="form-control"
                                            ng-model="currentEvent.providedElsewhere[prStDes[de.dataElement.id].dataElement.id]"
                                            ng-disabled="selectedEnrollment.status !== 'ACTIVE' || currentEvent.editingNotAllowed" 
                                            ng-change="saveDatavalueLocation(prStDes[de.dataElement.id])"/>