← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16402: PT client side i18n + ER EV tracked entity attributes.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 16402 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2014-08-13 15:52:00 +0200
message:
  PT client side i18n + ER EV tracked entity attributes.
added:
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/i18n/
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/i18n/i18n_en.json
modified:
  dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-event-visualizer/src/main/webapp/dhis-web-event-visualizer/app/scripts/app.js
  dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.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-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js	2014-08-11 13:40:04 +0000
+++ dhis-2/dhis-web/dhis-web-event-reports/src/main/webapp/dhis-web-event-reports/app/scripts/app.js	2014-08-13 13:50:16 +0000
@@ -3406,7 +3406,7 @@
             }
             else {
                 Ext.Ajax.request({
-                    url: ns.core.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,name],programTrackedEntityAttributes[attribute[id,name,valueType,optionSet[id,name]]]&paging=false',
+                    url: ns.core.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,name],programTrackedEntityAttributes[trackedEntityAttribute[id,name,valueType,optionSet[id,name]]]&paging=false',
                     success: function(r) {
                         var program = Ext.decode(r.responseText).programs[0],
                             stages,
@@ -3418,7 +3418,7 @@
                         }
 
                         stages = program.programStages;
-                        attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'attribute');
+                        attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute');
 
                         // attributes cache
                         if (Ext.isArray(attributes) && attributes.length) {

=== modified file 'dhis-2/dhis-web/dhis-web-event-visualizer/src/main/webapp/dhis-web-event-visualizer/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-event-visualizer/src/main/webapp/dhis-web-event-visualizer/app/scripts/app.js	2014-08-11 13:43:42 +0000
+++ dhis-2/dhis-web/dhis-web-event-visualizer/src/main/webapp/dhis-web-event-visualizer/app/scripts/app.js	2014-08-13 13:50:16 +0000
@@ -3046,7 +3046,7 @@
             }
             else {
                 Ext.Ajax.request({
-                    url: ns.core.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,name],programTrackedEntityAttributes[attribute[id,name,valueType,optionSet[id,name]]]&paging=false',
+                    url: ns.core.init.contextPath + '/api/programs.json?filter=id:eq:' + programId + '&fields=programStages[id,name],programTrackedEntityAttributes[trackedEntityAttribute[id,name,valueType,optionSet[id,name]]]&paging=false',
                     success: function(r) {
                         var program = Ext.decode(r.responseText).programs[0],
                             stages,
@@ -3058,7 +3058,7 @@
                         }
 
                         stages = program.programStages;
-                        attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'attribute');
+                        attributes = Ext.Array.pluck(program.programTrackedEntityAttributes, 'trackedEntityAttribute');
 
                         // attributes cache
                         if (Ext.isArray(attributes) && attributes.length) {

=== added directory 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/i18n'
=== added file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/i18n/i18n_en.json'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/i18n/i18n_en.json	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/i18n/i18n_en.json	2014-08-12 14:55:33 +0000
@@ -0,0 +1,167 @@
+{
+    "cancel": "Cancel",
+    "sixmonths": "Six-months",
+    "can_edit_and_view": "Can edit and view",
+    "last_12_weeks": "Last 12 weeks",
+    "select_data_element_group": "Select data element group",
+    "include_cumulative": "Include cumulative",
+    "prev": "Prev",
+    "none": "None",
+    "bimonths": "Bi-months",
+    "at_least_one_period_must_be_specified_as_column_row_or_filter": "At least one period must be specified as column, row or filter",
+    "years": "Years",
+    "aggregation_type": "Aggregation type",
+    "prev_year": "Prev year",
+    "share_with_other_people": "Share with other people",
+    "at_least_one_dimension_must_be_specified_as_row_or_column": "At least one dimension must be specified as row or column",
+    "plugin_config": "Plugin config",
+    "options": "Options",
+    "overwrite": "Overwrite",
+    "select_all_children": "Select all children",
+    "low_to_high": "Low to high",
+    "select_organisation_unit_groups": "Select organisation unit groups",
+    "user_organisation_unit_grandchildren": "Org unit grand children",
+    "last_month": "Last month",
+    "large": "Large",
+    "assigned_categories": "Assigned categories",
+    "organisation_units": "Organisation units",
+    "select_organisation_unit_levels": "Select organisation unit levels",
+    "all_indicators": "All indicators",
+    "indicators": "Indicators",
+    "sixmonthly_april": "Six-monthly April",
+    "public_access": "Public access",
+    "data_elements": "Data elements",
+    "interpretation": "interpretation",
+    "comfortable": "Comfortable",
+    "organisation_unit": "Organisation unit",
+    "open_last_map": "Open last map",
+    "style": "Style",
+    "include_regression": "Include regression",
+    "allow_external_access": "Allow external access",
+    "open_last_chart": "Open last chart",
+    "select_indicator_group": "Select indicator group",
+    "manage_favorites": "Manage favorites",
+    "weeks": "Weeks",
+    "last_year": "Last year",
+    "data_sets_cannot_be_specified_as_filter": "Data sets cannot be specified as filter",
+    "save": "Save",
+    "sum": "Sum",
+    "parent_organisation_unit": "Parent organisation unit",
+    "select_period_type": "Select period type",
+    "quarterly": "Quarterly",
+    "last_4_weeks": "Last 4 weeks",
+    "weekly": "Weekly",
+    "all_data_elements": "All data elements",
+    "digit_group_separator": "Digit group separator",
+    "small_": "Small",
+    "min": "Min",
+    "default_": "Default",
+    "periods": "Periods",
+    "categories_cannot_be_specified_as_filter": "Categories cannot be specified as filter",
+    "share": "Share",
+    "categories": "Categories",
+    "last_bimonth": "Last bi-month",
+    "map": "Map",
+    "table": "Table",
+    "financial_july": "Financial July",
+    "table_options": "Table options",
+    "show_col_totals": "Show column totals",
+    "all_indicator_groups": "All indicator groups",
+    "max": "Max",
+    "column": "Column",
+    "by_data_element": "By data element",
+    "last_5_years": "Last 5 years",
+    "display_density": "Display density",
+    "overwrite_favorite": "Overwrite favorite",
+    "filter": "Filter",
+    "example7": "Click Favorites to save your table for later use",
+    "example6": "Click Options to hide sub-totals or empty rows, adjust font size and more",
+    "hide": "Hide",
+    "example8": "Click Download to save table data to your computer",
+    "example3": "Click Layout to arrange your dimensions on table rows and columns",
+    "rename": "Rename",
+    "example2": "Select items from any of the dimensions in the left menu",
+    "example5": "Working with a pivot table",
+    "go_to_maps": "Go to maps",
+    "example4": "Click Update to create your table",
+    "example1": "Creating a pivot table",
+    "select_organisation_units": "Select organisation units",
+    "high_to_low": "High to low",
+    "chart": "Chart",
+    "delete_": "Delete",
+    "dimensions": "Dimensions",
+    "reporting_period": "Reporting period",
+    "data_element_group_sets_cannot_be_specified_together_with_data_sets": "Data element group sets cannot be specified together with data sets",
+    "plain_data_sources": "Plain data source",
+    "compact": "Compact",
+    "delete_favorite": "Delete favorite",
+    "sharing_settings": "Sharing settings",
+    "last_6_bimonths": "Last 6 bi-months",
+    "data": "Data",
+    "last_2_sixmonths": "Last 2 six-months",
+    "financial_years": "Financial years",
+    "next_year": "Next year",
+    "available": "Available",
+    "financial_april": "Financial April",
+    "graphics": "Graphics",
+    "last_financial_year": "Last financial year",
+    "add_new": "Add new",
+    "data_sets": "Data sets",
+    "download": "Download",
+    "last_3_months": "Last 3 months",
+    "for_standard_reports_only": "for standard reports only",
+    "search_for_favorites": "Search for favorites",
+    "create": "Create",
+    "details": "Details",
+    "show_row_totals": "Show row totals",
+    "selected": "Selected",
+    "months": "Months",
+    "this_year": "This year",
+    "bimonthly": "Bi-monthly",
+    "count": "Count",
+    "open_this_table_as_map": "Open this table as map",
+    "show_subtotals": "Show subtotals",
+    "all_data_element_groups": "All data element groups",
+    "open_this_table_as_chart": "Open this table as chart",
+    "hide_empty_rows": "Hide empty rows",
+    "write_your_interpretation": "Write a comment, question or interpretation",
+    "select_boundaries_and_groups": "Select boundaries and groups",
+    "daily": "Daily",
+    "monthly": "Monthly",
+    "please_create_a_table_first": "Please create a table first",
+    "sixmonthly": "Six-monthly",
+    "parameters": "Parameters",
+    "yearly": "Yearly",
+    "next": "Next",
+    "favorites": "Favorites",
+    "can_view": "Can view",
+    "search_for_user_groups": "Search for user groups",
+    "font_size": "Font size",
+    "update": "Update",
+    "go_to_charts": "Go to charts",
+    "top_limit": "Top limit",
+    "user_organisation_unit_children": "Org unit children",
+    "last_12_months": "Last 12 months",
+    "indicators_cannot_be_specified_as_filter": "Indicators cannot be specified as filter",
+    "financial_oct": "Financial October",
+    "row": "Row",
+    "select_boundaries_and_levels": "Select boundaries and levels",
+    "stddev": "Standard deviation",
+    "sort_order": "Sort order",
+    "normal": "Normal",
+    "quarters": "Quarters",
+    "last_sixmonth": "Last six-month",
+    "totals": "Totals",
+    "home": "Home",
+    "layout": "Layout",
+    "reporting_rates": "Reporting rates",
+    "last_5_financial_years": "Last 5 financial years",
+    "variance": "Variance",
+    "show_hierarchy": "Show hierarchy",
+    "user_organisation_unit": "User org unit",
+    "last_week": "Last week",
+    "legend_set": "Legend set",
+    "table_layout": "Table layout",
+    "last_quarter": "Last quarter",
+    "last_4_quarters": "Last 4 quarters"
+}

=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js'
--- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2014-08-11 15:32:26 +0000
+++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js	2014-08-12 14:55:33 +0000
@@ -6056,139 +6056,139 @@
 			success: function(r) {
 				init.contextPath = Ext.decode(r.responseText).activities.dhis.href;
 
-				Ext.Ajax.request({
-					url: 'i18n.json',
-					success: function(r) {
-						var i18nArray = Ext.decode(r.responseText);
-
-						Ext.Ajax.request({
-							url: init.contextPath + '/api/system/info.json',
-							success: function(r) {
-                                var info = Ext.decode(r.responseText),
-                                    dhis2PeriodUrl = '../../dhis-web-commons/javascripts/dhis2/dhis2.period.js',
-                                    defaultCalendarId = 'gregorian',
-                                    calendarIdMap = {'iso8601': defaultCalendarId},
-                                    calendarId = calendarIdMap[info.calendar] || info.calendar || defaultCalendarId,
-                                    calendarIds = ['coptic', 'ethiopian', 'islamic', 'julian', 'nepali', 'thai'],
-                                    calendarScriptUrl,
-                                    createGenerator;
-
-                                // calendar
-                                init.dateFormat = info.dateFormat || 'yyyy-mm-dd';
-
-                                createGenerator = function() {
-                                    init.calendar = $.calendars.instance(calendarId);
-                                    init.periodGenerator = new dhis2.period.PeriodGenerator(init.calendar, init.dateFormat);
-                                };
-
-                                if (Ext.Array.contains(calendarIds, calendarId)) {
-                                    calendarScriptUrl = '../../dhis-web-commons/javascripts/jQuery/calendars/jquery.calendars.' + calendarId + '.min.js';
-
-                                    Ext.Loader.injectScriptElement(calendarScriptUrl, function() {
-                                        Ext.Loader.injectScriptElement(dhis2PeriodUrl, createGenerator);
-                                    });
+                // system info
+                Ext.Ajax.request({
+                    url: init.contextPath + '/api/system/info.json',
+                    success: function(r) {
+                        var info = Ext.decode(r.responseText);
+
+                        // context path
+                        init.contextPath = info.contextPath || init.contextPath;
+
+                        // calendars
+                        init.dateFormat = info.dateFormat || 'yyyy-mm-dd';
+
+                        (function() {
+                            var dhis2PeriodUrl = '../../dhis-web-commons/javascripts/dhis2/dhis2.period.js',
+                                defaultCalendarId = 'gregorian',
+                                calendarIdMap = {'iso8601': defaultCalendarId},
+                                calendarId = calendarIdMap[info.calendar] || info.calendar || defaultCalendarId,
+                                calendarIds = ['coptic', 'ethiopian', 'islamic', 'julian', 'nepali', 'thai'],
+                                calendarScriptUrl,
+                                createGenerator;
+
+                            // calendar
+                            createGenerator = function() {
+                                init.calendar = $.calendars.instance(calendarId);
+                                init.periodGenerator = new dhis2.period.PeriodGenerator(init.calendar, init.dateFormat);
+                            };
+
+                            if (Ext.Array.contains(calendarIds, calendarId)) {
+                                calendarScriptUrl = '../../dhis-web-commons/javascripts/jQuery/calendars/jquery.calendars.' + calendarId + '.min.js';
+
+                                Ext.Loader.injectScriptElement(calendarScriptUrl, function() {
+                                    Ext.Loader.injectScriptElement(dhis2PeriodUrl, createGenerator);
+                                });
+                            }
+                            else {
+                                Ext.Loader.injectScriptElement(dhis2PeriodUrl, createGenerator);
+                            }
+                        }());
+
+                        // user info
+                        requests.push({
+                            url: init.contextPath + '/api/me/user-account.json',
+                            success: function(r) {
+                                init.keyUiLocale = Ext.decode(r.responseText).settings.keyUiLocale || 'en';
+
+                                // i18n
+                                Ext.Ajax.request({
+                                    url: 'i18n/i18n_' + init.keyUiLocale + '.json',
+                                    success: function(r) {
+                                        NS.i18n = Ext.decode(r.responseText);
+                                        fn();
+                                    }
+                                });
+                            }
+                        });
+
+                        // root nodes
+                        requests.push({
+                            url: init.contextPath + '/api/organisationUnits.json?userDataViewFallback=true&paging=false&fields=id,name,children[id,name]',
+                            success: function(r) {
+                                init.rootNodes = Ext.decode(r.responseText).organisationUnits || [];
+                                fn();
+                            }
+                        });
+
+                        // organisation unit levels
+                        requests.push({
+                            url: init.contextPath + '/api/organisationUnitLevels.json?fields=id,name,level&paging=false',
+                            success: function(r) {
+                                init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
+
+                                if (!init.organisationUnitLevels.length) {
+                                    alert('No organisation unit levels');
+                                }
+
+                                fn();
+                            }
+                        });
+
+                        // user orgunits and children
+                        requests.push({
+                            url: init.contextPath + '/api/organisationUnits.json?userOnly=true&fields=id,name,children[id,name]&paging=false',
+                            success: function(r) {
+                                var organisationUnits = Ext.decode(r.responseText).organisationUnits || [],
+                                    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 {
-                                    Ext.Loader.injectScriptElement(dhis2PeriodUrl, createGenerator);
+                                    alert('User is not assigned to any organisation units');
                                 }
 
-                                // context path
-								init.contextPath = info.contextPath || init.contextPath;
-
-								// i18n
-								requests.push({
-									url: init.contextPath + '/api/i18n?package=org.hisp.dhis.pivot',
-									method: 'POST',
-									headers: {
-										'Content-Type': 'application/json',
-										'Accepts': 'application/json'
-									},
-									params: Ext.encode(i18nArray),
-									success: function(r) {
-										NS.i18n = Ext.decode(r.responseText);
-										fn();
-									}
-								});
-
-								// root nodes
-								requests.push({
-									url: init.contextPath + '/api/organisationUnits.json?userDataViewFallback=true&paging=false&fields=id,name,children[id,name]',
-									success: function(r) {
-										init.rootNodes = Ext.decode(r.responseText).organisationUnits || [];
-										fn();
-									}
-								});
-
-								// organisation unit levels
-								requests.push({
-									url: init.contextPath + '/api/organisationUnitLevels.json?fields=id,name,level&paging=false',
-									success: function(r) {
-										init.organisationUnitLevels = Ext.decode(r.responseText).organisationUnitLevels || [];
-
-										if (!init.organisationUnitLevels.length) {
-											alert('No organisation unit levels');
-										}
-
-										fn();
-									}
-								});
-
-								// user orgunits and children
-								requests.push({
-									url: init.contextPath + '/api/organisationUnits.json?userOnly=true&fields=id,name,children[id,name]&paging=false',
-									success: function(r) {
-										var organisationUnits = Ext.decode(r.responseText).organisationUnits || [],
-											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();
-									}
-								});
-
-								// legend sets
-								requests.push({
-									url: init.contextPath + '/api/mapLegendSets.json?fields=id,name,mapLegends[id,name,startValue,endValue,color]&paging=false',
-									success: function(r) {
-										init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
-										fn();
-									}
-								});
-
-								// dimensions
-								requests.push({
-									url: init.contextPath + '/api/dimensions.json?links=false&paging=false',
-									success: function(r) {
-										init.dimensions = Ext.decode(r.responseText).dimensions || [];
-										fn();
-									}
-								});
-
-								for (var i = 0; i < requests.length; i++) {
-									Ext.Ajax.request(requests[i]);
-								}
-							}
-						});
-					}
-				});
+                                fn();
+                            }
+                        });
+
+                        // legend sets
+                        requests.push({
+                            url: init.contextPath + '/api/mapLegendSets.json?fields=id,name,mapLegends[id,name,startValue,endValue,color]&paging=false',
+                            success: function(r) {
+                                init.legendSets = Ext.decode(r.responseText).mapLegendSets || [];
+                                fn();
+                            }
+                        });
+
+                        // dimensions
+                        requests.push({
+                            url: init.contextPath + '/api/dimensions.json?links=false&paging=false',
+                            success: function(r) {
+                                init.dimensions = Ext.decode(r.responseText).dimensions || [];
+                                fn();
+                            }
+                        });
+
+                        for (var i = 0; i < requests.length; i++) {
+                            Ext.Ajax.request(requests[i]);
+                        }
+                    }
+                });
 			}
 		});
 	}());