← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21324: tracker-capture: when accessing records of a TEI from another orgunit, it is possible to change d...

 

------------------------------------------------------------
revno: 21324
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2015-12-04 11:49:47 +0100
message:
  tracker-capture: when accessing records of a TEI from another orgunit, it is possible to change details of event if event status is SCHEDULE
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/enrollment/enrollment-controller.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	2015-12-04 09:03:00 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js	2015-12-04 10:49:47 +0000
@@ -334,7 +334,7 @@
     };
 
     var setEventEditing = function (dhis2Event, stage) {
-        return dhis2Event.editingNotAllowed = dhis2Event.orgUnit !== $scope.selectedOrgUnit.id || (stage.blockEntryForm && dhis2Event.status === 'COMPLETED') || $scope.selectedEntity.inactive;
+        return dhis2Event.editingNotAllowed = dhis2Event.orgUnit !== $scope.selectedOrgUnit.id && dhis2Event.eventDate || (stage.blockEntryForm && dhis2Event.status === 'COMPLETED') || $scope.selectedEntity.inactive;
     };
 
     $scope.enableRescheduling = function () {
@@ -704,7 +704,7 @@
             if (e.eventDate && !$scope.currentEvent.eventDate && $scope.currentStage.periodType) {
                 $scope.currentEvent.eventDate = $scope.currentEvent.dueDate;
             }
-
+            
             $scope.currentEvent.sortingDate = $scope.currentEvent.dueDate;
             $scope.currentEvent.statusColor = EventUtils.getEventStatusColor($scope.currentEvent);
             $scope.schedulingEnabled = !$scope.schedulingEnabled;

=== 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-09-11 15:16:03 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js	2015-12-04 10:49:47 +0000
@@ -81,12 +81,10 @@
         
         if($scope.selectedEnrollment.enrollment && $scope.selectedEnrollment.orgUnit){
             if($scope.selectedEnrollment.orgUnit !== $scope.selectedOrgUnit.id) {
-                OrgUnitService.open().then(function(){
-                    OrgUnitService.get($scope.selectedEnrollment.orgUnit).then(function(ou){
-                        if(ou){
-                            $scope.selectedEnrollment.orgUnitName = $scope.selectedOrgUnit.name;
-                        }                                                       
-                    });           
+                OrgUnitService.get($scope.selectedEnrollment.orgUnit).then(function(ou){
+                    if(ou){
+                        $scope.selectedEnrollment.orgUnitName = $scope.selectedOrgUnit.name;
+                    }                                                       
                 });
             }
             else{