← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10374: Set default from-date field in anonymous entry form as one week back from current date.

 

------------------------------------------------------------
revno: 10374
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-03-21 15:01:27 +0700
message:
  Set default from-date field in anonymous entry form as one week back from current date.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.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-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2013-03-07 13:46:43 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/anonymousRegistration.vm	2013-03-21 08:01:27 +0000
@@ -186,4 +186,13 @@
 	var searchTextBox = '<input type="text" id="searchText" name="searchText">';	
 	setInnerHTML('reportDateDescriptionField', jQuery('#programId option:selected').attr('reportDateDes'));
 	setInnerHTML('reportDateDescriptionField2', jQuery('#programId option:selected').attr('reportDateDes'));
+	
+	var date = new Date();
+	var d = date.getDate();
+	var m = date.getMonth();
+	var y= date.getFullYear();
+		
+	var	startDateSince = jQuery.datepicker.formatDate( dateFormat, new Date(y, m, d-7) ) ;
+	setFieldValue('startDate', startDateSince);
+	
 </script>
\ No newline at end of file

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2013-03-21 04:51:21 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2013-03-21 08:01:27 +0000
@@ -61,7 +61,6 @@
 		{
 			programId:programId,
 			listAll:false,
-			searchBySelectedOrgunit: false,
 			searchTexts: searchTexts
 		}, 
 		function()
@@ -75,16 +74,26 @@
 
 function exportActitityList( type )
 {
+	var facilityLB = $('input[name=facilityLB]:checked').val();
+	
 	var params  = "programId=" + getFieldValue('programIdAddPatient');
-	params += "&startDate=" + getFieldValue('startDueDate');
-	params += "&endDue=" + getFieldValue('endDueDate');
 	params += "&type=xls";
-	params += "&facilityLB=" + $('input[name=facilityLB]:checked').val();
+	params += "&searchTexts=stat_" + getFieldValue('programIdAddPatient')
+					+ "_" + getFieldValue('startDueDate')
+					+ "_" + getFieldValue('endDueDate');
+	if(facilityLB=='selected')
+	{
+		params += "_" + getFieldValue('orgunitId');
+	}
+	else if(facilityLB=='all')
+	{
+		params += "_0";
+	}
+	else if(facilityLB=='childrenOnly'){
+		params += "_-1";
+	}
+	params += "_false_" + getFieldValue('statusEvent');
 	
-	var statusEvent = getFieldValue('statusEvent').split('_');
-	for( var i in statusEvent){
-		params += "&statusList=" + statusEvent[i];
-	}
 	var url = "getActivityPlanRecords.action?" + params;
 	window.location.href = url;
 }

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js	2013-03-21 04:37:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/multiDataEntry.js	2013-03-21 08:01:27 +0000
@@ -80,7 +80,6 @@
 		{
 			programId:programId,
 			listAll:false,
-			searchBySelectedOrgunit: false,
 			searchTexts: searchTexts
 		}, 
 		function()

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2013-03-05 11:36:12 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/smsReminder.js	2013-03-21 08:01:27 +0000
@@ -66,7 +66,6 @@
 		{
 			programId:programId,
 			listAll:false,
-			searchBySelectedOrgunit: false,
 			searchTexts: searchTexts
 		}, 
 		function()