← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6012: remove request object from local/in

 

------------------------------------------------------------
revno: 6012
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2012-02-17 12:45:15 +0530
message:
  remove request object from local/in
modified:
  local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/javascript/bulkSMS.js
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/autolldataagg.js
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/form.js
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/history.js
  local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/multidimensional.js
  local/in/dhis-web-excelimport/src/main/webapp/dhis-web-excelimport/javascript/reports.js
  local/in/dhis-web-maintenance-in/src/main/webapp/dhis-web-maintenance-in/javascript/config.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 'local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/javascript/bulkSMS.js'
--- local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/javascript/bulkSMS.js	2011-06-17 10:06:08 +0000
+++ local/in/dhis-mobile/dhis-web-mobile/src/main/webapp/dhis-web-mobile/javascript/bulkSMS.js	2012-02-17 07:15:15 +0000
@@ -16,7 +16,6 @@
     
    
 }
-
 //
 function checkCheckBox() {
     if (document.theForm.texttype.checked == false)

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/autolldataagg.js'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/autolldataagg.js	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/autolldataagg.js	2012-02-17 07:15:15 +0000
@@ -2,16 +2,27 @@
 function getOUDetails(orgUnitIds)
 {
 	//var url = "getOrgUnitDetails.action?orgUnitId=" + orgUnitIds;
-	
+	/*
 	var request = new Request();
 	request.setResponseTypeXML( 'orgunit' );
 	request.setCallbackSuccess( getOUDetailsRecevied );
-	//request.send( url );
-    
+	
     var requestString = "getOrgUnitDetails.action";
     var params = "orgUnitId=" + orgUnitIds;
     request.sendAsPost( params );
     request.send( requestString );
+    */
+	$.post("getOrgUnitDetails.action",
+			{
+				orgUnitId : orgUnitIds[0]
+			},
+			function (data)
+			{
+				getOUDetailsRecevied(data);
+			},'xml');
+
+    
+    
 }
 
 function getOUDetailsRecevied(xmlObject)

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/form.js'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/form.js	2010-09-08 12:56:29 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/form.js	2012-02-17 07:15:15 +0000
@@ -369,7 +369,8 @@
 {
     this.save = function()
     {
-        var request = new Request();
+       /*
+    	var request = new Request();
         request.setCallbackSuccess( handleResponse );
         request.setCallbackError( handleHttpError );
         request.setResponseTypeXML( 'minmax' );
@@ -377,6 +378,16 @@
 
         var requestString = "minMaxGeneration.action";
         request.send( requestString );
+        */
+    	$.post("minMaxGeneration.action",
+    			{
+    		
+    			},
+    			function (data)
+    			{
+    				handleResponse(data);
+    				//handleHttpError(data);
+    			},'xml');
 
     };
     

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js	2011-11-04 08:03:14 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/general.js	2012-02-17 07:15:15 +0000
@@ -2643,7 +2643,8 @@
     
     this.save = function()
     {
-        var request = new Request();
+        /*
+    	var request = new Request();
         request.setCallbackSuccess( handleResponse );
         request.setCallbackError( handleHttpError );
         request.setResponseTypeXML( 'status' );
@@ -2653,6 +2654,17 @@
         var params = 'dataElementId=' + dataElementId + '&value=' + value;
         request.sendAsPost( params );
         request.send( requestString );
+        */
+    	$.post("saveValue.action",
+    			{
+    				dataElementId : dataElementId,
+    				value : value
+    			},
+    			function (data)
+    			{
+    				handleResponse(data);
+    				//handleHttpError(data);
+    			},'xml');
     };
     
     function handleResponse( rootElement )
@@ -2725,7 +2737,8 @@
     
     this.save = function()
     {
-        var request = new Request();
+        /*
+    	var request = new Request();
         request.setCallbackSuccess( handleResponse );
         request.setCallbackError( handleHttpError );
         request.setResponseTypeXML( 'status' );
@@ -2735,6 +2748,17 @@
         var params = 'dataElementId=' + dataElementId + '&value=' + value;
         request.sendAsPost( params );
         request.send( requestString );
+        */
+    	$.post("saveComment.action",
+    			{
+    				dataElementId : dataElementId,
+    				comment : value
+    			},
+    			function (data)
+    			{
+    				handleResponse(data);
+    				//handleHttpError(data);
+    			},'xml');
     };
     
     function handleResponse( rootElement )
@@ -2855,7 +2879,8 @@
 }
 
 function calculateAndSaveCDEs()
-{
+{	
+	/*
     var request = new Request();
     request.setCallbackSuccess( dataValuesReceived );
     request.setResponseTypeXML( 'dataValues' );
@@ -2863,6 +2888,17 @@
 
     var requestString = "calculateCDEs.action";
     request.send( requestString );
+    */
+	$.post("calculateCDEs.action",
+			{
+		
+			},
+			function (data)
+			{
+				dataValuesReceived(data);
+			},'xml');
+
+    
 }
 
 function dataValuesReceived( node )
@@ -2879,7 +2915,6 @@
     }
 }
 
