← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1603: Cannot put the plus character in report item and excel item name

 

------------------------------------------------------------
revno: 1603
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2010-03-10 10:08:56 +0700
message:
  Cannot put the plus character in report item and excel item name
modified:
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/excelitemgroups.js
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/excelitems.js
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reportItem.js
  dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reports.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-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/excelitemgroups.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/excelitemgroups.js	2010-02-23 04:26:05 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/excelitemgroups.js	2010-03-10 03:08:56 +0000
@@ -77,17 +77,13 @@
 
 function addExcelItemGroup() {
 	
-	var request = new Request();
-	request.setResponseTypeXML( 'xmlObject' );
-	request.setCallbackSuccess( addExcelItemGroupReceived );
-	
-	var params = "name=" + byId('name').value;
-		params += "&type=" + byId('type').value;
-		params += "&periodTypeName=" + byId('periodType').value;
-	
-	request.sendAsPost(params);
-	request.send("addExcelItemGroup.action");
-	
+	$.post("addExcelItemGroup.action",{
+		name:$("#name").val(),	
+		type:$("#type").val(),			
+		periodTypeName:$("#periodType").val()
+	}, function (data){
+		window.location.reload();
+	},'xml');
 }
 
 function addExcelItemGroupReceived() {
@@ -97,17 +93,14 @@
 
 function updateExcelItemGroup() {
 	
-	var request = new Request();
-	request.setResponseTypeXML( 'xmlObject' );
-	request.setCallbackSuccess( addExcelItemGroupReceived );
-	
-	var params = "id=" + byId('id').value;
-		params += "&name=" + byId('name').value;
-		params += "&type=" + byId('type').value
-		params += "&periodTypeName=" + byId('periodType').value;
-	
-	request.sendAsPost(params);
-	request.send( "updateExcelItemGroup.action" );
+	$.post("updateExcelItemGroup.action",{
+		id:$("#id").val(),
+		name:$("#name").val(),
+		type:$("#type").val(),			
+		periodTypeName:$("#periodType").val()
+	}, function (data){
+		window.location.reload();
+	},'xml');
 }
 
 // --------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/excelitems.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/excelitems.js	2010-02-24 02:22:13 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/excelitems.js	2010-03-10 03:08:56 +0000
@@ -50,6 +50,7 @@
 	var request = new Request();
 	request.setResponseTypeXML( 'message' );
 	request.setCallbackSuccess( validateAddExcelItemReceived );	
+	
 	var params = "name=" + byId("name").value;
 	params += "&expression=" + byId("expression").value;
 	params += "&row=" + byId("row").value;
@@ -57,9 +58,7 @@
 	params += "&sheetNo=" + byId("sheetNo").value;
 	params += "&excelItemGroupId=" + byId( "excelItemGroupId" ).value; 
 	
-	
 	request.sendAsPost( params );
-	
 	request.send( "validateExcelItem.action" );	
 	
 }
