dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #32696
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16670: tracker capture - finished report for upcoming events. It is now possible to sort and search usin...
------------------------------------------------------------
revno: 16670
committer: Abyot Asalefew Gizaw <abyota@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-09-09 14:06:50 +0200
message:
tracker capture - finished report for upcoming events. It is now possible to sort and search using attributes, event name and due date. In order to do rescheduling, users have to go to dashabord.
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/report/upcoming-events-controller.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events.html
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css
dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/column-modal.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 2014-09-08 13:35:02 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2014-09-09 12:06:50 +0000
@@ -38,8 +38,7 @@
if($scope.selectedProgram){
EnrollmentService.getByEntityAndProgram($scope.selectedTei.trackedEntityInstance, $scope.selectedProgram.id).then(function(data){
- $scope.enrollments = data.enrollments;
- console.log('List of enrollments: ', $scope.enrollments);
+ $scope.enrollments = data.enrollments;
$scope.loadEnrollmentDetails();
});
}
@@ -108,8 +107,6 @@
});
}
}
-
- console.log('The enrollment is: ', $scope.selectedEnrollment);
$scope.broadCastSelections('dashboardWidgets');
};
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events-controller.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events-controller.js 2014-09-09 10:44:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events-controller.js 2014-09-09 12:06:50 +0000
@@ -1,6 +1,7 @@
trackerCapture.controller('UpcomingEventsController',
function($scope,
$modal,
+ $location,
orderByFilter,
DateUtils,
EventUtils,
@@ -10,6 +11,7 @@
AttributesFactory,
ProgramFactory,
DHIS2EventFactory,
+ ContextMenuSelectedItem,
storage) {
TranslationService.translate();
@@ -62,11 +64,11 @@
}
$scope.reportFinished = false;
- $scope.reportStarted = true;
-
+ $scope.reportStarted = true;
$scope.programStages = [];
$scope.filterTypes = {};
- $scope.filterText = {};
+ $scope.filterText = {};
+
angular.forEach($scope.selectedProgram.programStages, function(stage){
$scope.programStages[stage.id] = stage;
});
@@ -74,8 +76,8 @@
AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){
$scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name);
- $scope.gridColumns.push({name: 'upcoming_event', id: 'upcoming_event', type: 'string', displayInListNoProgram: false, showFilter: false, show: true});
- $scope.filterTypes['upcoming_event'] = 'string';
+ $scope.gridColumns.push({name: 'event_name', id: 'event_name', type: 'string', displayInListNoProgram: false, showFilter: false, show: true});
+ $scope.filterTypes['event_name'] = 'string';
$scope.gridColumns.push({name: 'due_date', id: 'due_date', type: 'date', displayInListNoProgram: false, showFilter: false, show: true});
$scope.filterTypes['due_date'] = 'date';
@@ -137,7 +139,7 @@
//make upcoming event name and its due date part of the grid column
for(var i=0; i<$scope.teiList.length; i++){
- $scope.teiList[i].upcoming_event = $scope.dhis2Events[$scope.teiList[i].id][0].name;
+ $scope.teiList[i].event_name = $scope.dhis2Events[$scope.teiList[i].id][0].name;
$scope.teiList[i].due_date = $scope.dhis2Events[$scope.teiList[i].id][0].dueDate;
}
@@ -208,4 +210,9 @@
$scope.removeEndFilterText = function(gridColumnId){
$scope.filterText[gridColumnId].end = undefined;
};
+
+ $scope.showDashboard = function(tei){
+ $location.path('/dashboard').search({tei: tei.id,
+ program: $scope.selectedProgram ? $scope.selectedProgram.id: null});
+ };
});
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events.html 2014-09-09 10:44:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/upcoming-events.html 2014-09-09 12:06:50 +0000
@@ -48,6 +48,7 @@
<!-- upcoming events list begins -->
<div ng-if="reportFinished">
+
<div ng-switch="teiList.length">
<div ng-switch-when="undefined">
<div class="alert alert-warning vertical-spacing">
@@ -59,8 +60,7 @@
{{'no_data_found'| translate}}
</div>
</div>
- <div ng-switch-default>
-
+ <div ng-switch-default>
<!-- report begins -->
<div class="vertical-spacing">
<table class="listTable dhis2-table-striped-border dhis2-table-hover">
@@ -116,7 +116,7 @@
</thead>
<tbody id="list">
<tr ng-repeat="tei in teiList | orderBy:sortHeader:reverse | gridFilter:filterText:filterTypes"
- ng-click="showDashboard(trackedEntity)"
+ ng-click="showDashboard(tei)"
title="{{'go_to_dashboard'| translate}}">
<td ng-show="gridColumn.show"
ng-repeat="gridColumn in gridColumns">
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js 2014-08-25 13:40:37 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js 2014-09-09 12:06:50 +0000
@@ -134,7 +134,7 @@
};
})
-.directive('dhisContextMenu', function(ContextMenuSelectedItem) {
+.directive('d2ContextMenu', function(ContextMenuSelectedItem) {
return {
restrict: 'A',
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-09-09 10:44:12 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-09-09 12:06:50 +0000
@@ -967,6 +967,19 @@
};
})
+/* Context menu for grid*/
+.service('ContextMenuSelectedItem', function(){
+ this.selectedItem = '';
+
+ this.setSelectedItem = function(selectedItem){
+ this.selectedItem = selectedItem;
+ };
+
+ this.getSelectedItem = function(){
+ return this.selectedItem;
+ };
+})
+
/* Translation service - gets logged in user profile for the server,
* and apply user's locale to translation
*/
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-09-08 09:08:39 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-09-09 12:06:50 +0000
@@ -266,6 +266,10 @@
border-top: none;
}
+.listTable th {
+ height: 30px;
+}
+
.dhis2-table>thead>tr>th,
.dhis2-table>tbody>tr>th,
.dhis2-table>tfoot>tr>th,
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/column-modal.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/column-modal.html 2014-05-16 11:32:21 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/column-modal.html 2014-09-09 12:06:50 +0000
@@ -5,7 +5,7 @@
<table class="listTable dhis2-table-striped-border">
<tr ng-repeat="gridColumn in gridColumns">
<td>
- {{gridColumn.name}}
+ {{gridColumn.name | translate}}
</td>
<td>
<input type="checkbox" ng-model="gridColumn.show" ng-change="showHideColumns(gridColumn)" ng-disabled="hiddenGridColumns + 1 == gridColumns.length && gridColumn.show">