← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12473: minor style changes

 

------------------------------------------------------------
revno: 12473
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-10-07 15:25:04 +0200
message:
  minor style changes
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.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/javascript/activityPlan.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2013-10-07 13:22:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/activityPlan.js	2013-10-07 13:25:04 +0000
@@ -54,7 +54,7 @@
     }
 
     searchTexts += "_false_" + getFieldValue('statusEvent');
-		
+
 	showLoader();
 
     jQuery('#listPatientDiv').load('getActivityPlanRecords.action', {
@@ -71,57 +71,54 @@
 
 function exportActitityList( type )
 {
-	var facilityLB = $('input[name=facilityLB]:checked').val();
-	
-	var params  = "programId=" + getFieldValue('programIdAddPatient');
-	params += "&type=xls";
-	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 url = "getActivityPlanRecords.action?" + params;
-	window.location.href = url;
+    var facilityLB = $('input[name=facilityLB]:checked').val();
+    var params = "programId=" + getFieldValue('programIdAddPatient');
+
+    params += "&type=xls";
+    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');
+    window.location.href = "getActivityPlanRecords.action?" + params;
 }
 
 // --------------------------------------------------------------------
 // Patient program tracking
 // --------------------------------------------------------------------
 
-function loadDataEntryDialog( programStageInstanceId, programStageUid ) 
+function loadDataEntryDialog( programStageInstanceId, programStageUid )
 {
-	jQuery('[id=programStageInstanceId]').val(programStageInstanceId);
-	jQuery('.stage-object-selected').attr('psuid',programStageUid);
-	$('#contentDataRecord' ).load("viewProgramStageRecords.action",
-		{
-			programStageInstanceId: programStageInstanceId
-		}, function(){
-			jQuery('#programStageUid').val(programStageUid);
-			showById('reportDateDiv');
-			showById('patientInforTB');
-			showById('entryForm');
-			showById('inputCriteriaDiv');
-		}).dialog(
-		{
-			title:i18n_program_stage,
-			maximize:true, 
-			closable:true,
-			modal:false,
-			overlay:{background:'#000000', opacity:0.1},
-			width:850,
-			height:500
-		});
+    jQuery('[id=programStageInstanceId]').val(programStageInstanceId);
+    jQuery('.stage-object-selected').attr('psuid', programStageUid);
+
+    $('#contentDataRecord' ).load("viewProgramStageRecords.action", {
+        programStageInstanceId: programStageInstanceId
+    }, function() {
+        jQuery('#programStageUid').val(programStageUid);
+        showById('reportDateDiv');
+        showById('patientInforTB');
+        showById('entryForm');
+        showById('inputCriteriaDiv');
+    }).dialog({
+        title:i18n_program_stage,
+        maximize:true,
+        closable:true,
+        modal:false,
+        overlay:{background:'#000000', opacity:0.1},
+        width:850,
+        height:500
+    });
 }
 
 
@@ -130,9 +127,9 @@
 	if( !byId('useCalendar').checked )
 	{
 		var statusEvent = getFieldValue("statusEvent");
-		
-		if( statusEvent == '1_2_3_4' 
-			|| statusEvent == '3_4' 
+
+		if( statusEvent == '1_2_3_4'
+			|| statusEvent == '3_4'
 			|| statusEvent == '2_3_4' ){
 			enable('showEventSince');
 			enable('showEventUpTo');
@@ -158,24 +155,26 @@
 	var d = date.getDate();
 	var m = date.getMonth();
 	var y= date.getFullYear();
-	
+
 	var startDateSince = "";
 	var endDateSince = "";
 	var startDateUpTo = "";
 	var endDateUpTo = "";
 	var startDate = "";
 	var endDate = "";
-		
+
 	// Get dateRangeSince
 	var days = getFieldValue('showEventSince');
-	if( days == 'ALL'){
-		startDateSince = jQuery.datepicker.formatDate( dateFormat, new Date(y-100, m, d) ) ;
-	}
-	else{
-		startDateSince = jQuery.datepicker.formatDate( dateFormat, new Date(y, m, d + eval(days)) ) ;
-	}
-	endDateSince = jQuery.datepicker.formatDate( dateFormat, new Date() );
-	
+
+    if( days == 'ALL' ) {
+        startDateSince = jQuery.datepicker.formatDate(dateFormat, new Date(y - 100, m, d));
+    }
+    else {
+        startDateSince = jQuery.datepicker.formatDate(dateFormat, new Date(y, m, d + eval(days)));
+    }
+
+    endDateSince = jQuery.datepicker.formatDate( dateFormat, new Date() );
+
 	// getDateRangeUpTo
 	days = getFieldValue('showEventUpTo');
 	startDateUpTo = jQuery.datepicker.formatDate( dateFormat, new Date() );
@@ -188,49 +187,49 @@
 	}
 
 	// check status to get date-range
-	if( statusEvent == '1_2_3_4' 
-		|| statusEvent == '3_4' 
-		|| statusEvent == '2_3_4')
-	{
-		startDate = startDateSince;
-		endDate = endDateUpTo;
-	
-	}else if (statusEvent=='3'){
-		startDate = startDateUpTo;
-		endDate = endDateUpTo;
-	}
-	else
-	{
-		startDate = startDateSince;
-		endDate = endDateSince;
-	}
-	
-	jQuery("#startDueDate").val(startDate);
+    if( statusEvent == '1_2_3_4'
+        || statusEvent == '3_4'
+        || statusEvent == '2_3_4' ) {
+        startDate = startDateSince;
+        endDate = endDateUpTo;
+
+    } else if( statusEvent == '3' ) {
+        startDate = startDateUpTo;
+        endDate = endDateUpTo;
+    }
+    else {
+        startDate = startDateSince;
+        endDate = endDateSince;
+    }
+
+    jQuery("#startDueDate").val(startDate);
 	jQuery("#endDueDate").val(endDate);
 }
 
 function setDateRangeUpTo( days )
 {
-	if(days == "")
-		return;
-		
-	var date = new Date();
-	var d = date.getDate();
-	var m = date.getMonth();
-	var y= date.getFullYear();
-	
-	var startDate = jQuery.datepicker.formatDate( dateFormat, new Date() );
-	var endDate = "";
-	if( days == 'ALL'){
-		endDate = jQuery.datepicker.formatDate( dateFormat, new Date(y+100, m, d) ) ;
-	}
-	else{
-		d = d + eval(days);
-		endDate = jQuery.datepicker.formatDate( dateFormat, new Date(y, m, d) ) ;
-	}
-	
-	jQuery("#startDueDate").val(startDate);
-	jQuery("#endDueDate").val(endDate);
+    if( days == "" ) {
+        return;
+    }
+
+    var date = new Date();
+    var d = date.getDate();
+    var m = date.getMonth();
+    var y = date.getFullYear();
+
+    var startDate = jQuery.datepicker.formatDate(dateFormat, new Date());
+    var endDate = "";
+
+    if( days == 'ALL' ) {
+        endDate = jQuery.datepicker.formatDate(dateFormat, new Date(y + 100, m, d));
+    }
+    else {
+        d = d + eval(days);
+        endDate = jQuery.datepicker.formatDate(dateFormat, new Date(y, m, d));
+    }
+
+    jQuery("#startDueDate").val(startDate);
+    jQuery("#endDueDate").val(endDate);
 }
 
 function setDateRangeAll()