=== modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module.properties 2013-05-22 16:41:30 +0000 +++ dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module.properties 2013-05-28 14:37:50 +0000 @@ -115,3 +115,5 @@ low_to_high=Low to high high_to_low=High to low top_limit=Top limit +plain_data_sources=Plain data sources +graphics=Graphics \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module_fr_FR.properties' --- dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module_fr_FR.properties 2013-05-28 10:10:21 +0000 +++ dhis-2/dhis-web/dhis-web-pivot/src/main/resources/org/hisp/dhis/pivot/i18n_module_fr_FR.properties 2013-05-28 14:37:50 +0000 @@ -111,3 +111,5 @@ options=Options download=T\u00E9l\u00E9charger favorites=Favoris +plain_data_sources=Sources de donn\u00E9es simples +graphics=Graphique === added file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_datasource.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_datasource.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_datasource.png 2013-05-28 14:43:39 +0000 differ === added file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_image.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_image.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_image.png 2013-05-28 14:43:39 +0000 differ === added file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_tablelayout.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_tablelayout.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/dl_tablelayout.png 2013-05-28 14:43:39 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/exportimage.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/exportimage.png 2013-01-17 16:06:38 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/exportimage.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/pdf.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/pdf.png 2013-01-17 16:06:38 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/pdf.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/pdf2.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/pdf2.png 2013-01-17 16:06:38 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/pdf2.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/png.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/png.png 2013-01-17 16:06:38 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/png.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/png2.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/png2.png 2013-01-17 16:06:38 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/png2.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/refresh.png' Binary files dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/refresh.png 2013-01-17 16:06:38 +0000 and dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/images/refresh.png 1970-01-01 00:00:00 +0000 differ === 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 2013-05-28 09:57:43 +0000 +++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/app.js 2013-05-28 14:43:39 +0000 @@ -3570,74 +3570,73 @@ disabled: true, menu: { cls: 'pt-menu', - width: 140, shadow: false, showSeparator: false, items: [ { xtype: 'label', - text: 'Table layout', + text: PT.i18n.table_layout, style: 'padding:7px 5px 5px 7px; font-weight:bold' }, { text: 'Microsoft Excel (.xls)', - iconCls: 'pt-menu-item-xls', + iconCls: 'pt-menu-item-tablelayout', handler: function() { openTableLayoutTab('xls'); } }, { text: 'CSV (.csv)', - iconCls: 'pt-menu-item-xls', + iconCls: 'pt-menu-item-tablelayout', handler: function() { openTableLayoutTab('csv'); } }, { text: 'HTML (.html)', - iconCls: 'pt-menu-item-xls', + iconCls: 'pt-menu-item-tablelayout', handler: function() { openTableLayoutTab('html', true); } }, { xtype: 'label', - text: 'Plain data source', + text: PT.i18n.plain_data_sources, style: 'padding:7px 5px 5px 7px; font-weight:bold' }, { text: 'JSON', - iconCls: 'pt-menu-item-csv', + iconCls: 'pt-menu-item-datasource', handler: function() { if (pt.baseUrl && pt.paramString) { - window.open(pt.baseUrl + '/api/analytics.json' + pt.util.pivot.getParamString(pt.xLayout), '_blank'); + window.open(pt.baseUrl + '/api/analytics.json' + pt.util.pivot.getParamString(pt.xLayout, true), '_blank'); } } }, { text: 'XML', - iconCls: 'pt-menu-item-csv', + iconCls: 'pt-menu-item-datasource', handler: function() { if (pt.baseUrl && pt.paramString) { - window.open(pt.baseUrl + '/api/analytics.xml' + pt.util.pivot.getParamString(pt.xLayout), '_blank'); + window.open(pt.baseUrl + '/api/analytics.xml' + pt.util.pivot.getParamString(pt.xLayout, true), '_blank'); } } }, { text: 'Microsoft Excel', - iconCls: 'pt-menu-item-xls', + iconCls: 'pt-menu-item-datasource', handler: function() { if (pt.baseUrl && pt.paramString) { - window.location.href = pt.baseUrl + '/api/analytics.xls' + pt.util.pivot.getParamString(pt.xLayout); + window.location.href = pt.baseUrl + '/api/analytics.xls' + pt.util.pivot.getParamString(pt.xLayout, true); } } }, { text: 'CSV', - iconCls: 'pt-menu-item-csv', + iconCls: 'pt-menu-item-datasource', handler: function() { if (pt.baseUrl && pt.paramString) { - window.location.href = pt.baseUrl + '/api/analytics.csv' + pt.util.pivot.getParamString(pt.xLayout); + window.location.href = pt.baseUrl + '/api/analytics.csv' + pt.util.pivot.getParamString(pt.xLayout, true); } } } === modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js' --- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js 2013-05-28 09:57:43 +0000 +++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/scripts/core.js 2013-05-28 15:59:59 +0000 @@ -818,6 +818,7 @@ isUserOrgunitChildren = xOuDimension && Ext.Array.contains(xOuDimension.ids, 'USER_ORGUNIT_CHILDREN'), co = dimConf.category.objectName, ou = dimConf.organisationUnit.objectName, + layout; // Set items from init/metaData/xLayout @@ -854,9 +855,12 @@ } } - // Remove co from layout if it does not exist in response - if (Ext.Array.contains(xLayout.axisDimensionNames, co) && !(Ext.Array.contains(headerNames, co))) { - removeDimensionFromXLayout(co); + // Remove dimensions from layout that do not exist in response + for (var i = 0, dimensionName; i < xLayout.axisDimensionNames.length; i++) { + dimensionName = xLayout.axisDimensionNames[i]; + if (!Ext.Array.contains(headerNames, dimensionName)) { + removeDimensionFromXLayout(dimensionName); + } } layout = pt.api.layout.Layout(xLayout); === modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/styles/style.css' --- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/styles/style.css 2013-05-27 19:06:21 +0000 +++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/app/styles/style.css 2013-05-28 14:43:39 +0000 @@ -474,12 +474,16 @@ *--------------------------------------------------------------------------*/ /* Menu item icon */ -.pt-menu-item-xls { - background-image:url('../images/pdf.png'); - padding-left: 18px; -} -.pt-menu-item-csv { - background-image:url('../images/pdf.png'); +.pt-menu-item-image { + background-image:url('../images/dl_image.png'); + padding-left: 18px; +} +.pt-menu-item-tablelayout { + background-image:url('../images/dl_tablelayout.png'); + padding-left: 18px; +} +.pt-menu-item-datasource { + background-image:url('../images/dl_datasource.png'); padding-left: 18px; } === modified file 'dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/i18n.vm' --- dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/i18n.vm 2013-05-22 16:41:30 +0000 +++ dhis-2/dhis-web/dhis-web-pivot/src/main/webapp/dhis-web-pivot/i18n.vm 2013-05-28 14:37:50 +0000 @@ -115,5 +115,7 @@ sort_order: '$encoder.jsEscape($i18n.getString( 'sort_order' ) , "'")', low_to_high: '$encoder.jsEscape($i18n.getString( 'low_to_high' ) , "'")', high_to_low: '$encoder.jsEscape($i18n.getString( 'high_to_low' ) , "'")', - top_limit: '$encoder.jsEscape($i18n.getString( 'top_limit' ) , "'")' + top_limit: '$encoder.jsEscape($i18n.getString( 'top_limit' ) , "'")', + plain_data_sources: '$encoder.jsEscape($i18n.getString( 'plain_data_sources' ) , "'")', + graphics: '$encoder.jsEscape($i18n.getString( 'graphics' ) , "'")' }; === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties 2013-05-23 16:34:57 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module.properties 2013-05-28 14:37:50 +0000 @@ -68,7 +68,7 @@ overwrite=Overwrite download=Download no_svg_format=No SVG format -image_png=Image (PNG) +image_png=Image hide_data_table=Hide data table saving=Saving renaming=Renaming @@ -191,4 +191,6 @@ can_edit_and_view=Can edit and view search_for_user_groups=Search for user group public_access=Public access -detailed_data_elements_cannot_be_specified_as_filter=Detailed data elements cannot be specified as filter \ No newline at end of file +detailed_data_elements_cannot_be_specified_as_filter=Detailed data elements cannot be specified as filter +plain_data_sources=Plain data sources +graphics=Graphics \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module_fr_FR.properties' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module_fr_FR.properties 2013-05-13 14:00:23 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/resources/org/hisp/dhis/visualizer/i18n_module_fr_FR.properties 2013-05-28 14:37:50 +0000 @@ -51,7 +51,7 @@ column_chart=Histogramme rename=Renommer datasets=Les ensembles de donn\u00E9es -image_png=Image (PNG) +image_png=Image wm_targetline_deactivated=Ligne cible d\u00E9sactiv\u00E9e base=Base wm_first_filter_unit=Premi\u00E8re unit\u00E9 de filtre utilis\u00E9 (plus que celui choisi). @@ -171,4 +171,6 @@ can_edit_and_view=Peut modifier et voir can_view=Peut voir add_new=Ajouter nouveau -create=Cr\u00E9er \ No newline at end of file +create=Cr\u00E9er +plain_data_sources=Sources de donn\u00E9es simples +graphics=Graphique \ No newline at end of file === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css 2013-05-01 11:49:52 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/css/style.css 2013-05-28 14:37:50 +0000 @@ -745,12 +745,12 @@ *--------------------------------------------------------------------------*/ /* Menu item icon */ -.dv-menu-item-data { - background-image:url('../images/pdf.png'); - padding-left: 18px; -} .dv-menu-item-image { - background-image:url('../images/png.png'); + background-image:url('../images/dl_image.png'); + padding-left: 18px; +} +.dv-menu-item-datasource { + background-image:url('../images/dl_datasource.png'); padding-left: 18px; } === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/datatable2.png' Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/datatable2.png 2011-12-16 15:12:55 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/datatable2.png 1970-01-01 00:00:00 +0000 differ === renamed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/pdf.png' => 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/dl_datasource.png' === renamed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/png.png' => 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/dl_image.png' === added file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/dl_tablelayout.png' Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/dl_tablelayout.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/dl_tablelayout.png 2013-05-28 14:43:39 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/pdf2.png' Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/pdf2.png 2011-12-16 15:12:55 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/pdf2.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/png2.png' Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/png2.png 2011-12-16 15:12:55 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/png2.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/refresh.png' Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/refresh.png 2011-10-03 15:17:06 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/refresh.png 1970-01-01 00:00:00 +0000 differ === removed file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/reporttable.png' Binary files dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/reporttable.png 2011-11-29 16:43:52 +0000 and dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/images/reporttable.png 1970-01-01 00:00:00 +0000 differ === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2013-05-27 20:01:15 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/app.js 2013-05-28 14:37:50 +0000 @@ -3940,57 +3940,66 @@ disabled: true, menu: { cls: 'dv-menu', - width: 105, shadow: false, showSeparator: false, items: [ { - text: DV.i18n.image_png, + xtype: 'label', + text: DV.i18n.graphics, + style: 'padding:7px 5px 5px 7px; font-weight:bold' + }, + { + text: DV.i18n.image_png + ' (.png)', iconCls: 'dv-menu-item-image', handler: function() { dv.util.chart.submitSvgForm('png'); } }, { - text: 'PDF', + text: 'PDF (.pdf)', iconCls: 'dv-menu-item-image', handler: function() { dv.util.chart.submitSvgForm('pdf'); } }, { - text: 'Excel (XLS)', - iconCls: 'dv-menu-item-data', - handler: function() { - if (dv.baseUrl && dv.paramString) { - window.location.href = dv.baseUrl + '/api/analytics.xls' + dv.paramString; - } - } - }, - { - text: 'CSV', - iconCls: 'dv-menu-item-data', - handler: function() { - if (dv.baseUrl && dv.paramString) { - window.location.href = dv.baseUrl + '/api/analytics.csv' + dv.paramString; - } - } + xtype: 'label', + text: DV.i18n.plain_data_sources, + style: 'padding:7px 5px 5px 7px; font-weight:bold' }, { text: 'JSON', - iconCls: 'dv-menu-item-data', + iconCls: 'dv-menu-item-datasource', handler: function() { if (dv.baseUrl && dv.paramString) { - window.open(dv.baseUrl + '/api/analytics.json' + dv.paramString); + window.open(dv.baseUrl + '/api/analytics.json' + dv.util.chart.getParamString(dv.xLayout, true)); } } }, { text: 'XML', - iconCls: 'dv-menu-item-data', - handler: function() { - if (dv.baseUrl && dv.paramString) { - window.open(dv.baseUrl + '/api/analytics.xml' + dv.paramString); + iconCls: 'dv-menu-item-datasource', + handler: function() { + if (dv.baseUrl && dv.paramString) { + window.open(dv.baseUrl + '/api/analytics.xml' + dv.util.chart.getParamString(dv.xLayout, true)); + } + } + }, + { + text: 'Microsoft Excel', + iconCls: 'dv-menu-item-datasource', + handler: function() { + if (dv.baseUrl && dv.paramString) { + window.location.href = dv.baseUrl + '/api/analytics.xls' + dv.util.chart.getParamString(dv.xLayout, true); + } + } + }, + { + text: 'CSV', + iconCls: 'dv-menu-item-datasource', + handler: function() { + if (dv.baseUrl && dv.paramString) { + window.location.href = dv.baseUrl + '/api/analytics.csv' + dv.util.chart.getParamString(dv.xLayout, true); } } } === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js 2013-05-27 19:02:40 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/scripts/core.js 2013-05-28 14:37:50 +0000 @@ -623,10 +623,63 @@ return xLayout; }, + getParamString: function(xLayout, isSorted) { + var axisDimensionNames = isSorted ? xLayout.sortedAxisDimensionNames : xLayout.axisDimensionNames, + filterDimensions = isSorted ? xLayout.sortedFilterDimensions : xLayout.filterDimensions, + dimensionNameIdsMap = isSorted ? xLayout.dimensionNameSortedIdsMap : xLayout.dimensionNameIdsMap, + paramString = '?', + dimConf = dv.conf.finals.dimension, + addCategoryDimension = false, + map = xLayout.dimensionNameItemsMap, + dx = dimConf.indicator.dimensionName; + + for (var i = 0, dimName, items; i < axisDimensionNames.length; i++) { + dimName = axisDimensionNames[i]; + + paramString += 'dimension=' + dimName; + + items = Ext.clone(dimensionNameIdsMap[dimName]); + + if (dimName === dx) { + for (var j = 0, index; j < items.length; j++) { + index = items[j].indexOf('-'); + + if (index > 0) { + addCategoryDimension = true; + items[j] = items[j].substr(0, index); + } + } + + items = Ext.Array.unique(items); + } + + if (dimName !== dimConf.category.dimensionName) { + paramString += ':' + items.join(';'); + } + + if (i < (axisDimensionNames.length - 1)) { + paramString += '&'; + } + } + + if (addCategoryDimension) { + paramString += '&dimension=' + dv.conf.finals.dimension.category.dimensionName; + } + + if (Ext.isArray(filterDimensions) && filterDimensions.length) { + for (var i = 0, dim; i < filterDimensions.length; i++) { + dim = filterDimensions[i]; + + paramString += '&filter=' + dim.dimensionName + ':' + dim.ids.join(';'); + } + } + + return paramString; + }, + createChart: function(layout, dv) { var dimConf = dv.conf.finals.dimension, getSyncronizedXLayout, - getParamString, getExtendedResponse, getDefaultStore, getDefaultNumericAxis, @@ -642,60 +695,6 @@ generator = {}, initialize; - getParamString = function(xLayout) { - var sortedAxisDimensionNames = xLayout.sortedAxisDimensionNames, - sortedFilterDimensions = xLayout.sortedFilterDimensions, - dimensionNameSortedIdsMap = xLayout.dimensionNameSortedIdsMap, - paramString = '?', - dimConf = dv.conf.finals.dimension, - addCategoryDimension = false, - map = xLayout.dimensionNameItemsMap, - dx = dimConf.indicator.dimensionName; - - for (var i = 0, dimName, items; i < sortedAxisDimensionNames.length; i++) { - dimName = sortedAxisDimensionNames[i]; - - paramString += 'dimension=' + dimName; - - items = Ext.clone(dimensionNameSortedIdsMap[dimName]); - - if (dimName === dx) { - for (var j = 0, index; j < items.length; j++) { - index = items[j].indexOf('-'); - - if (index > 0) { - addCategoryDimension = true; - items[j] = items[j].substr(0, index); - } - } - - items = Ext.Array.unique(items); - } - - if (dimName !== dimConf.category.dimensionName) { - paramString += ':' + items.join(';'); - } - - if (i < (sortedAxisDimensionNames.length - 1)) { - paramString += '&'; - } - } - - if (addCategoryDimension) { - paramString += '&dimension=' + dv.conf.finals.dimension.category.dimensionName; - } - - if (Ext.isArray(sortedFilterDimensions) && sortedFilterDimensions.length) { - for (var i = 0, dim; i < sortedFilterDimensions.length; i++) { - dim = sortedFilterDimensions[i]; - - paramString += '&filter=' + dim.dimensionName + ':' + dim.ids.join(';'); - } - } - - return paramString; - }; - getSyncronizedXLayout = function(xLayout, response) { var dimensions = [].concat(xLayout.columns, xLayout.rows, xLayout.filters), xOuDimension = xLayout.objectNameDimensionsMap[dimConf.organisationUnit.objectName], @@ -1656,9 +1655,9 @@ xResponse, chart; - xLayout = dv.util.chart.getExtendedLayout(layout); + xLayout = util.chart.getExtendedLayout(layout); - dv.paramString = getParamString(xLayout); + dv.paramString = util.chart.getParamString(xLayout, true); url = dv.init.contextPath + '/api/analytics.json' + dv.paramString; if (!validateUrl(url)) { === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/i18n.vm' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/i18n.vm 2013-05-23 16:34:57 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/i18n.vm 2013-05-28 14:37:50 +0000 @@ -191,5 +191,7 @@ can_edit_and_view: '$encoder.jsEscape($i18n.getString( 'can_edit_and_view' ) , "'")', search_for_user_groups: '$encoder.jsEscape($i18n.getString( 'search_for_user_groups' ) , "'")', public_access: '$encoder.jsEscape($i18n.getString( 'public_access' ) , "'")', - detailed_data_elements_cannot_be_specified_as_filter: '$encoder.jsEscape($i18n.getString( 'detailed_data_elements_cannot_be_specified_as_filter' ) , "'")' + detailed_data_elements_cannot_be_specified_as_filter: '$encoder.jsEscape($i18n.getString( 'detailed_data_elements_cannot_be_specified_as_filter' ) , "'")', + plain_data_sources: '$encoder.jsEscape($i18n.getString( 'plain_data_sources' ) , "'")', + graphics: '$encoder.jsEscape($i18n.getString( 'graphics' ) , "'")' };