=== added directory 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms' === added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs-controller.js 2015-09-11 15:16:03 +0000 @@ -0,0 +1,22 @@ +/* global trackerCapture, angular */ + +trackerCapture.controller('ActiveProgramsController', + function($scope, + $location, + CurrentSelection) { + //listen for the selected items + $scope.$on('selectedItems', function(event, args) { + var selections = CurrentSelection.get(); + $scope.selectedTeiId = selections.tei ? selections.tei.trackedEntityInstance : null; + $scope.activeEnrollments =  []; + angular.forEach(selections.enrollments, function(en){ + if(en.status === "ACTIVE" && selections.pr && selections.pr.id !== en.program){ + $scope.activeEnrollments.push(en); + } + }); + }); + + $scope.changeProgram = function(program){ + $location.path('/dashboard').search({tei: $scope.selectedTeiId, program: program}); + }; +}); \ No newline at end of file === added file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html 1970-01-01 00:00:00 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/activeprograms/active-programs.html 2015-09-11 15:16:03 +0000 @@ -0,0 +1,24 @@ +
+
+ {{activeProgramsWidget.title| translate}} + + + + + + + +
+
+ +
+ + + + +
+ {{programNames[activeEnrollment.program].name}} +
+
+
+
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2015-09-03 15:45:33 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2015-09-11 15:16:03 +0000 @@ -77,52 +77,16 @@ selectedLayout = !selectedLayout ? defaultLayout : selectedLayout; angular.forEach(selectedLayout.widgets, function(widget){ - switch(widget.title){ - case 'enrollment': - $rootScope.enrollmentWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.enrollmentWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; - case 'indicators': - $rootScope.indicatorWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.indicatorWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; - case 'feedback': - $rootScope.feedbackWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.feedbackWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; - case 'dataentry': - $rootScope.dataentryWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.dataentryWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; - case 'report': - $rootScope.reportWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.reportWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; - case 'current_selections': - $rootScope.selectedWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.selectedWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; - case 'profile': - $rootScope.profileWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.profileWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; - case 'relationships': - $rootScope.relationshipWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.relationshipWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; - case 'notes': - $rootScope.notesWidget = widget; - $rootScope.dashboardWidgets.push($rootScope.notesWidget); - $scope.dashboardStatus[widget.title] = angular.copy(widget); - break; + $rootScope[widget.title +'Widget'] = widget; + $rootScope.dashboardWidgets.push( $rootScope[widget.title +'Widget'] ); + $scope.dashboardStatus[widget.title] = angular.copy(widget); + }); + + angular.forEach(defaultLayout.widgets, function(w){ + if(!$scope.dashboardStatus[w.title]){ + $rootScope[w.title +'Widget'] = w; + $rootScope.dashboardWidgets.push( $rootScope[w.title +'Widget'] ); + $scope.dashboardStatus[w.title] = angular.copy(w); } }); @@ -213,9 +177,9 @@ if( program.trackedEntity.id === $scope.selectedTei.trackedEntity ){ $scope.programs.push(program); $scope.programNames[program.id] = {id: program.id, name: program.name}; - angular.forEach(program.programStages, function(stage){ - $scope.programStageNames[stage.id] = {id: stage.id, name: stage.name}; - }); + angular.forEach(program.programStages, function(stage){ + $scope.programStageNames[stage.id] = {id: stage.id, name: stage.name}; + }); if($scope.selectedProgramId && program.id === $scope.selectedProgramId || selectedEnrollment && selectedEnrollment.program === program.id){ $scope.selectedProgram = program; @@ -235,7 +199,7 @@ }); }); }); - } + } //listen for any change to program selection @@ -344,7 +308,7 @@ CurrentSelection.set({tei: $scope.selectedTei, te: $scope.trackedEntity, prs: $scope.programs, pr: $scope.selectedProgram, prNames: $scope.programNames, prStNames: $scope.programStageNames, enrollments: selections.enrollments, selectedEnrollment: null, optionSets: $scope.optionSets}); $timeout(function() { $rootScope.$broadcast('selectedItems', {programExists: $scope.programs.length > 0}); - }, 100); + }, 200); }; $scope.activiateTEI = function(){ @@ -407,6 +371,7 @@ return; }); }; + $scope.showHideWidgets = function(){ var modalInstance = $modal.open({ templateUrl: "components/dashboard/dashboard-widgets.html", === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html 2015-09-08 15:02:34 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html 2015-09-11 15:16:03 +0000 @@ -37,7 +37,6 @@ -
@@ -67,10 +66,7 @@
- - - - + === 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-09-07 02:54:26 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry-controller.js 2015-09-11 15:16:03 +0000 @@ -1017,7 +1017,7 @@ $timeout(function () { $rootScope.$broadcast('tei-report-widget', {}); - }, 100); + }, 200); } $scope.allEventsSorted = orderByFilter($scope.allEventsSorted, '-sortingDate').reverse(); === 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-08-07 10:37:31 +0000 +++ 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 @@ -102,7 +102,7 @@ $timeout(function() { $rootScope.$broadcast('enrollmentEditing', {enrollmentEditing: $scope.showEnrollmentDiv}); - }, 100); + }, 200); if($scope.showEnrollmentDiv){ @@ -114,7 +114,7 @@ $timeout(function() { $rootScope.$broadcast('registrationWidget', {registrationMode: 'ENROLLMENT', selectedTei: $scope.selectedTei}); - }, 100); + }, 200); } else{ hideEnrollmentDiv(); @@ -140,7 +140,7 @@ CurrentSelection.set({tei: tei, te: $scope.selectedEntity, prs: $scope.programs, pr: $scope.selectedProgram, prNames: $scope.programNames, prStNames: $scope.programStageNames, enrollments: $scope.enrollments, selectedEnrollment: $scope.selectedEnrollment, optionSets: $scope.optionSets}); $timeout(function() { $rootScope.$broadcast(listeners, {}); - }, 100); + }, 200); }; var processSelectedTei = function(){ === 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-09-11 12:20:43 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment.html 2015-09-11 15:16:03 +0000 @@ -39,7 +39,7 @@ {{selectedProgram.enrollmentDateLabel}} - + @@ -47,7 +47,7 @@ {{selectedProgram.incidentDateLabel}} - + @@ -107,10 +107,10 @@ - {{en.dateOfEnrollment}} + {{en.enrollmentDate}} - {{en.dateOfIncident}} + {{en.incidentDate}} === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2015-03-26 12:26:37 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2015-09-11 15:16:03 +0000 @@ -49,7 +49,7 @@ $timeout(function() { $rootScope.$broadcast('registrationWidget', {registrationMode: 'PROFILE', selectedTei: $scope.selectedTei, enrollment: $scope.selectedEnrollment}); - }, 100); + }, 200); }; $scope.enableEdit = function(){ @@ -63,6 +63,6 @@ $scope.editingDisabled = !$scope.editingDisabled; $timeout(function() { $rootScope.$broadcast('registrationWidget', {registrationMode: 'PROFILE', selectedTei: $scope.selectedTei, enrollment: $scope.selectedEnrollment}); - }, 100); + }, 200); }; }); \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/enrollment-dates-form.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/enrollment-dates-form.html 2015-09-11 12:20:43 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/enrollment-dates-form.html 2015-09-11 15:16:03 +0000 @@ -14,14 +14,14 @@ - {{'required'| translate}} + {{'required'| translate}} @@ -31,12 +31,12 @@ + ng-model="selectedEnrollment.incidentDate"/> === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js 2015-09-03 15:45:33 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/registration/registration-controller.js 2015-09-11 15:16:03 +0000 @@ -56,7 +56,7 @@ } $scope.selectedOrgUnit = SessionStorageService.get('SELECTED_OU'); - $scope.selectedEnrollment = {dateOfEnrollment: $scope.today, dateOfIncident: $scope.today, orgUnitName: $scope.selectedOrgUnit.name}; + $scope.selectedEnrollment = {enrollmentDate: $scope.today, incidentDate: $scope.today, orgUnitName: $scope.selectedOrgUnit.name}; $scope.trackedEntities = {available: []}; TEService.getAll().then(function(entities){ @@ -136,7 +136,7 @@ CurrentSelection.set({tei: $scope.selectedTei, te: $scope.selectedTei.trackedEntity, prs: selections.prs, pr: $scope.selectedProgram, prNames: selections.prNames, prStNames: selections.prStNames, enrollments: selections.enrollments, selectedEnrollment: $scope.selectedEnrollment, optionSets: selections.optionSets}); $timeout(function() { $rootScope.$broadcast('profileWidget', {}); - }, 100); + }, 200); }; var notifyRegistrtaionCompletion = function(destination, teiId){ @@ -161,8 +161,8 @@ enrollment.program = $scope.selectedProgram.id; enrollment.status = 'ACTIVE'; enrollment.orgUnit = $scope.selectedOrgUnit.id; - enrollment.dateOfEnrollment = $scope.selectedEnrollment.dateOfEnrollment; - enrollment.dateOfIncident = $scope.selectedEnrollment.dateOfIncident === '' ? $scope.selectedEnrollment.dateOfEnrollment : $scope.selectedEnrollment.dateOfIncident; + enrollment.enrollmentDate = $scope.selectedEnrollment.enrollmentDate; + enrollment.incidentDate = $scope.selectedEnrollment.incidentDate === '' ? $scope.selectedEnrollment.enrollmentDate : $scope.selectedEnrollment.incidentDate; EnrollmentService.enroll(enrollment).then(function(enrollmentResponse){ var en = enrollmentResponse.response && enrollmentResponse.response.importSummaries && enrollmentResponse.response.importSummaries[0] ? enrollmentResponse.response.importSummaries[0] : {}; @@ -271,7 +271,7 @@ CurrentSelection.setRelationshipInfo({tei: $scope.tei, src: $scope.selectedRelationshipSource}); $timeout(function() { $rootScope.$broadcast('relationship', {}); - }, 100); + }, 200); }; var processRuleEffect = function(){ === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/registration.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/registration.html 2015-09-11 12:20:43 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/registration.html 2015-09-11 15:16:03 +0000 @@ -113,14 +113,14 @@ - {{'required'| translate}} + {{'required'| translate}} === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js 2015-07-14 19:05:51 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship-controller.js 2015-09-11 15:16:03 +0000 @@ -642,8 +642,8 @@ var enrollment = {trackedEntityInstance: teiId, program: $scope.selectedProgramForRelative.id, status: 'ACTIVE', - dateOfEnrollment: DateUtils.formatFromUserToApi($scope.enrollment.enrollmentDate), - dateOfIncident: $scope.enrollment.incidentDate === '' ? DateUtils.formatFromUserToApi($scope.enrollment.enrollmentDate) : DateUtils.formatFromUserToApi($scope.enrollment.incidentDate) + enrollmentDate: DateUtils.formatFromUserToApi($scope.enrollment.enrollmentDate), + incidentDate: $scope.enrollment.incidentDate === '' ? DateUtils.formatFromUserToApi($scope.enrollment.enrollmentDate) : DateUtils.formatFromUserToApi($scope.enrollment.incidentDate) }; EnrollmentService.enroll(enrollment).then(function(enrollmentResponse){ var en = enrollmentResponse.response && enrollmentResponse.response.importSummaries && enrollmentResponse.response.importSummaries[0] ? enrollmentResponse.response.importSummaries[0] : {}; @@ -682,7 +682,7 @@ $scope.tei.id = teiId; $scope.broadCastSelections(); - }, 100); + }, 200); }); }; @@ -700,7 +700,7 @@ $timeout(function() { $rootScope.$broadcast('relationship', {}); - }, 100); + }, 200); } }; }); \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html 2015-08-26 10:26:31 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html 2015-09-11 15:16:03 +0000 @@ -1,6 +1,6 @@
- {{relationshipWidget.title| translate}} + {{relationshipsWidget.title| translate}} | {{selectedProgram.relationshipText}} @@ -10,14 +10,14 @@ - - - + + + - +
-
+
{{'no_relationship'| translate}}
{{'relationship_not_possible'| translate}}
=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-details.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-details.html 2015-09-11 12:20:43 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/program-details.html 2015-09-11 15:16:03 +0000 @@ -35,10 +35,10 @@

