← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 21293: PT support for db translations.

 

------------------------------------------------------------
revno: 21293
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2015-12-03 13:29:20 +0100
message:
  PT support for db translations.
modified:
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/plugin.html
  dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js
  dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js
  dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js


--
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-pivot/plugin.html'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/plugin.html	2015-11-13 23:15:35 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/plugin.html	2015-12-03 12:29:20 +0000
@@ -22,7 +22,7 @@
                 username: username,
                 password: password,
 				el: 'table1',
-				id: 'SEMVWsnVblY',
+				id: 'JYXVYKRYT61',
                 showDimensionLabels: true
 			});
 

=== modified file 'dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js'
--- dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js	2015-11-13 23:15:35 +0000
+++ dhis-2/dhis-web/dhis-web-apps/src/main/webapp/dhis-web-pivot/scripts/table.js	2015-12-03 12:29:20 +0000
@@ -208,7 +208,7 @@
 
 			conf.layout = {
 				west_width: 424,
-				west_fieldset_width: 418,
+				west_fieldset_width: 420,
 				west_width_padding: 2,
 				west_fill: 2,
 				west_fill_accordion_indicator: 81,
@@ -283,11 +283,11 @@
             conf.url = {
                 analysisFields: [
                     '*',
-                    'program[id,name]',
-                    'programStage[id,name]',
-                    'columns[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
-                    'rows[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
-                    'filters[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
+                    'program[id,displayName|rename(name)]',
+                    'programStage[id,displayName|rename(name)]',
+                    'columns[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
+                    'rows[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
+                    'filters[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
                     '!lastUpdated',
                     '!href',
                     '!created',
@@ -2117,7 +2117,14 @@
 					dx = dimConf.indicator.dimensionName,
 					co = dimConf.category.dimensionName,
                     aggTypes = ['COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'],
-                    displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
+                    propertyMap = {
+                        'name': 'name',
+                        'displayName': 'name',
+                        'shortName': 'shortName',
+                        'displayShortName': 'shortName'
+                    },
+                    keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+                    displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
 
 				for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
 					dimName = axisDimensionNames[i];

=== modified file 'dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js'
--- dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js	2015-11-10 22:06:00 +0000
+++ dhis-2/dhis-web/dhis-web-commons-resources/src/main/webapp/dhis-web-commons/javascripts/plugin/table.js	2015-12-03 12:29:20 +0000
@@ -208,7 +208,7 @@
 
 			conf.layout = {
 				west_width: 424,
-				west_fieldset_width: 418,
+				west_fieldset_width: 420,
 				west_width_padding: 2,
 				west_fill: 2,
 				west_fill_accordion_indicator: 81,
@@ -283,11 +283,11 @@
             conf.url = {
                 analysisFields: [
                     '*',
-                    'program[id,name]',
-                    'programStage[id,name]',
-                    'columns[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
-                    'rows[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
-                    'filters[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
+                    'program[id,displayName|rename(name)]',
+                    'programStage[id,displayName|rename(name)]',
+                    'columns[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
+                    'rows[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
+                    'filters[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
                     '!lastUpdated',
                     '!href',
                     '!created',
@@ -2117,7 +2117,14 @@
 					dx = dimConf.indicator.dimensionName,
 					co = dimConf.category.dimensionName,
                     aggTypes = ['COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'],
-                    displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
+                    propertyMap = {
+                        'name': 'name',
+                        'displayName': 'name',
+                        'shortName': 'shortName',
+                        'displayShortName': 'shortName'
+                    },
+                    keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+                    displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
 
 				for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
 					dimName = axisDimensionNames[i];
@@ -3203,36 +3210,36 @@
         });
 
         // user orgunit
-		requests.push({
-			url: init.contextPath + '/api/organisationUnits.' + type + '?userOnly=true&fields=id,name,children[id,name]&paging=false',
-            disableCaching: false,
-			success: function(r) {
-				var organisationUnits = (r.responseText ? Ext.decode(r.responseText).organisationUnits : r) || [],
-                    ou = [],
-                    ouc = [];
-
-                if (organisationUnits.length) {
-                    for (var i = 0, org; i < organisationUnits.length; i++) {
-                        org = organisationUnits[i];
-
-                        ou.push(org.id);
-
-                        if (org.children) {
-                            ouc = Ext.Array.clean(ouc.concat(Ext.Array.pluck(org.children, 'id') || []));
-                        }
-                    }
-
-                    init.user = init.user || {};
-                    init.user.ou = ou;
-                    init.user.ouc = ouc;
-                }
-                else {
-                    alert('User is not assigned to any organisation units');
-                }
-
-                fn();
-			}
-		});
+		//requests.push({
+			//url: init.contextPath + '/api/organisationUnits.' + type + '?userOnly=true&fields=id,name,children[id,name]&paging=false',
+            //disableCaching: false,
+			//success: function(r) {
+				//var organisationUnits = (r.responseText ? Ext.decode(r.responseText).organisationUnits : r) || [],
+                    //ou = [],
+                    //ouc = [];
+
+                //if (organisationUnits.length) {
+                    //for (var i = 0, org; i < organisationUnits.length; i++) {
+                        //org = organisationUnits[i];
+
+                        //ou.push(org.id);
+
+                        //if (org.children) {
+                            //ouc = Ext.Array.clean(ouc.concat(Ext.Array.pluck(org.children, 'id') || []));
+                        //}
+                    //}
+
+                    //init.user = init.user || {};
+                    //init.user.ou = ou;
+                    //init.user.ouc = ouc;
+                //}
+                //else {
+                    //alert('User is not assigned to any organisation units');
+                //}
+
+                //fn();
+			//}
+		//});
 
         // dimensions
 		requests.push({

=== modified file 'dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js'
--- dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js	2015-11-10 22:06:00 +0000
+++ dhis-2/dhis-web/dhis-web-dashboard-integration/src/main/webapp/dhis-web-dashboard-integration/plugin/table.js	2015-12-03 12:29:20 +0000
@@ -208,7 +208,7 @@
 
 			conf.layout = {
 				west_width: 424,
-				west_fieldset_width: 418,
+				west_fieldset_width: 420,
 				west_width_padding: 2,
 				west_fill: 2,
 				west_fill_accordion_indicator: 81,
@@ -283,11 +283,11 @@
             conf.url = {
                 analysisFields: [
                     '*',
-                    'program[id,name]',
-                    'programStage[id,name]',
-                    'columns[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
-                    'rows[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
-                    'filters[dimension,filter,items[id,' + init.namePropertyUrl + ']]',
+                    'program[id,displayName|rename(name)]',
+                    'programStage[id,displayName|rename(name)]',
+                    'columns[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
+                    'rows[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
+                    'filters[dimension,filter,items[dimensionItem|rename(id),' + init.namePropertyUrl + ']]',
                     '!lastUpdated',
                     '!href',
                     '!created',
@@ -2117,7 +2117,14 @@
 					dx = dimConf.indicator.dimensionName,
 					co = dimConf.category.dimensionName,
                     aggTypes = ['COUNT', 'SUM', 'STDDEV', 'VARIANCE', 'MIN', 'MAX'],
-                    displayProperty = xLayout.displayProperty || init.userAccount.settings.keyAnalysisDisplayProperty || 'name';
+                    propertyMap = {
+                        'name': 'name',
+                        'displayName': 'name',
+                        'shortName': 'shortName',
+                        'displayShortName': 'shortName'
+                    },
+                    keyAnalysisDisplayProperty = init.userAccount.settings.keyAnalysisDisplayProperty,
+                    displayProperty = propertyMap[keyAnalysisDisplayProperty] || propertyMap[xLayout.displayProperty] || 'name';
 
 				for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) {
 					dimName = axisDimensionNames[i];
@@ -3203,36 +3210,36 @@
         });
 
         // user orgunit
-		requests.push({
-			url: init.contextPath + '/api/organisationUnits.' + type + '?userOnly=true&fields=id,name,children[id,name]&paging=false',
-            disableCaching: false,
-			success: function(r) {
-				var organisationUnits = (r.responseText ? Ext.decode(r.responseText).organisationUnits : r) || [],
-                    ou = [],
-                    ouc = [];
-
-                if (organisationUnits.length) {
-                    for (var i = 0, org; i < organisationUnits.length; i++) {
-                        org = organisationUnits[i];
-
-                        ou.push(org.id);
-
-                        if (org.children) {
-                            ouc = Ext.Array.clean(ouc.concat(Ext.Array.pluck(org.children, 'id') || []));
-                        }
-                    }
-
-                    init.user = init.user || {};
-                    init.user.ou = ou;
-                    init.user.ouc = ouc;
-                }
-                else {
-                    alert('User is not assigned to any organisation units');
-                }
-
-                fn();
-			}
-		});
+		//requests.push({
+			//url: init.contextPath + '/api/organisationUnits.' + type + '?userOnly=true&fields=id,name,children[id,name]&paging=false',
+            //disableCaching: false,
+			//success: function(r) {
+				//var organisationUnits = (r.responseText ? Ext.decode(r.responseText).organisationUnits : r) || [],
+                    //ou = [],
+                    //ouc = [];
+
+                //if (organisationUnits.length) {
+                    //for (var i = 0, org; i < organisationUnits.length; i++) {
+                        //org = organisationUnits[i];
+
+                        //ou.push(org.id);
+
+                        //if (org.children) {
+                            //ouc = Ext.Array.clean(ouc.concat(Ext.Array.pluck(org.children, 'id') || []));
+                        //}
+                    //}
+
+                    //init.user = init.user || {};
+                    //init.user.ou = ou;
+                    //init.user.ouc = ouc;
+                //}
+                //else {
+                    //alert('User is not assigned to any organisation units');
+                //}
+
+                //fn();
+			//}
+		//});
 
         // dimensions
 		requests.push({