=== modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml' --- dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml 2010-08-05 15:15:06 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml 2010-08-06 14:48:16 +0000 @@ -384,8 +384,8 @@ /dhis-web-mapping/polygonShapefile.vm - + application/json inputStream === modified file 'dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js' --- dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2010-08-05 12:55:57 +0000 +++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js 2010-08-05 16:20:28 +0000 @@ -644,20 +644,32 @@ cls: 'window-button', text: i18n_export_excel, handler: function() { - if (ACTIVEPANEL == thematicMap - && Ext.getCmp('period_cb').getValue()!='' - && Ext.getCmp('indicator_cb').getValue()!='' - && Ext.getCmp('map_cb').getValue()!='') { - - var title = Ext.getCmp('exportexceltitle_ft').getValue(); - var svg = document.getElementById('OpenLayers.Layer.Vector_17').innerHTML; - var includeLegend = Ext.getCmp('exportexcelincludelegend_chb').getValue(); - var includeValues = Ext.getCmp('exportexcelincludevalue_chb').getValue(); - var period = Ext.getCmp('period_cb').getValue(); - var indicator = Ext.getCmp('indicator_cb').getValue(); - - Ext.getCmp('exportexceltitle_ft').clearValue(); - + var indicatorOrDataElement, period, mapOrOrganisationUnit; + if (ACTIVEPANEL == thematicMap) { + indicatorOrDataElement = Ext.getCmp('mapvaluetype_cb').getValue() == map_value_type_indicator ? + Ext.getCmp('indicator_cb').getValue() : Ext.getCmp('dataelement_cb').getValue(); + period = Ext.getCmp('period_cb').getValue(); + mapOrOrganisationUnit = MAPSOURCE == map_source_type_database ? + Ext.getCmp('map_tf').getValue() : Ext.getCmp('map_cb').getValue(); + } + else if (ACTIVEPANEL == thematicMap2) { + indicatorOrDataElement = Ext.getCmp('mapvaluetype_cb2').getValue() == map_value_type_indicator ? + Ext.getCmp('indicator_cb2').getValue() : Ext.getCmp('dataelement_cb2').getValue(); + period = Ext.getCmp('period_cb2').getValue(); + mapOrOrganisationUnit = MAPSOURCE == map_source_type_database ? + Ext.getCmp('map_tf2').getValue() : Ext.getCmp('map_cb2').getValue(); + } + + if (indicatorOrDataElement && period && mapOrOrganisationUnit) { + var title = Ext.getCmp('exportexceltitle_ft').getValue(); + var svg = document.getElementById('OpenLayers.Layer.Vector_17').innerHTML; + var includeLegend = Ext.getCmp('exportexcelincludelegend_chb').getValue(); + var includeValues = Ext.getCmp('exportexcelincludevalue_chb').getValue(); + var period = Ext.getCmp('period_cb').getValue(); + var indicator = Ext.getCmp('indicator_cb').getValue(); + + Ext.getCmp('exportexceltitle_ft').clearValue(); + var exportForm = document.getElementById('exportForm'); exportForm.action = '../exportExcel.action'; @@ -673,10 +685,10 @@ document.getElementById('dataValuesField').value = EXPORTVALUES; exportForm.submit(); - } - else { - Ext.message.msg(false, i18n_please_render_map_fist ); - } + } + else { + Ext.message.msg(false, i18n_please_render_map_fist ); + } } } ]