← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1906: (GIS) Excel form validation improved.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 1906 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: trunk
timestamp: Fri 2010-08-06 16:48:16 +0200
message:
  (GIS) Excel form validation improved.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.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-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 @@
 			<result name="MultiPolygon" type="velocity-json">/dhis-web-mapping/polygonShapefile.vm</result>
 		</action>
 
-		<action name="getGeoJsonFile" 
-			class="org.hisp.dhis.mapping.action.GetGeoJsonAction">
+		<action name="getGeoJsonFromFile"
+            class="org.hisp.dhis.mapping.action.GetGeoJsonAction">
 			<result name="success" type="stream">
 				<param name="contentType">application/json</param>
 				<param name="inputName">inputStream</param>

=== 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 );
+                    }
 				}
 			}	
 		]