← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18051: tracker capture - disable editing coordinates in historical enrollment details

 

------------------------------------------------------------
revno: 18051
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2015-01-19 16:47:22 +0100
message:
  tracker capture - disable editing coordinates in historical enrollment details
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.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.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2015-01-19 15:36:42 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html	2015-01-19 15:47:22 +0000
@@ -93,7 +93,7 @@
                                ng-class="{'input-success': eventDateSaved}"
                                d2-date 
                                ng-model="currentEvent.eventDate"
-                               ng-disabled="currentEvent.status === 'SKIPPED' || currentEvent.enrollmentStatus === 'COMPLETED'"    
+                               ng-disabled="currentEvent.status === 'SKIPPED' || currentEvent.enrollmentStatus !== 'ACTIVE'"    
                                ng-required="true"
                                blur-or-change="saveEventDate()"/>
                         <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>
@@ -112,7 +112,7 @@
                                d2-date 
                                ng-model="currentEvent.dueDate"
                                blur-or-change="saveDueDate()" 
-                               ng-disabled="currentEvent.eventDate || !schedulingEnabled || currentEvent.enrollmentStatus === 'COMPLETED'"/>
+                               ng-disabled="currentEvent.eventDate || !schedulingEnabled || currentEvent.enrollmentStatus !== 'ACTIVE'"/>
                         <span ng-if="invalidDate" class="error">{{'date_required'| translate}}</span>
                     </div>                        
                 </div>
@@ -130,6 +130,7 @@
                                min="-90"
                                max="90"
                                ng-blur="saveCoordinate('LAT')"
+                               ng-disabled="currentEvent.enrollmentStatus !== 'ACTIVE'"    
                                ng-required="false"/>
                         <span ng-show="outerForm.latitude.$invalid" class="required">{{'value_must_be_between'| translate}} [-90 ... 90]</span>
                     </div>
@@ -143,6 +144,7 @@
                                min="-180"
                                max="180"
                                ng-blur="saveCoordinate('LNG')"
+                               ng-disabled="currentEvent.enrollmentStatus !== 'ACTIVE'" 
                                ng-required="false"/>
                         <span ng-show="outerForm.longitude.$invalid" class="required">{{'value_must_be_between'| translate}}[-180 ... 180]</span>
                     </div>                        

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-01-17 10:50:24 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-01-19 15:47:22 +0000
@@ -21,8 +21,7 @@
     //listen for the selected items
     $scope.$on('selectedItems', function(event, args) {   
         $scope.enrollments = [];
-        $scope.cancelledEnrollments = [];
-        $scope.completedEnrollments = [];
+        $scope.historicalEnrollments = [];
         $scope.showEnrollmentDiv = false;
         $scope.showEnrollmentHistoryDiv = false;
         $scope.hasEnrollmentHistory = false;
@@ -64,12 +63,8 @@
                         selectedEnrollment = enrollment;
                         $scope.currentEnrollment = enrollment;
                     }
-                    if(enrollment.status === 'CANCELLED'){//check for cancelled ones
-                        $scope.cancelledEnrollments.push(enrollment);
-                        $scope.hasEnrollmentHistory = true;
-                    }
-                    if(enrollment.status === 'COMPLETED'){//check for completed ones
-                        $scope.completedEnrollments.push(enrollment);
+                    if(enrollment.status === 'CANCELLED' || enrollment.status === 'COMPLETED'){
+                        $scope.historicalEnrollments.push(enrollment);
                         $scope.hasEnrollmentHistory = true;
                     }
                 }

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2015-01-17 10:50:24 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html	2015-01-19 15:47:22 +0000
@@ -8,7 +8,7 @@
         <span class="nav-pills" ng-show="selectedProgram && !currentEnrollment">
             | <a href ng-click="showNewEnrollment()" title="{{'new'| translate}}"><span ng-class="{'light-blue': !showEnrollmentDiv}">{{'new'| translate}}</span></a>
         </span>
-        <span class="nav-pills" ng-show="terminatedEnrollments.length > 0 || completedEnrollments.length > 0">
+        <span class="nav-pills" ng-show="hasEnrollmentHistory">
             | <a href ng-click="showEnrollmentHistory()" title="{{'history'| translate}}"><span ng-class="{'light-blue': currentEnrollment === selectedEnrollment}">{{'history'| translate}}</span></a>
         </span>       
 
@@ -220,15 +220,15 @@
                         <th>
                             {{selectedProgram.dateOfEnrollmentDescription}}
                         </th>
-                        <th>
+                        <th ng-if="selectedProgram.displayIncidentDate">
                             {{selectedProgram.dateOfIncidentDescription}}
                         </th>
                     </tr>
-                    <tr ng-click="loadEnrollmentDetails(en)" ng-repeat="en in completedEnrollments" title="{{'details'| translate}}">
+                    <tr ng-click="loadEnrollmentDetails(en)" ng-repeat="en in historicalEnrollments" title="{{'details'| translate}}">
                         <td>
                             {{en.dateOfEnrollment}}
                         </td>
-                        <td>
+                        <td ng-if="selectedProgram.displayIncidentDate">
                             {{en.dateOfIncident}}
                         </td>
                     </tr>