-
 function showOverlay() {
     var o = document.getElementById('overlay');
     o.style.visibility = 'visible';
@@ -2898,6 +2933,7 @@
 function saveLineListingAggData()
 {
     showOverlay();
+    /*
     var request = new Request();
     request.setCallbackSuccess( saveLineListingAggDataReceived );
     request.setResponseTypeXML( 'dataValues' );
@@ -2905,6 +2941,16 @@
 
     var requestString = "saveLineListingAggData.action";
     request.send( requestString );
+    */
+	$.post("saveLineListingAggData.action",
+			{
+		
+			},
+			function (data)
+			{
+				saveLineListingAggDataReceived(data);
+			},'xml');
+    
 }
 
 function saveLineListingAggDataReceived( node )
@@ -2945,7 +2991,7 @@
 
     if ( result )
     {
-        //window.location.href = 'delLLRecord.action?recordId=' + nextRecordNo;
+       //window.location.href = 'delLLRecord.action?recordId=' + nextRecordNo;
         document.getElementById("recordId").value = nextRecordNo;
         document.delForm.submit();
     }

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/history.js'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/history.js	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/history.js	2012-02-17 07:15:15 +0000
@@ -84,11 +84,11 @@
 {
     var minLimitField = document.getElementById( "minLimit" );
     var maxLimitField = document.getElementById( "maxLimit" );
-
+    /*
     var request = new Request();
     request.setCallbackSuccess( refreshWindow );
     request.setCallbackError( refreshWindow );
-
+	*/
     var requestString;
     var params;
     
@@ -96,10 +96,26 @@
     if ( minLimitField.value == '' )
     {
         //request.send( 'removeMinMaxLimits.action?organisationUnitId=' + organisationUnitId + '&dataElementId=' + dataElementId );
+    	/*
         requestString = "removeMinMaxLimits.action";
         params = 'organisationUnitId=' + organisationUnitId + '&dataElementId=' + dataElementId;
         request.sendAsPost( params );
         request.send( requestString );
+        */
+        
+    	$.post("removeMinMaxLimits.action",
+    			{
+    				organisationUnitId : organisationUnitId,
+    				dataElementId : dataElementId
+    			},
+    			function (data)
+    			{
+    				refreshWindow(data);
+    				//refreshWindow(data);
+    			},'xml');
+        
+        
+        
     }
     else
     {
@@ -119,10 +135,24 @@
             }
 
             //request.send( 'saveMinMaxLimits.action?organisationUnitId=' + organisationUnitId + '&dataElementId=' + dataElementId + '&minLimit=' + minLimit + '&maxLimit=' + maxLimit );
-            requestString = "saveMinMaxLimits.action";
+            
+            /*requestString = "saveMinMaxLimits.action";
             params = 'organisationUnitId=' + organisationUnitId + '&dataElementId=' + dataElementId + '&minLimit=' + minLimit + '&maxLimit=' + maxLimit;
             request.sendAsPost( params );
             request.send( requestString );
+            */
+            
+        	$.post("saveMinMaxLimits.action",
+        			{
+        				organisationUnitId : organisationUnitId,
+        				dataElementId : dataElementId
+        			},
+        			function (data)
+        			{
+        				refreshWindow(data);
+        				//refreshWindow(data);
+        			},'xml');
+            
         }
         else
         {
@@ -135,20 +165,33 @@
 {
     var minLimitField = document.getElementById( "minLimit" );
     var maxLimitField = document.getElementById( "maxLimit" );
-
+    /*
     var request = new Request();
     request.setCallbackSuccess( refreshWindow );
     request.setCallbackError( refreshWindow );
     var requestString;
     var params;
-    
+    */
     if ( maxLimitField.value == '' )
     {
         //request.send( 'removeMinMaxLimits.action?organisationUnitId=' + organisationUnitId + '&dataElementId=' + dataElementId );
+        /*
         requestString = "removeMinMaxLimits.action";
         params = 'organisationUnitId=' + organisationUnitId + '&dataElementId=' + dataElementId;
         request.sendAsPost( params );
         request.send( requestString );
+        */
+    	$.post("removeMinMaxLimits.action",
+    			{
+    				organisationUnitId : organisationUnitId,
+    				dataElementId : dataElementId
+    			},
+    			function (data)
+    			{
+    				refreshWindow(data);
+    				//refreshWindow(data);
+    			},'xml');
+        
     }
     else
     {
@@ -172,10 +215,24 @@
             }
 
             //request.send( 'saveMinMaxLimits.action?organisationUnitId=' + organisationUnitId + '&dataElementId=' + dataElementId + '&minLimit=' + minLimit + '&maxLimit=' + maxLimit );
+           /*
             requestString = "saveMinMaxLimits.action";
             params = 'organisationUnitId=' + organisationUnitId + '&dataElementId=' + dataElementId + '&minLimit=' + minLimit + '&maxLimit=' + maxLimit;
             request.sendAsPost( params );
             request.send( requestString );
+            */
+            
+        	$.post("saveMinMaxLimits.action",
+        			{
+        				organisationUnitId : organisationUnitId,
+        				dataElementId : dataElementId
+        			},
+        			function (data)
+        			{
+        				refreshWindow(data);
+        				//refreshWindow(data);
+        			},'xml');
+            
         }
         else
         {

=== modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/multidimensional.js'
--- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/multidimensional.js	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/javascript/multidimensional.js	2012-02-17 07:15:15 +0000
@@ -184,7 +184,8 @@
     
     this.save = function()
     {
-        var request = new Request();
+    	/*
+    	var request = new Request();
         request.setCallbackSuccess( handleResponse );
         request.setCallbackError( handleHttpError );
         request.setResponseTypeXML( 'status' );
@@ -195,6 +196,20 @@
         var params = 'inputId=' + inputId + '&value=' + value;
         request.sendAsPost( params );
         request.send( requestString );
+        */
+    	$.post("saveMultiDimensionalValue.action",
+    			{
+    				inputId : inputId,
+    				value : value
+    			},
+    			function (data)
+    			{
+    				handleResponse(data);
+    				//handleHttpError(data);
+    			},'xml');
+        
+        
+        
 
     };
     
@@ -263,7 +278,8 @@
     
     this.save = function()
     {
-        var request = new Request();
+       /*
+    	var request = new Request();
         request.setCallbackSuccess( handleResponse );
         request.setCallbackError( handleHttpError );
         request.setResponseTypeXML( 'status' );
@@ -273,6 +289,28 @@
         var params = 'dataElementId=' + dataElementId + '&comment=' + value;
         request.sendAsPost( params );
         request.send( requestString );
+        */
+        /*
+        $.ajax({
+            url: url.action,
+            dataType: "xml",
+            success: ....,
+            error: .....
+        });
+    	*/
+    	
+    	
+    	
+    	$.post("saveComment.action",
+    			{
+    				dataElementId : dataElementId,
+    				comment : value
+    			},
+    			function (data)
+    			{
+    				handleResponse(data);
+    				//handleHttpError(data);
+    			},'xml');
     };
     
     function handleResponse( rootElement )
@@ -392,13 +430,25 @@
 
 function calculateAndSaveCDEs()
 {
-    var request = new Request();
+	/*
+	var request = new Request();
     request.setCallbackSuccess( dataValuesReceived );
     request.setResponseTypeXML( 'dataValues' );
     //request.send( 'calculateCDEs.action' );
 
     var requestString = "calculateCDEs.action";
     request.send( requestString );
+    */
+    
+	$.post("calculateCDEs.action",
+			{
+
+			},
+			function (data)
+			{
+				dataValuesReceived(data);
+			},'xml');
+    
 }
 
 function dataValuesReceived( node )

=== modified file 'local/in/dhis-web-excelimport/src/main/webapp/dhis-web-excelimport/javascript/reports.js'
--- local/in/dhis-web-excelimport/src/main/webapp/dhis-web-excelimport/javascript/reports.js	2011-01-18 12:01:24 +0000
+++ local/in/dhis-web-excelimport/src/main/webapp/dhis-web-excelimport/javascript/reports.js	2012-02-17 07:15:15 +0000
@@ -48,7 +48,8 @@
 			getDataElementsReceived(data);
 		},'xml');
     }
