← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1745: (GIS) Legend registration bug fixed.

 

Merge authors:
  Jan Henrik Øverland (janhenrik-overland)
------------------------------------------------------------
revno: 1745 [merge]
committer: Jan Henrik Overland <janhenrik.overland@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-04-07 15:54:53 +0200
message:
  (GIS) Legend registration bug fixed.
modified:
  dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddOrUpdateMapLegendAction.java
  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/java/org/hisp/dhis/mapping/action/AddOrUpdateMapLegendAction.java'
--- dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddOrUpdateMapLegendAction.java	2010-03-25 15:27:40 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/java/org/hisp/dhis/mapping/action/AddOrUpdateMapLegendAction.java	2010-04-07 13:54:53 +0000
@@ -48,10 +48,6 @@
         this.mappingService = mappingService;
     }
 
-    
-
-    
-    
     // -------------------------------------------------------------------------
     // Input
     // -------------------------------------------------------------------------
@@ -63,16 +59,16 @@
         this.name = name;
     }
 
-    private Double startValue;
+    private String startValue;
     
-    public void setStartValue( Double startValue )
+    public void setStartValue( String startValue )
     {
         this.startValue = startValue;
     }
 
-    private Double endValue;
+    private String endValue;
     
-    public void setEndValue( Double endValue )
+    public void setEndValue( String endValue )
     {
         this.endValue = endValue;
     }
@@ -90,7 +86,7 @@
 
     public String execute()
     {
-        this.mappingService.addOrUpdateMapLegend( this.name, this.startValue, this.endValue, this.color );
+        this.mappingService.addOrUpdateMapLegend( name, Double.parseDouble( startValue ), Double.parseDouble( endValue ), color );
 
         return SUCCESS;
     }

=== 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-04-07 11:24:18 +0000
+++ dhis-2/dhis-web/dhis-web-mapping/src/main/webapp/dhis-web-mapping/mapping/script/index.js	2010-04-07 13:54:53 +0000
@@ -595,13 +595,12 @@
         [
 			{
 				xtype: 'textfield',
-				id: 'export_image_title',
+				id: 'exportimagetitle_tf',
 				fieldLabel: 'Image title',
 				labelSeparator: labelseparator,
 				editable: true,
 				valueField: 'id',
 				displayField: 'text',
-				emptyText: 'Image title',
 				isFormField: true,
 				width: combo_width_fieldset,
 				minListWidth: combo_list_width_fieldset,
@@ -610,7 +609,7 @@
 			},
 			{
 				xtype: 'combo',
-				id: 'export_image_quality',
+				id: 'exportimagequality_cb',
 				fieldLabel: 'Image quality',
 				labelSeparator: labelseparator,
 				editable: false,
@@ -629,7 +628,7 @@
 			},
 			{
 				xtype: 'checkbox',
-				id: 'export_image_include_legend',
+				id: 'exportimageincludelegend_chb',
 				fieldLabel: 'Include legend',
 				labelSeparator: '',				
 				isFormField: true,
@@ -637,7 +636,7 @@
 			},
 			{
 				xtype: 'button',
-                id: 'export_image_button',
+                id: 'exportimage_b',
 				isFormField: true,
 				labelSeparator: labelseparator,
 				hideLabel: false,
@@ -648,17 +647,19 @@
 						&& Ext.getCmp('period_cb').getValue()!='' 
 						&& Ext.getCmp('indicator_cb').getValue()!=''
 						&& Ext.getCmp('map_cb').getValue()!='') {
-					
+						
 						var svg = document.getElementById('OpenLayers.Layer.Vector_17').innerHTML;
 						var objectSVGDocument = document.getElementById('OpenLayers.Layer.Vector_17').childNodes[0];
 						var viewBox = objectSVGDocument.getAttribute('viewBox');
-						var title = Ext.getCmp('export_image_title').getValue();
-						var q = Ext.getCmp('export_image_quality').getValue();
+						var title = Ext.getCmp('exportimagetitle_tf').getValue();
+						var q = Ext.getCmp('exportimagequality_cb').getValue();
 						var w = objectSVGDocument.getAttribute('width') * q;
 						var h = objectSVGDocument.getAttribute('height') * q;
-						var includeLegend = Ext.getCmp('export_image_include_legend').getValue();
+						var includeLegend = Ext.getCmp('exportimageincludelegend_chb').getValue();
 						var period = Ext.getCmp('period_cb').getValue();
 						var indicator = Ext.getCmp('indicator_cb').getValue();
+						
+						Ext.getCmp('exportimagetitle_tf').reset();
                         
                         var exportForm = document.getElementById('exportForm');
                         exportForm.action = '../exportImage.action';
@@ -690,13 +691,12 @@
         [
 			{
 				xtype: 'textfield',
-				id: 'export_excel_title',
+				id: 'exportexceltitle_ft',
 				fieldLabel: 'Map title',
 				labelSeparator: labelseparator,
 				editable: true,
 				valueField: 'id',
 				displayField: 'text',
-				emptyText: 'Map title',
 				isFormField: true,
 				width: combo_width_fieldset,
 				minListWidth: combo_list_width_fieldset,
@@ -705,7 +705,7 @@
 			},	
 			{
 				xtype: 'checkbox',
-				id: 'export_excel_include_legend',
+				id: 'exportexcelincludelegend_chb',
 				fieldLabel: 'Include legend',
 				labelSeparator: '',
 				isFormField: true,
@@ -713,7 +713,7 @@
 			},	
 			{
 				xtype: 'checkbox',
-				id: 'export_excel_include_value',
+				id: 'exportexcelincludevalue_chb',
 				fieldLabel: 'Include values',
 				labelSeparator: '',
 				isFormField: true,
@@ -721,7 +721,7 @@
 			},
 			{
 				xtype: 'button',
-                id: 'export_excel_button',
+                id: 'exportexcel_b',
 				isFormField: true,
 				labelSeparator: labelseparator,
 				hideLabel: false,
@@ -732,13 +732,15 @@
 						&& Ext.getCmp('period_cb').getValue()!='' 
 						&& Ext.getCmp('indicator_cb').getValue()!=''
 						&& Ext.getCmp('map_cb').getValue()!='') {
-						
-						var title = Ext.getCmp('export_excel_title').getValue();
+												
+						var title = Ext.getCmp('exportexceltitle_ft').getValue();
 						var svg = document.getElementById('OpenLayers.Layer.Vector_17').innerHTML;	
-						var includeLegend = Ext.getCmp('export_excel_include_legend').getValue();
-						var includeValues = Ext.getCmp('export_excel_include_value').getValue();
+						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();	
+						var indicator = Ext.getCmp('indicator_cb').getValue();
+						
+						Ext.getCmp('exportexceltitle_ft').reset();
 											
                         var exportForm = document.getElementById('exportForm');
                         exportForm.action = '../exportExcel.action';