@@ -121,7 +120,7 @@
 
 function addExcelItem() {
 	
-	var request = new Request();
+	/* var request = new Request();
 	request.setResponseTypeXML( 'datalement' );
 	request.setCallbackSuccess( Completed );
 	var params = "name=" + byId("name").value;	
@@ -131,7 +130,19 @@
 	params += "&sheetNo=" + byId("sheetNo").value; 
 	params += "&excelItemGroupId=" + byId( "excelItemGroupId" ).value; 
 	request.sendAsPost( params );
-	request.send( "addExcelItem.action" );
+	request.send( "addExcelItem.action" ); */
+	
+	$.post("addExcelItem.action",{
+		name:$("#name").val(),		
+		expression:$("#expression").val(),
+		row:$("#row").val(),	
+		column:$("#column").val(),		
+		sheetNo:byId("sheetNo").value,
+		excelItemGroupId:byId("excelItemGroupId").value
+		
+	}, function (data){
+		window.location.reload();
+	},'xml');
 }
 
 function Completed( xmlObject ) {
@@ -144,20 +155,19 @@
 // ========================================================================================================================
 
 function updateExcelItem() {
-	
-	var request = new Request();
-	request.setResponseTypeXML( 'datalement' );
-	request.setCallbackSuccess( Completed );
-	
-	var params = "id=" + byId("id").value; 
-	params += "&name=" + byId("name").value;	
-	params += "&expression=" + byId("expression").value; 
-	params += "&row=" + byId("row").value; 
-	params += "&column=" + byId("column").value; 
-	params += "&sheetNo=" + byId("sheetNo").value; 
-	params += "&excelItemGroupId=" + byId( "excelItemGroupId" ).value; 
-	request.sendAsPost( params );
-	request.send( "updateExcelItem.action" );	
+
+	$.post("updateExcelItem.action",{
+		id:$("#id").val(),	
+		name:$("#name").val(),		
+		expression:$("#expression").val(),
+		row:$("#row").val(),	
+		column:$("#column").val(),		
+		sheetNo:byId("sheetNo").value,
+		excelItemGroupId:byId("excelItemGroupId").value
+		
+	}, function (data){
+		window.location.reload();
+	},'xml');
 	
 }
 // ===============================================================================

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reportItem.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reportItem.js	2010-03-04 05:58:44 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reportItem.js	2010-03-10 03:08:56 +0000
@@ -150,36 +150,19 @@
 	
 function addReportExcelItem() {
 	
-	/*$.post("addReportExcelItem.action",{
+	$.post("addReportExcelItem.action",{
 		name:$("#name").val(),		
 		expression:$("#expression").val(),
 		row:$("#row").val(),
-		column:$("#column").val(),		
+		column:$("#column").val(),	
+		sheetNo:$("#sheetNo").val(),		
 		reportId:reportId,
 		itemType:$("#itemType").val(),
 		periodType:$("#periodType").val(),
-		sheetNo:$("#sheetNo").val()
+		
 	}, function (data){
 		window.location.reload();
 	},'xml');
-	*/
-	
-	var request = new Request();
-	request.setResponseTypeXML( 'xmlObject' );
-	request.setCallbackSuccess( validateAddReportExcelItemReceived );
-	
-	var params = "name=" + byId("name").value;
-	params += "&expression=" + byId("expression").value;
-	params += "&row=" + byId("row").value;
-	params += "&column=" + byId("column").value;
-	params += "&sheetNo=" + byId("sheetNo").value;
-	params += "&reportId=" + byId("reportId").value;
-	params += "&itemType=" + byId("itemType").value;
-	params += "&periodType=" + byId("periodType").value;
-	
-	
-	//request.sendAsPost(params);
-	request.send( "addReportExcelItem.action?" + params);
 	
 }
 

=== modified file 'dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reports.js'
--- dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reports.js	2010-02-25 02:41:20 +0000
+++ dhis-2/dhis-web/dhis-web-excel-reporting/src/main/webapp/dhis-web-excel-reporting/javascript/reports.js	2010-03-10 03:08:56 +0000
@@ -61,21 +61,19 @@
 */
 function addReportExcel() {	
 	
-	var request = new Request();
-	request.setResponseTypeXML( 'datalement' );
-	request.setCallbackSuccess( Completed );
-	
-	var params = "name=" + byId("name").value;
-		params += "&excel=" + byId("excelTemplateFile").value;
-		params += "&reportType=" + byId("reportType").value;
-		params += "&periodRow=" + byId("periodRow").value;
-		params += "&periodCol=" + byId("periodColumn").value;
-		params += "&organisationRow=" + byId("organisationRow").value;
-		params += "&organisationCol=" + byId("organisationColumn").value;
-		params += "&group=" + byId("group").value;
-	
-	request.sendAsPost(params);
-	request.send( "addReportExcel.action" );	
+	$.post("addReportExcel.action",{
+		name:$("#name").val(),		
+		excel:$("#excelTemplateFile").val(),
+		reportType:$("#reportType").val(),
+		periodRow:$("#periodRow").val(),	
+		periodCol:$("#periodColumn").val(),		
+		organisationRow:byId("organisationRow").value,
+		organisationCol:byId("organisationColumn").value,
+		group:$("#group").val()
+		
+	}, function (data){
+		window.location.reload();
+	},'xml');
 	
 }
 
@@ -157,22 +155,21 @@
 }
 
 function updateReportExcel() {
-	
-	var request = new Request();
-	request.setResponseTypeXML( 'datalement' );
-	request.setCallbackSuccess( Completed );
-	
-	var params = "id=" + reportId;
-		params += "&name=" + byId("name").value;
-		params += "&excel=" + byId("excelTemplateFile").value;
-		params += "&periodRow=" + byId("periodRow").value;
-		params += "&periodCol=" + byId("periodColumn").value;
-		params += "&organisationRow=" + byId("organisationRow").value;
-		params += "&organisationCol=" + byId("organisationColumn").value;
-		params += "&group=" + byId("group").value;
-	
-	request.sendAsPost(params);
-	request.send( "updateReportExcel.action" );
+
+	$.post("updateReportExcel.action",{
+		id:reportId,	
+		name:$("#name").val(),		
+		excel:$("#excelTemplateFile").val(),
+		periodRow:$("#periodRow").val(),	
+		periodCol:$("#periodColumn").val(),		
+		organisationRow:byId("organisationRow").value,
+		organisationCol:byId("organisationColumn").value,
+		group:$("#group").val()
+		
+	}, function (data){
+		window.location.reload();
+	},'xml');
+	
 
 }