-}// getDataElements end           
+}
+// getDataElements end           
 
 function getDataElementsReceived( xmlObject )
 {
@@ -72,7 +73,8 @@
             availableDataElements.add(option, null);
         }
     }    
-}// getDataElementsReceived end
+}
+// getDataElementsReceived end
 
 //---------------------------------------------------------------
 // Get Periods 

=== modified file 'local/in/dhis-web-maintenance-in/src/main/webapp/dhis-web-maintenance-in/javascript/config.js'
--- local/in/dhis-web-maintenance-in/src/main/webapp/dhis-web-maintenance-in/javascript/config.js	2010-10-28 09:25:22 +0000
+++ local/in/dhis-web-maintenance-in/src/main/webapp/dhis-web-maintenance-in/javascript/config.js	2012-02-17 07:15:15 +0000
@@ -1,6 +1,7 @@
 
 function clearFolder( folderId )
 {
+	/*
 	var request = new Request();
 	request.setResponseTypeXML( 'message' );
 	request.setCallbackSuccess( clearFolderRecieved );
@@ -10,6 +11,16 @@
 	
 	request.sendAsPost( params );
 	request.send( requestString );
+	*/
+	$.post("clearFolder.action",
+			{
+				selectedButton : folderId
+			},
+			function (data)
+			{
+				clearFolderRecieved(data);
+			},'xml');
+	
 }
 
 function clearFolderRecieved( messageElement )