=== modified 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 2014-06-27 15:42:43 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard-controller.js 2014-06-30 05:56:38 +0000 @@ -17,7 +17,7 @@ //dashboard items $rootScope.dashboardWidgets = {bigger: [], smaller: []}; - $rootScope.enrollmentWidget = {title: 'enrollment', view: "components/enrollment/enrollment.html", show: true, expand: true, expand: true}; + $rootScope.enrollmentWidget = {title: 'enrollment', view: "components/enrollment/enrollment.html", show: true, expand: true}; $rootScope.dataentryWidget = {title: 'dataentry', view: "components/dataentry/dataentry.html", show: true, expand: true}; $rootScope.selectedWidget = {title: 'current_selections', view: "components/selected/selected.html", show: false, expand: true}; $rootScope.profileWidget = {title: 'profile', view: "components/profile/profile.html", show: true, expand: true}; @@ -32,24 +32,24 @@ $rootScope.dashboardWidgets.smaller.push($rootScope.notesWidget); //selections - $scope.selectedEntityId = null; + $scope.selectedTeiId = null; $scope.selectedProgramId = null; - $scope.selectedEntityId = ($location.search()).selectedEntityId; - $scope.selectedProgramId = ($location.search()).selectedProgramId; + $scope.selectedTeiId = ($location.search()).tei; + $scope.selectedProgramId = ($location.search()).programId; $scope.selectedOrgUnit = storage.get('SELECTED_OU'); - $scope.selectedProgram = null; + $scope.selectedProgram; $scope.programs = []; - $scope.selectedEntity; + $scope.selectedTei; - if( $scope.selectedEntityId ){ + if( $scope.selectedTeiId ){ //Fetch the selected entity - TEIService.get($scope.selectedEntityId).then(function(data){ - $scope.selectedEntity = data; + TEIService.get($scope.selectedTeiId).then(function(data){ + $scope.selectedTei = data; //get the entity type - TEService.get($scope.selectedEntity.trackedEntity).then(function(te){ + TEService.get($scope.selectedTei.trackedEntity).then(function(te){ $scope.trackedEntity = te; ProgramFactory.getAll().then(function(programs){ @@ -57,7 +57,7 @@ //get programs valid for the selected ou and tei angular.forEach(programs, function(program){ if(program.organisationUnits.hasOwnProperty($scope.selectedOrgUnit.id) && - program.trackedEntity.id === $scope.selectedEntity.trackedEntity){ + program.trackedEntity.id === $scope.selectedTei.trackedEntity){ $scope.programs.push(program); } @@ -65,18 +65,24 @@ $scope.selectedProgram = program; } }); - + //broadcast selected items for dashboard controllers - $scope.broadCastProgram(); + CurrentSelection.set({tei: $scope.selectedTei, te: $scope.trackedEntity, pr: $scope.selectedProgram, enrollment: null}); + $scope.broadCastSelections(); }); }); }); - } + } - $scope.broadCastProgram = function(){ - CurrentSelection.set({tei: $scope.selectedEntity, te: $scope.trackedEntity, pr: $scope.selectedProgram, enrollment: null}); + $scope.broadCastSelections = function(){ + + var selections = CurrentSelection.get(); + $scope.selectedTei = selections.tei; + $scope.trackedEntity = selections.te; + $scope.selectedEnrollment = selections.enrollment; + CurrentSelection.set({tei: $scope.selectedTei, te: $scope.trackedEntity, pr: $scope.selectedProgram, enrollment: null}); $timeout(function() { - $rootScope.$broadcast('selectedEntity', {programExists: $scope.programs.length > 0}); + $rootScope.$broadcast('selectedItems', {programExists: $scope.programs.length > 0}); }, 100); }; === modified 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 2014-06-19 15:27:17 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dashboard/dashboard.html 2014-06-30 05:56:38 +0000 @@ -6,7 +6,7 @@ === 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-27 15:42:43 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/dataentry/dataentry.html 2014-06-30 05:56:38 +0000 @@ -1,4 +1,4 @@ -
+
{{dataentryWidget.title| translate}} @@ -6,10 +6,10 @@ - - + + - +
@@ -92,7 +92,7 @@ - {{prStDe.dataElement.name}} - {{prStDe.dataElement.type}} + {{prStDe.dataElement.name}} === 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-27 15:42:43 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/enrollment/enrollment-controller.js 2014-06-30 05:56:38 +0000 @@ -15,7 +15,7 @@ //listen for the selected items - $scope.$on('selectedEntity', function(event, args) { + $scope.$on('selectedItems', function(event, args) { //programs for enrollment $scope.enrollments = []; $scope.showEnrollmentDiv = false; @@ -25,14 +25,15 @@ $scope.newEnrollment = {}; var selections = CurrentSelection.get(); - $scope.selectedEntity = selections.tei; + $scope.selectedTei = angular.copy(selections.tei); + $scope.selectedEntity = selections.te; $scope.selectedProgram = selections.pr; $scope.programExists = args.programExists; $scope.selectedOrgUnit = storage.get('SELECTED_OU'); if($scope.selectedProgram){ - EnrollmentService.getByEntityAndProgram($scope.selectedEntity.trackedEntityInstance, $scope.selectedProgram.id).then(function(data){ + EnrollmentService.getByEntityAndProgram($scope.selectedTei.trackedEntityInstance, $scope.selectedProgram.id).then(function(data){ $scope.enrollments = data.enrollmentList; $scope.loadEvents(); }); @@ -61,9 +62,9 @@ $scope.attributesForEnrollment = []; for(var i=0; i +
{{enrollmentWidget.title| translate}} - - + + - +
=== 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-06-27 14:49:34 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/notes/notes.html 2014-06-30 05:56:38 +0000 @@ -1,4 +1,4 @@ -
+
{{notesWidget.title| translate}} @@ -6,10 +6,10 @@ - - + + - +
=== 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-27 15:42:43 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/profile/profile-controller.js 2014-06-30 05:56:38 +0000 @@ -4,6 +4,7 @@ orderByFilter, CurrentSelection, TEIService, + DialogService, AttributesFactory, TranslationService) { @@ -20,70 +21,69 @@ }); //listen for the selected entity - $scope.$on('selectedEntity', function(event, args) { + $scope.$on('dashboard', function(event, args) { var selections = CurrentSelection.get(); - $scope.selectedTei = selections.tei; + $scope.selectedTei = angular.copy(selections.tei); $scope.trackedEntity = selections.te; $scope.selectedProgram = selections.pr; $scope.selectedEnrollment = selections.enrollment; + $scope.processTeiAttributes(); }); //display only those attributes that belong the selected program //if no program, display attributesInNoProgram $scope.processTeiAttributes = function(){ - - angular.forEach($scope.selectedTei.attributes, function(att){ - if(att.type === 'number' && !isNaN(parseInt(att.value))){ - att.value = parseInt(att.value); - } - }); - + if($scope.selectedProgram && $scope.selectedEnrollment){ - //show only those attributes in selected program - AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){ - - $scope.selectedTei.attributes = $scope.showRequiredAttributes(atts,$scope.selectedTei.attributes); - - }); - } - else{ - //show attributes in no program - AttributesFactory.getWithoutProgram().then(function(atts){ - - $scope.selectedTei.attributes = $scope.showRequiredAttributes(atts,$scope.selectedTei.attributes); - + //show attribute for selected program and enrollment + AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){ + $scope.selectedTei.attributes = $scope.showRequiredAttributes(atts,$scope.selectedTei.attributes, true); + }); + } + if($scope.selectedProgram && !$scope.selectedEnrollment){ + //show attributes for selected program + AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){ + $scope.selectedTei.attributes = $scope.showRequiredAttributes(atts,$scope.selectedTei.attributes, false); + }); + } + if(!$scope.selectedProgram && !$scope.selectedEnrollment){ + //show attributes in no program + AttributesFactory.getWithoutProgram().then(function(atts){ + $scope.selectedTei.attributes = $scope.showRequiredAttributes(atts,$scope.selectedTei.attributes, false); }); - } - - $scope.selectedTei.attributes = orderByFilter($scope.selectedTei.attributes, '-order'); - $scope.selectedTei.attributes.reverse(); + } }; - $scope.showRequiredAttributes = function(requiredAttributes, availableAttributes){ - - var teiAttributes = availableAttributes; + $scope.showRequiredAttributes = function(requiredAttributes, teiAttributes, fromEnrollment){ + //first reset teiAttributes for(var j=0; j +
{{trackedEntity.name|| 'entity' | translate}} {{profileWidget.title| translate}} @@ -6,10 +6,10 @@ - - + + - +
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html 2014-06-27 14:49:34 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/relationship/relationship.html 2014-06-30 05:56:38 +0000 @@ -1,12 +1,12 @@ -
+
{{relationshipWidget.title| translate}} - - + + - +
=== modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected-controller.js' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected-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/selected/selected-controller.js 2014-06-30 05:56:38 +0000 @@ -7,7 +7,7 @@ TranslationService.translate(); //listen for the selected items - $scope.$on('selectedEntity', function(event, args) { + $scope.$on('selectedItems', function(event, args) { var selections = CurrentSelection.get(); $scope.selectedEntity = selections.tei; === modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html 2014-06-27 14:49:34 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/components/selected/selected.html 2014-06-30 05:56:38 +0000 @@ -1,12 +1,12 @@ -
+
{{selectedWidget.title| translate}} - - + + - +
=== 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-27 13:33:07 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-06-30 05:56:38 +0000 @@ -281,8 +281,8 @@ }; $scope.showDashboard = function(currentEntity){ - $location.path('/dashboard').search({selectedEntityId: currentEntity.id, - selectedProgramId: $scope.selectedProgram ? $scope.selectedProgram.id: null}); + $location.path('/dashboard').search({tei: currentEntity.id, + program: $scope.selectedProgram ? $scope.selectedProgram.id: null}); }; $scope.getHelpContent = function(){ === 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-27 13:33:07 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-06-30 05:56:38 +0000 @@ -478,18 +478,7 @@ query.hasValue = true; q += 'LT:' + attribute.endValue + ':'; } - } - - /*if(attribute.startDate && attribute.startDate !== ''){ - query.hasValue = true; - q += 'GE:' + attribute.startDate + ':'; - } - - if(attribute.endDate && attribute.endDate !== ''){ - query.hasValue = true; - q += 'LE:' + attribute.endDate + ':'; - }*/ - + } if(query.url){ if(q){ q = q.substr(0,q.length-1); @@ -534,32 +523,8 @@ query.url = 'filter=' + attribute.id + ':LIKE:' + attribute.value; } } - } - - /*if(attribute.filters){ - var q = ''; - angular.forEach(attribute.filters, function(filter){ - if(filter.value !== ''){ - q += filter.operator + ':' + filter.value + ':'; - } - }); - q = q.substr(0,q.length-1); - - if(query.url){ - if(q){ - query.url = query.url + '&filter=' + attribute.id + ':' + q; - } - } - else{ - if(q){ - query.url = 'filter=' + attribute.id + ':' + q; - } - } - }*/ - } - - + } }); if(enrollment){ @@ -579,17 +544,7 @@ query.hasValue = true; q += '&programEndDate=' + enrollment.programEndDate; } - } - - /*if(enrollment.programStartDate && enrollment.programStartDate !== ''){ - query.hasValue = true; - q += '&programStartDate=' + enrollment.programStartDate; - } - if(enrollment.programEndDate && enrollment.programEndDate !== ''){ - query.hasValue = true; - q += '&programEndDate=' + enrollment.programEndDate; - }*/ - + } if(q){ if(query.url){ query.url = query.url + q; === modified file 'dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js' --- dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js 2014-06-20 14:23:28 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/scripts/tracker-capture.js 2014-06-30 05:56:38 +0000 @@ -134,6 +134,7 @@ //drop down menu for program selection $("#selectDropDown").width($("#selectDropDownParent").width()); + $("#selectDropDown").css('margin-right: -15x;'); $(".select-drop-down-button").on('click', function(e) { e.stopPropagation(); $("#selectDropDown").dropdown('toggle'); === 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-27 14:49:34 +0000 +++ dhis-2/dhis-web/dhis-web-tracker-capture/src/main/webapp/dhis-web-tracker-capture/styles/style.css 2014-06-30 05:56:38 +0000 @@ -920,6 +920,8 @@ .dropdown-menu { margin-top: -5px; + margin-left: 0; + margin-right: 0; } .btn-link { @@ -929,4 +931,12 @@ label{ font-weight:normal !important +} + +a { + color: inherit; +} + +a:hover { + color: inherit; } \ No newline at end of file