← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15792: data entry form displays provided elsewhere column only if there is a dataelement that requires it

 

------------------------------------------------------------
revno: 15792
committer: Abyot Asalefew Gizaw abyota@xxxxxxxxx
branch nick: dhis2
timestamp: Fri 2014-06-20 17:17:00 +0200
message:
  data entry form displays provided elsewhere column only if there is a dataelement that requires it
modified:
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js
  dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.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-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2014-06-20 14:23:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2014-06-20 15:17:00 +0000
@@ -147,7 +147,8 @@
             }
             else {
                 $scope.getEvents();
-                
+                newEvent.event = data.importSummaries[0].reference;
+                $scope.showDataEntry(newEvent);
             }
         });
     };
@@ -190,14 +191,15 @@
             
         ProgramStageFactory.get($scope.currentEvent.programStage).then(function(stage){
             $scope.currentStage = stage;
-
+            
+            $scope.allowProvidedElsewhereExists = false;
             angular.forEach($scope.currentStage.programStageDataElements, function(prStDe){
                 $scope.currentStage.programStageDataElements[prStDe.dataElement.id] = prStDe.dataElement;
                 if(prStDe.allowProvidedElsewhere){
+                    $scope.allowProvidedElsewhereExists = true;
                     $scope.currentEvent.providedElsewhere[prStDe.dataElement.id] = '';   
                 }                
             });
-
             angular.forEach($scope.currentEvent.dataValues, function(dataValue){
                 var val = dataValue.value;
                 if(val){

=== 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-06-20 14:23:28 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2014-06-20 15:17:00 +0000
@@ -72,24 +72,24 @@
         <div ng-show="currentEvent">
             <hr>
             <table class="table-borderless table-striped">
-                <thead class="align-center">
-                    <tr>
-                        <th class="align-center">
+                <thead>
+                    <tr class="col-md-12">
+                        <th class="col-md-5">
                             {{'data_element'| translate}}
                         </th>
-                        <th class="align-center">
+                        <th class="col-md-5 align-center">
                             {{'value'| translate}}
                         </th>
-                        <th class="align-center">
+                        <th class="col-md-2 align-center" ng-if="allowProvidedElsewhereExists">
                             {{'provided_elsewhere'| translate}}
                         </th>
                     </tr>
                 </thead>
-                <tr ng-repeat="prStDe in currentStage.programStageDataElements">
-                    <td>
+                <tr class="col-md-12" ng-repeat="prStDe in currentStage.programStageDataElements">
+                    <td class="col-md-5">
                         {{prStDe.dataElement.name}}
                     </td>
-                    <td>
+                    <td class="col-md-5">
                         <div ng-switch="prStDe.dataElement.type">
                             <div ng-switch-when="int">
                                 <input type="number"
@@ -133,7 +133,7 @@
                             </div>
                         </div>
                     </td>
-                    <td>                        
+                    <td class="col-md-2" ng-if="allowProvidedElsewhereExists">                    
                         <div class="align-center" ng-show="prStDe.allowProvidedElsewhere">
                             <input type="checkbox" 
                                    ng-model="currentEvent.providedElsewhere[prStDe.dataElement.id]"