=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties' --- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties 2012-02-08 15:15:18 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module.properties 2012-03-27 14:58:33 +0000 @@ -298,3 +298,5 @@ no_values_found=No values found close=Close boundary_layer=Boundary layer +legend_symbolizer=Symbolizer +image=Image === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module_fr_FR.properties' --- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module_fr_FR.properties 2012-03-08 08:08:46 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/org/hisp/dhis/mapping/i18n_module_fr_FR.properties 2012-03-27 14:58:33 +0000 @@ -298,3 +298,5 @@ no_values_found=Aucune valeur trouv\u00e9e close=Fermer boundary_layer=Couche fronti\u00e8re +legend_symbolizer=Symbolisant +image=Image === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedValuesPluginAction.java' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedValuesPluginAction.java 2011-12-26 10:07:59 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/java/org/hisp/dhis/visualizer/action/GetAggregatedValuesPluginAction.java 2012-03-27 14:58:12 +0000 @@ -177,6 +177,18 @@ { this.last5Years = last5Years; } + + public String callback; + + public String getCallback() + { + return callback; + } + + public void setCallback( String callback ) + { + this.callback = callback; + } // ------------------------------------------------------------------------- // Output === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html 2011-12-25 15:40:58 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.html 2012-03-27 14:58:12 +0000 @@ -1,10 +1,9 @@ - - - - - + + + + @@ -17,7 +16,7 @@ === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js 2011-12-21 23:16:44 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/app/plugin/plugin.js 2012-03-27 15:30:24 +0000 @@ -2,7 +2,7 @@ DHIS.conf = { finals: { ajax: { - data_get: 'dhis-web-visualizer/app/getAggregatedValuesPlugin.action', + data_get: 'dhis-web-visualizer/getAggregatedValuesPlugin.action', favorite_get: 'api/charts/' }, dimension: { @@ -278,8 +278,7 @@ } }, value: { - jsonfy: function(r) { - r = Ext.JSON.decode(r.responseText); + jsonfy: function(r) { var object = { values: [], periods: r.p @@ -386,28 +385,28 @@ }, setState: function(conf) { if (conf.uid) { - Ext.Ajax.request({ - url: conf.url + DHIS.conf.finals.ajax.favorite_get + conf.uid + '.json', + Ext.data.JsonP.request({ + url: conf.url + DHIS.conf.finals.ajax.favorite_get + conf.uid + '.jsonp', scope: this, success: function(r) { - if (!r.responseText) { + if (!r) { alert('Invalid uid'); return; } - var f = Ext.JSON.decode(r.responseText); - conf.type = f.type.toLowerCase(); - conf.periods = DHIS.util.dimension.period.getRelativesFromObject(f.relativePeriods); - conf.organisationunits = DHIS.util.dimension.organisationunit.getIdsFromObjects(f.organisationUnits); - conf.series = f.series.toLowerCase(); - conf.category = f.category.toLowerCase(); - conf.filter = f.filter.toLowerCase(); + + conf.type = r.type.toLowerCase(); + conf.periods = DHIS.util.dimension.period.getRelativesFromObject(r.relativePeriods); + conf.organisationunits = DHIS.util.dimension.organisationunit.getIdsFromObjects(r.organisationUnits); + conf.series = r.series.toLowerCase(); + conf.category = r.category.toLowerCase(); + conf.filter = r.filter.toLowerCase(); conf.legendPosition = conf.legendPosition || false; - if (f.indicators) { - conf.indicators = DHIS.util.dimension.indicator.getIdsFromObjects(f.indicators); + if (r.indicators) { + conf.indicators = DHIS.util.dimension.indicator.getIdsFromObjects(r.indicators); } - if (f.dataelements) { - conf.dataelements = DHIS.util.dimension.dataelement.getIdsFromObjects(f.dataelements); + if (r.dataelements) { + conf.dataelements = DHIS.util.dimension.dataelement.getIdsFromObjects(r.dataelements); } this.getState(conf); @@ -429,7 +428,7 @@ baseUrl = Ext.String.urlAppend(baseUrl, item); }); - Ext.Ajax.request({ + Ext.data.JsonP.request({ url: baseUrl, success: function(r) { var json = DHIS.util.value.jsonfy(r); === modified file 'dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValuesPlugin.vm' --- dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValuesPlugin.vm 2011-12-21 19:42:20 +0000 +++ dhis-2/dhis-web/dhis-web-visualizer/src/main/webapp/dhis-web-visualizer/jsonminAggregatedValuesPlugin.vm 2012-03-27 15:30:24 +0000 @@ -1,1 +1,2 @@ -#set( $indicatorSize = $indicatorValues.size() )#set( $dataSize = $dataValues.size() )#set( $periodSize = $periods.size() ){"v":[#if( $indicatorSize > 0 )#foreach( $iv in $indicatorValues )["$!{iv.value}","$!{iv.indicatorName}","$!{iv.periodName}","$!{iv.organisationUnitName}"]#if( $velocityCount < $indicatorSize ),#end#end#end#if( $dataSize > 0 )#if( $indicatorSize > 0 ),#end#foreach( $dv in $dataValues )["$!{dv.value}","$!{dv.dataElementName}","$!{dv.periodName}","$!{dv.organisationUnitName}"]#if( $velocityCount < $dataSize ),#end#end#end],"p":[#foreach($p in $periods)"$!encoder.jsonEncode(${p.name})"#if($velocityCount<$periodSize),#end#end]} \ No newline at end of file +#set( $indicatorSize = $indicatorValues.size() )#set( $dataSize = $dataValues.size() )#set( $periodSize = $periods.size() ) +${callback}({"v":[#if( $indicatorSize > 0 )#foreach( $iv in $indicatorValues )["$!{iv.value}","$!{iv.indicatorName}","$!{iv.periodName}","$!{iv.organisationUnitName}"]#if( $velocityCount < $indicatorSize ),#end#end#end#if( $dataSize > 0 )#if( $indicatorSize > 0 ),#end#foreach( $dv in $dataValues )["$!{dv.value}","$!{dv.dataElementName}","$!{dv.periodName}","$!{dv.organisationUnitName}"]#if( $velocityCount < $dataSize ),#end#end#end],"p":[#foreach($p in $periods)"$!encoder.jsonEncode(${p.name})"#if($velocityCount<$periodSize),#end#end]}) \ No newline at end of file