{{'enrollment'| translate}} {{'_details'| translate}}

- {{selectedProgram.enrollmentDateLabel}}: {{enrollment.dateOfEnrollment}} + {{selectedProgram.enrollmentDateLabel}}: {{enrollment.enrollmentDate}}
- {{selectedProgram.incidentDateLabel}}: {{enrollment.dateOfIncident}} + {{selectedProgram.incidentDateLabel}}: {{enrollment.incidentDate}}
{{'status'| translate}}: {{enrollment.status}} === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js 2015-08-31 12:49:17 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/report/tei-report-controller.js 2015-09-11 15:16:03 +0000 @@ -149,8 +149,8 @@ //get enrollment details EnrollmentService.get(enr).then(function(enrollment){ - enrollment.dateOfEnrollment = DateUtils.formatFromApiToUser(enrollment.dateOfEnrollment); - enrollment.dateOfIncident = DateUtils.formatFromApiToUser(enrollment.dateOfIncident); + enrollment.enrollmentDate = DateUtils.formatFromApiToUser(enrollment.enrollmentDate); + enrollment.incidentDate = DateUtils.formatFromApiToUser(enrollment.incidentDate); angular.forEach(enrollment.notes, function(note){ note.storedDate = DateUtils.formatToHrsMins(note.storedDate); }); === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html 2015-02-06 20:22:45 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html 2015-09-11 15:16:03 +0000 @@ -1,15 +1,15 @@
- {{selectedWidget.title| translate}} + {{current_selectionsWidget.title| translate}} - - - + + + - +
-
+
{{selection.title| translate}} === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties 2015-08-26 10:26:31 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/i18n/i18n_app.properties 2015-09-11 15:16:03 +0000 @@ -187,6 +187,7 @@ visit=Visit visits=Visits current_selections=Current selections +activePrograms=Active programs org_unit=Organisation unit org_unit_scope=Organisation unit scope SELECTED=Selected @@ -346,6 +347,7 @@ dec=December week=Week save_layout_as_default=Save dashboard layout as default +reset_layout=Reset dashboard layout is_expected_to_be=is expected to be but_found=but found equals_to=equals to === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html 2015-08-27 19:05:47 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html 2015-09-11 15:16:03 +0000 @@ -120,6 +120,7 @@ + === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2015-09-03 16:09:29 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2015-09-11 15:16:03 +0000 @@ -311,7 +311,7 @@ $scope.showSearchDiv = false; $timeout(function() { $rootScope.$broadcast('registrationWidget', {registrationMode: 'REGISTRATION'}); - }, 1000); + }, 200); } else{ $scope.doSearch = true; === 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 2015-09-03 16:09:29 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2015-09-11 15:16:03 +0000 @@ -29,9 +29,11 @@ w.selectedWidget = {title: 'current_selections', view: "components/selected/selected.html", show: false, expand: true, parent: 'smallerWidget', order: 0}; w.feedbackWidget = {title: 'feedback', view: "components/rulebound/rulebound.html", show: true, expand: true, parent: 'smallerWidget', order: 1}; w.profileWidget = {title: 'profile', view: "components/profile/profile.html", show: true, expand: true, parent: 'smallerWidget', order: 2}; - w.relationshipWidget = {title: 'relationships', view: "components/relationship/relationship.html", show: true, expand: true, parent: 'smallerWidget', order: 3}; - w.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true, expand: true, parent: 'smallerWidget', order: 4}; + w.activeProgramsWidget = {title: 'activePrograms', view: "components/activeprograms/active-programs.html", show: false, expand: true, parent: 'smallerWidget', order: 3}; + w.relationshipWidget = {title: 'relationships', view: "components/relationship/relationship.html", show: true, expand: true, parent: 'smallerWidget', order: 4}; + w.notesWidget = {title: 'notes', view: "components/notes/notes.html", show: true, expand: true, parent: 'smallerWidget', order: 5}; var defaultLayout = new Object(); + defaultLayout['DEFAULT'] = {widgets: w, program: 'DEFAULT'}; var getDefaultLayout = function(customLayout){ @@ -107,11 +109,11 @@ return; } - var referenceDate = enrollment.dateOfIncident ? enrollment.dateOfIncident : enrollment.dateOfEnrollment; + var referenceDate = enrollment.incidentDate ? enrollment.incidentDate : enrollment.enrollmentDate; var offset = stage.minDaysFromStart; if(stage.generatedByEnrollmentDate){ - referenceDate = enrollment.dateOfEnrollment; + referenceDate = enrollment.enrollmentDate; } var occupiedPeriods = []; @@ -590,20 +592,20 @@ var convertFromApiToUser = function(enrollment){ if(enrollment.enrollments){ angular.forEach(enrollment.enrollments, function(enrollment){ - enrollment.dateOfIncident = DateUtils.formatFromApiToUser(enrollment.dateOfIncident); - enrollment.dateOfEnrollment = DateUtils.formatFromApiToUser(enrollment.dateOfEnrollment); + enrollment.incidentDate = DateUtils.formatFromApiToUser(enrollment.incidentDate); + enrollment.enrollmentDate = DateUtils.formatFromApiToUser(enrollment.enrollmentDate); }); } else{ - enrollment.dateOfIncident = DateUtils.formatFromApiToUser(enrollment.dateOfIncident); - enrollment.dateOfEnrollment = DateUtils.formatFromApiToUser(enrollment.dateOfEnrollment); + enrollment.incidentDate = DateUtils.formatFromApiToUser(enrollment.incidentDate); + enrollment.enrollmentDate = DateUtils.formatFromApiToUser(enrollment.enrollmentDate); } return enrollment; }; var convertFromUserToApi = function(enrollment){ - enrollment.dateOfIncident = DateUtils.formatFromUserToApi(enrollment.dateOfIncident); - enrollment.dateOfEnrollment = DateUtils.formatFromUserToApi(enrollment.dateOfEnrollment); + enrollment.incidentDate = DateUtils.formatFromUserToApi(enrollment.incidentDate); + enrollment.enrollmentDate = DateUtils.formatFromUserToApi(enrollment.enrollmentDate); return enrollment; }; return { @@ -1376,8 +1378,8 @@ /* current selections */ .service('CurrentSelection', function(){ - this.currentSelection = ''; - this.relationshipInfo = ''; + this.currentSelection = {}; + this.relationshipInfo = {}; this.optionSets = null; this.attributesById = null; this.ouLevels = null; @@ -1564,13 +1566,13 @@ var getEventDueDate = function(eventsByStage, programStage, enrollment){ - var referenceDate = enrollment.dateOfIncident ? enrollment.dateOfIncident : enrollment.dateOfEnrollment, + var referenceDate = enrollment.incidentDate ? enrollment.incidentDate : enrollment.enrollmentDate, offset = programStage.minDaysFromStart, calendarSetting = CalendarService.getSetting(), dueDate; if(programStage.generatedByEnrollmentDate){ - referenceDate = enrollment.dateOfEnrollment; + referenceDate = enrollment.enrollmentDate; } if(programStage.repeatable){ @@ -1706,11 +1708,11 @@ } if(stage.openAfterEnrollment){ - if(stage.reportDateToUse === 'dateOfIncident'){ - newEvent.eventDate = DateUtils.formatFromUserToApi(enrollment.dateOfIncident); + if(stage.reportDateToUse === 'incidentDate'){ + newEvent.eventDate = DateUtils.formatFromUserToApi(enrollment.incidentDate); } else{ - newEvent.eventDate = DateUtils.formatFromUserToApi(enrollment.dateOfEnrollment); + newEvent.eventDate = DateUtils.formatFromUserToApi(enrollment.enrollmentDate); } }