------------------------------------------------------------ revno: 21438 committer: Abyot Asalefew Gizaw <aby...@gmail.com> branch nick: dhis2 timestamp: Mon 2015-12-14 11:17:47 +0100 message: tracker-capture: better processing of enrollments in enrollment widget modified: 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/enrollment/enrollment-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2015-12-11 15:18:54 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2015-12-14 10:17:47 +0000 @@ -57,6 +57,17 @@ }); angular.forEach($scope.enrollments, function(enrollment){ + if(enrollment.orgUnit !== $scope.selectedOrgUnit.id) { + OrgUnitService.get(enrollment.orgUnit).then(function(ou){ + if(ou){ + enrollment.orgUnitName = $scope.selectedOrgUnit.name; + } + }); + } + else{ + enrollment.orgUnitName = $scope.selectedOrgUnit.name; + } + if(enrollment.program === $scope.selectedProgram.id ){ if(enrollment.status === 'ACTIVE'){ selectedEnrollment = enrollment; @@ -87,17 +98,7 @@ $scope.showEnrollmentHistoryDiv = false; $scope.selectedEnrollment = enrollment; - if($scope.selectedEnrollment.enrollment && $scope.selectedEnrollment.orgUnit){ - if($scope.selectedEnrollment.orgUnit !== $scope.selectedOrgUnit.id) { - OrgUnitService.get($scope.selectedEnrollment.orgUnit).then(function(ou){ - if(ou){ - $scope.selectedEnrollment.orgUnitName = $scope.selectedOrgUnit.name; - } - }); - } - else{ - $scope.selectedEnrollment.orgUnitName = $scope.selectedOrgUnit.name; - } + if($scope.selectedEnrollment.enrollment && $scope.selectedEnrollment.orgUnit){ $scope.broadCastSelections('dashboardWidgets'); } }; === 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-12-14 08:59:22 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html 2015-12-14 10:17:47 +0000 @@ -15,7 +15,7 @@ <!-- operations on selected enrollment begins --> <div class="row equal-height-columns"> - <div class="col-sm-6 border-right"> + <div class="col-sm-6"> <div class="title small-vertical-spacing"> {{'for_selected_program'| translate}} @@ -117,6 +117,9 @@ <th ng-if="selectedProgram.displayIncidentDate"> {{selectedProgram.incidentDateLabel}} </th> + <th> + {{'enrolling_orgunit' | translate}} + </th> </tr> <tr ng-click="loadEnrollmentDetails(en)" ng-repeat="en in historicalEnrollments" title="{{'details'| translate}}"> <td> @@ -125,12 +128,15 @@ <td ng-if="selectedProgram.displayIncidentDate"> {{en.incidentDate}} </td> + <td> + {{en.orgUnitName}} + </td> </tr> </table> </div> <!-- operations on historical enrollment ends --> </div> - <div class="col-sm-6" ng-if="!showEnrollmentDiv"> + <div class="col-sm-6 border-left" ng-if="!showEnrollmentDiv"> <div class="title small-vertical-spacing">{{'for_other_programs'| translate}}</div> <div ng-if="activeEnrollments.length > 0"> <table class="table table-striped dhis2-table-hover table-bordered">
_______________________________________________ Mailing list: https://launchpad.net/~dhis2-devs Post to : dhis2-devs@lists.launchpad.net Unsubscribe : https://launchpad.net/~dhis2-devs More help : https://help.launchpad.net/ListHelp