=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/WEB-INF/web.xml' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/WEB-INF/web.xml 2014-08-18 14:37:59 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/WEB-INF/web.xml 2014-10-08 11:53:55 +0000 @@ -70,6 +70,11 @@ Struts *.action + + + woff + application/font-woff + org.springframework.web.context.ContextLoaderListener === 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 2014-09-11 12:35:41 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/index.html 2014-10-08 11:53:55 +0000 @@ -59,7 +59,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 2014-08-29 12:39:37 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/controllers.js 2014-10-08 11:53:55 +0000 @@ -45,7 +45,7 @@ //Reporting $scope.showReportDiv = false; - + //watch for selection of org unit from tree $scope.$watch('selectedOrgUnit', function() { @@ -58,25 +58,7 @@ //apply translation - by now user's profile is fetched from server. TranslationService.translate(); - $scope.loadPrograms($scope.selectedOrgUnit); - - if($scope.selectedProgram){ - AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){ - $scope.attributes = atts; - $scope.attributes = $scope.generateAttributeFilters($scope.attributes); - $scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name); - $scope.search($scope.searchMode.listAll); ; - }); - } - else{ - AttributesFactory.getWithoutProgram().then(function(atts){ - - $scope.attributes = atts; - $scope.attributes = $scope.generateAttributeFilters($scope.attributes); - $scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name); - $scope.search($scope.searchMode.listAll); - }); - } + $scope.loadPrograms($scope.selectedOrgUnit); } }); @@ -85,12 +67,7 @@ $scope.selectedOrgUnit = storage.get('SELECTED_OU'); ProgramFactory.get($scope.dashboardProgramId).then(function(program){ $scope.selectedProgram = program; - AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){ - $scope.attributes = atts; - $scope.attributes = $scope.generateAttributeFilters($scope.attributes); - $scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name); - $scope.getProgramAttributes($scope.selectedProgram); - }); + $scope.processAttributes(); }); } @@ -125,7 +102,9 @@ $scope.selectedProgram = $scope.programs[0]; } } - } + } + $scope.processAttributes(); + $scope.search($scope.searchMode.listAll); }); } }; @@ -134,29 +113,8 @@ $scope.trackedEntityList = null; $scope.selectedProgram = program; - - if($scope.selectedProgram){ - AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){ - setTimeout(function () { - $scope.$apply(function () { - $scope.attributes = atts; - $scope.attributes = $scope.generateAttributeFilters($scope.attributes); - $scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name); - }); - }, 100); - }); - } - else{ - AttributesFactory.getWithoutProgram().then(function(atts){ - setTimeout(function () { - $scope.$apply(function () { - $scope.attributes = atts; - $scope.attributes = $scope.generateAttributeFilters($scope.attributes); - $scope.gridColumns = TEIGridService.generateGridColumns(atts, $scope.selectedOuMode.name); - }); - }, 100); - }); - } + + $scope.processAttributes(); if($scope.showRegistrationDiv || $scope.showReportDiv){ $scope.doSearch = false; @@ -165,8 +123,45 @@ if($scope.doSearch){ $scope.search($scope.searchMode); } - }; + }; + + $scope.processAttributes = function(){ + + if($scope.selectedProgram){ + AttributesFactory.getByProgram($scope.selectedProgram).then(function(atts){ + $scope.attributesLighter = []; + $scope.attributes = []; + setTimeout(function () { + $scope.$apply(function () { + angular.forEach(atts, function(att){ + $scope.attributesLighter.push({id: att.id, name: att.name, type: att.valueType, displayInListNoProgram: att.displayInListNoProgram}); + $scope.attributes[att.id] = att; + }); + $scope.attributesLighter = $scope.generateAttributeFilters($scope.attributesLighter); + $scope.gridColumns = TEIGridService.generateGridColumns($scope.attributesLighter, $scope.selectedOuMode.name); + }); + }, 100); + }); + } + else{ + AttributesFactory.getWithoutProgram().then(function(atts){ + $scope.attributesLighter = []; + $scope.attributes = []; + setTimeout(function () { + $scope.$apply(function () { + angular.forEach(atts, function(att){ + $scope.attributesLighter.push({id: att.id, name: att.name, type: att.valueType, displayInListNoProgram: att.displayInListNoProgram}); + $scope.attributes[att.id] = att; + }); + $scope.attributesLighter = $scope.generateAttributeFilters($scope.attributesLighter); + $scope.gridColumns = TEIGridService.generateGridColumns($scope.attributesLighter, $scope.selectedOuMode.name); + }); + }, 100); + }); + } + }; + $scope.searchParam = {bools: []}; $scope.search = function(mode){ $scope.teiFetched = false; @@ -198,16 +193,15 @@ return; } - $scope.queryUrl = 'query=' + $scope.searchText; - - $scope.attributes = EntityQueryFactory.resetAttributesQuery($scope.attributes, $scope.enrollment); + $scope.queryUrl = 'query=' + $scope.searchText; + $scope.attributesLighter = EntityQueryFactory.resetAttributesQuery($scope.attributesLighter, $scope.enrollment); } if( $scope.selectedSearchMode === $scope.searchMode.attributeBased ){ $scope.searchText = ''; - $scope.attributeUrl = EntityQueryFactory.getAttributesQuery($scope.attributes, $scope.enrollment); + $scope.attributeUrl = EntityQueryFactory.getAttributesQuery($scope.attributesLighter, $scope.enrollment); if(!$scope.attributeUrl.hasValue && !$scope.selectedProgram){ $scope.emptySearchAttribute = true; @@ -276,7 +270,7 @@ $scope.generateAttributeFilters = function(attributes){ angular.forEach(attributes, function(attribute){ - if(attribute.valueType === 'number' || attribute.valueType === 'date'){ + if(attribute.type === 'number' || attribute.type === 'date'){ attribute.operator = $scope.defaultOperators[0]; } }); @@ -288,7 +282,7 @@ $scope.trackedEntityList = null; }; - $scope.showHideSearch = function(){ + $scope.showHideSearch = function(){ $scope.showSearchDiv = !$scope.showSearchDiv; }; === 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-09-17 14:54:25 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/directives.js 2014-10-08 11:53:55 +0000 @@ -23,7 +23,7 @@ link: function(scope, element, attrs){ //when tree has loaded, get selected orgunit - if there is any - and inform angular - $(function() { + /*$(function() { var adapters = []; var partial_adapters = []; @@ -63,7 +63,7 @@ }); }); - }); + });*/ //listen to user selection, and inform angular selection.setListenerFunction( organisationUnitSelected ); === 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-10-03 08:25:10 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/scripts/services.js 2014-10-08 11:53:55 +0000 @@ -647,7 +647,7 @@ angular.forEach(attributes, function(attribute){ - if(attribute.valueType === 'date' || attribute.valueType === 'number'){ + if(attribute.type === 'date' || attribute.type === 'number'){ var q = ''; if(attribute.operator === OperatorFactory.defaultOperators[0]){ === modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.html' --- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.html 2014-10-08 08:48:34 +0000 +++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-tracker-capture/views/home.html 2014-10-08 11:53:55 +0000 @@ -107,12 +107,12 @@ - + {{attribute.name}} -
+
@@ -153,11 +153,11 @@
-