=== added directory 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard'
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2014-06-19 15:27:17 +0000
@@ -0,0 +1,99 @@
+//Controller for dashboard
+trackerCapture.controller('DashboardController',
+ function($rootScope,
+ $scope,
+ $location,
+ $modal,
+ $timeout,
+ storage,
+ TEIService,
+ ProgramFactory,
+ CurrentSelection,
+ TranslationService) {
+
+ //do translation of the dashboard page
+ TranslationService.translate();
+
+ //dashboard items
+ $rootScope.dashboardWidgets = {bigger: [], smaller: []};
+ $rootScope.enrollmentWidget = {title: 'enrollment', view: "components/enrollment/enrollment.html", show: true};
+ $rootScope.dataentryWidget = {title: 'dataentry', view: "components/dataentry/dataentry.html", show: true};
+ $rootScope.selectedWidget = {title: 'current_selections', view: "components/selected/selected.html", show: false};
+ $rootScope.profileWidget = {title: 'profile', view: "components/profile/profile.html", show: true};
+ $rootScope.relationshipWidget = {title: 'relationship', view: "components/relationship/relationship.html", show: true};
+ $rootScope.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true};
+
+ $rootScope.dashboardWidgets.bigger.push($rootScope.enrollmentWidget);
+ $rootScope.dashboardWidgets.bigger.push($rootScope.dataentryWidget);
+ $rootScope.dashboardWidgets.smaller.push($rootScope.selectedWidget);
+ $rootScope.dashboardWidgets.smaller.push($rootScope.profileWidget);
+ $rootScope.dashboardWidgets.smaller.push($rootScope.relationshipWidget);
+ $rootScope.dashboardWidgets.smaller.push($rootScope.notesWidget);
+
+ //selections
+ $scope.selectedEntityId = null;
+ $scope.selectedProgramId = null;
+
+ $scope.selectedEntityId = ($location.search()).selectedEntityId;
+ $scope.selectedProgramId = ($location.search()).selectedProgramId;
+ $scope.selectedOrgUnit = storage.get('SELECTED_OU');
+ $scope.selectedProgram = null;
+ $scope.programs = [];
+ $scope.selectedEntity;
+
+ if( $scope.selectedEntityId ){
+
+ //Fetch the selected entity
+ TEIService.get($scope.selectedEntityId).then(function(data){
+ $scope.selectedEntity = data;
+
+ ProgramFactory.getAll().then(function(programs){
+
+ angular.forEach(programs, function(program){
+ if(program.organisationUnits.hasOwnProperty($scope.selectedOrgUnit.id) &&
+ program.trackedEntity.id === $scope.selectedEntity.trackedEntity){
+ $scope.programs.push(program);
+ }
+
+ if($scope.selectedProgramId && program.id === $scope.selectedProgramId){
+ $scope.selectedProgram = program;
+ }
+ });
+
+ //broadcast selected items for dashboard controllers
+ $scope.broadCastProgram();
+ });
+ });
+ }
+
+ $scope.broadCastProgram = function(){
+ CurrentSelection.set({tei: $scope.selectedEntity, pr: $scope.selectedProgram});
+ $timeout(function() {
+ $rootScope.$broadcast('selectedEntity', {});
+ }, 100);
+ };
+
+
+ $scope.back = function(){
+ $location.path('/');
+ };
+
+ $scope.displayEnrollment = false;
+ $scope.showEnrollment = function(){
+ $scope.displayEnrollment = true;
+ };
+
+ $scope.removeWidget = function(widget){
+ widget.show = false;
+ };
+
+ $scope.showHideWidgets = function(){
+ var modalInstance = $modal.open({
+ templateUrl: "views/widgets.html",
+ controller: "DashboardWidgetsController"
+ });
+
+ modalInstance.result.then(function () {
+ });
+ };
+});
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets-controller.js 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-widgets-controller.js 2014-06-19 15:27:17 +0000
@@ -0,0 +1,12 @@
+//Controller for the dashboard widgets
+trackerCapture.controller('DashboardWidgetsController',
+ function($scope,
+ $modalInstance,
+ TranslationService){
+
+ TranslationService.translate();
+
+ $scope.close = function () {
+ $modalInstance.close($scope.eventGridColumns);
+ };
+});
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html 2014-06-19 15:27:17 +0000
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
=== 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-17 07:48:20 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2014-06-19 15:27:17 +0000
@@ -13,7 +13,6 @@
//listen for the selected items
$scope.$on('dashboard', function(event, args) {
-
var today = moment();
today = Date.parse(today);
today = $filter('date')(today, 'yyyy-MM-dd');
=== 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-17 07:48:20 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html 2014-06-19 15:27:17 +0000
@@ -9,101 +9,105 @@
-
-
-
-
-
- {{dhis2Event.orgUnitName}}
-
- {{dhis2Event.name}}
- {{dhis2Event.eventDate}}
-
-
- |
-
-
-
-
-
+
+
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2014-06-06 13:35:06 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2014-06-19 15:27:17 +0000
@@ -27,33 +27,16 @@
$scope.$on('selectedEntity', function(event, args) {
$scope.newEnrollment = {};
var selections = CurrentSelection.get();
- $scope.selectedEntity = selections.tei;
+ $scope.selectedEntity = selections.tei;
+ $scope.selectedProgram = selections.pr;
$scope.selectedOrgUnit = storage.get('SELECTED_OU');
- ProgramFactory.getAll().then(function(programs){
-
- angular.forEach(programs, function(program){
- if(program.organisationUnits.hasOwnProperty($scope.selectedOrgUnit.id) &&
- program.trackedEntity.id === $scope.selectedEntity.trackedEntity){
- $scope.programs.push(program);
- }
- });
-
- EnrollmentService.get($scope.selectedEntity.trackedEntityInstance).then(function(data){
+ if($scope.selectedProgram){
+ EnrollmentService.getByEntityAndProgram($scope.selectedEntity.trackedEntityInstance, $scope.selectedProgram.id).then(function(data){
$scope.enrollments = data.enrollmentList;
- if(selections.pr){
- angular.forEach($scope.programs, function(program){
- if(selections.pr.id === program.id){
- $scope.selectedProgram = program;
- $scope.loadEvents();
- }
- });
- }
-
- CurrentSelection.set({tei: $scope.selectedEntity, pr: $scope.selectedProgram, enrollment: $scope.selectedEnrollment});
- $rootScope.$broadcast('dashboard', {});
- });
- });
+ $scope.loadEvents();
+ });
+ }
});
$scope.loadEvents = function() {
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html 2014-06-06 13:35:06 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html 2014-06-19 15:27:17 +0000
@@ -5,146 +5,135 @@
-
-
-
-
- |
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{attribute.name}}
- |
-
-
- |
-
-
-
-
-
-
+
+ {{selectedProgram.dateOfIncidentDescription}}
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{attribute.name}}
+ |
+
+
+ |
+
+
+
+
+
+
+
+
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html 2014-05-27 12:38:36 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html 2014-06-19 15:27:17 +0000
@@ -5,7 +5,7 @@
-
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2014-06-19 10:07:22 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2014-06-19 15:27:17 +0000
@@ -19,19 +19,17 @@
});
//listen for the selected entity
- $scope.$on('dashboard', function(event, args) {
+ $scope.$on('selectedEntity', function(event, args) {
var selections = CurrentSelection.get();
$scope.selectedEntity = selections.tei;
$scope.selectedProgram = selections.pr;
-
if($scope.selectedEntity){
TEService.get($scope.selectedEntity.trackedEntity).then(function(te){
$scope.trackedEntity = te;
});
$scope.processTeiAttributes();
- }
-
+ }
});
//display only those attributes that belong the selected program
@@ -42,7 +40,7 @@
if(att.type === 'number' && !isNaN(parseInt(att.value))){
att.value = parseInt(att.value);
}
- });
+ });
if($scope.selectedProgram){
//show only those attributes in selected program
@@ -110,4 +108,4 @@
$scope.selectedEntity.attributes = $scope.entityAttributes;
$scope.editProfile = !$scope.editProfile;
};
-});
+});
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html 2014-06-06 13:35:06 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile.html 2014-06-19 15:27:17 +0000
@@ -9,58 +9,61 @@
-
-
-
- {{attribute.displayName}}
- |
-
-
- |
-
-
-
-
-
-
-
-
-
+
+
+
+
+ {{attribute.displayName}}
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js 2014-06-19 12:56:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js 2014-06-19 15:27:17 +0000
@@ -25,7 +25,7 @@
$scope.trackedEntities.selected = $scope.trackedEntities.available[0];
});
- //watch for selection of org unit from tree
+ //watch for selection of program
$scope.$watch('selectedProgram', function() {
if( angular.isObject($scope.selectedProgram)){
$scope.trackedEntityList = [];
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html 2014-06-17 07:48:20 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/index.html 2014-06-19 15:27:17 +0000
@@ -63,6 +63,8 @@
+
+
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/app.js 2014-06-17 07:48:20 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/app.js 2014-06-19 15:27:17 +0000
@@ -17,8 +17,6 @@
.value('DHIS2URL', '..')
-
-
.config(function($httpProvider, $routeProvider, $translateProvider) {
$httpProvider.defaults.useXDomain = true;
@@ -28,7 +26,7 @@
templateUrl:'views/home.html',
controller: 'SelectionController'
}).when('/dashboard',{
- templateUrl:'views/dashboard.html',
+ templateUrl:'components/dashboard/dashboard.html',
controller: 'DashboardController'
}).otherwise({
redirectTo : '/'
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-06-19 12:56:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-06-19 15:27:17 +0000
@@ -298,112 +298,6 @@
};
})
-//Controller for registration section
-
-
-//Controller for dashboard
-.controller('DashboardController',
- function($rootScope,
- $scope,
- $location,
- $modal,
- $timeout,
- storage,
- TEIService,
- ProgramFactory,
- CurrentSelection,
- TranslationService) {
-
- //do translation of the dashboard page
- TranslationService.translate();
-
- //dashboard items
- $rootScope.dashboardWidgets = {bigger: [], smaller: []};
- $rootScope.enrollmentWidget = {title: 'enrollment', view: "components/enrollment/enrollment.html", show: true};
- $rootScope.dataentryWidget = {title: 'dataentry', view: "components/dataentry/dataentry.html", show: true};
- $rootScope.selectedWidget = {title: 'current_selections', view: "components/selected/selected.html", show: false};
- $rootScope.profileWidget = {title: 'profile', view: "components/profile/profile.html", show: true};
- $rootScope.relationshipWidget = {title: 'relationship', view: "components/relationship/relationship.html", show: true};
- $rootScope.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true};
-
- $rootScope.dashboardWidgets.bigger.push($rootScope.enrollmentWidget);
- $rootScope.dashboardWidgets.bigger.push($rootScope.dataentryWidget);
- $rootScope.dashboardWidgets.smaller.push($rootScope.selectedWidget);
- $rootScope.dashboardWidgets.smaller.push($rootScope.profileWidget);
- $rootScope.dashboardWidgets.smaller.push($rootScope.relationshipWidget);
- $rootScope.dashboardWidgets.smaller.push($rootScope.notesWidget);
-
- //selections
- $scope.selectedEntityId = null;
- $scope.selectedProgramId = null;
-
- $scope.selectedEntityId = ($location.search()).selectedEntityId;
- $scope.selectedProgramId = ($location.search()).selectedProgramId;
- $scope.selectedOrgUnit = storage.get('SELECTED_OU');
-
- if( $scope.selectedEntityId ){
-
- //Fetch the selected entity
- TEIService.get($scope.selectedEntityId).then(function(data){
-
- if($scope.selectedProgramId){
- ProgramFactory.get($scope.selectedProgramId).then(function(program){
- $scope.selectedProgram = program;
-
- //broadcast selected items for dashboard controllers
- CurrentSelection.set({tei: data, pr: $scope.selectedProgram});
- $timeout(function() {
- $rootScope.$broadcast('selectedEntity', {});
- }, 100);
- });
- }
- else{
- //broadcast selected items for dashboard controllers
- CurrentSelection.set({tei: data, pr: ''});
- $timeout(function() {
- $rootScope.$broadcast('selectedEntity', {});
- }, 100);
- }
- });
- }
-
- $scope.back = function(){
- $location.path('/');
- };
-
- $scope.displayEnrollment = false;
- $scope.showEnrollment = function(){
- $scope.displayEnrollment = true;
- };
-
- $scope.removeWidget = function(widget){
- widget.show = false;
- };
-
- $scope.showHideWidgets = function(){
- var modalInstance = $modal.open({
- templateUrl: "views/widgets.html",
- controller: "DashboardWidgetsController"
- });
-
- modalInstance.result.then(function () {
- });
- };
-})
-
-//Controller for the dashboard widgets
-.controller('DashboardWidgetsController',
- function($scope,
- $modalInstance,
- TranslationService){
-
- TranslationService.translate();
-
- $scope.close = function () {
- $modalInstance.close($scope.eventGridColumns);
- };
-})
-
//Controller for the header section
.controller('HeaderController',
function($scope,
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-06-19 12:56:21 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-06-19 15:27:17 +0000
@@ -178,12 +178,30 @@
});
return promise;
},
+ getByEntity: function( entity ){
+ var promise = $http.get( '../api/enrollments?trackedEntityInstance=' + entity ).then(function(response){
+ return response.data;
+ });
+ return promise;
+ },
+ getByEntityAndProgram: function( entity, program ){
+ var promise = $http.get( '../api/enrollments?trackedEntityInstance=' + entity + '&program=' + program ).then(function(response){
+ return response.data;
+ });
+ return promise;
+ },
enroll: function( enrollment ){
var promise = $http.post( '../api/enrollments', enrollment ).then(function(response){
return response.data;
});
return promise;
- }
+ },
+ update: function( enrollment){
+ var promise = $http.put( '../api/enrollments/' + enrollment.enrollment , enrollment).then(function(response){
+ return response.data;
+ });
+ return promise;
+ }
};
})
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-06-19 10:07:22 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-06-19 15:27:17 +0000
@@ -37,6 +37,13 @@
color: #585D61;
}
+.dashboard-top-bar {
+ padding-right: 15px;
+ padding-left: 15px;
+ margin-right: auto;
+ margin-left: auto;
+}
+
/*----------------------------------------------------------------------------*/
/* Form
/*----------------------------------------------------------------------------*/
@@ -543,9 +550,9 @@
margin-bottom: 10px;
}
-.dashboard-element-container {
- max-height: 250px !important;
- height: 250px !important;
+.dashboard-widget-container {
+ max-height: 400px !important;
+ height: auto;
overflow-x:auto;
overflow-y:auto;
}
@@ -559,6 +566,10 @@
margin-right: 10px;
}
+.row-with-margin {
+ padding-left: 30px;
+ padding-right: 30px;
+}
.vertical-spacing{
margin-top: 10px;
margin-bottom: 10px;
@@ -838,6 +849,26 @@
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s
}
+.form-control-program {
+ width: 40%;
+ height: 34px;
+ padding: 6px 6px;
+ font-size: 14px;
+ line-height: 1.0;
+ color: #555;
+ margin-bottom: 5px;
+ margin-top: 5px;
+ vertical-align: middle;
+ background-color: #fff;
+ background-image: none;
+ border: 1px solid #ccc;
+ border-radius: 4px;
+ -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
+ box-shadow: inset 0 1px 1px rgba(0,0,0,0.075);
+ -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
+ transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s
+}
+
.form-control-select2 {
display: block;
width: 100%;
=== removed file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/dashboard.html'
--- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/dashboard.html 2014-06-19 09:47:23 +0000
+++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/views/dashboard.html 1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-