← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10187: Fix bug in case-based tabular report.

 

------------------------------------------------------------
revno: 10187
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-03-14 01:38:19 +0700
message:
  Fix bug in case-based tabular report.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js
  dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm


--
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/app/app.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-03-13 17:24:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-03-13 18:38:19 +0000
@@ -514,6 +514,7 @@
 					var fixedId = id.substring(0, id.lastIndexOf('_') );
 					params.typeAhead = true;
 					params.forceSelection = true;
+					params.hideValue = true;
 					if( valueType == 'bool' || fixedId=='fixedAttr_gender' || fixedId=='fixedAttr_dobType')
 					{
 						params.queryMode = 'local';
@@ -524,7 +525,7 @@
 						{
 							params.store = new Ext.data.ArrayStore({
 								fields: ['value', 'name'],
-								data: [['', TR.i18n.please_select], 
+								data: [['', TR.i18n.filter_value], 
 									['M', TR.i18n.male], 
 									['F', TR.i18n.female],
 									['T', TR.i18n.transgender]]
@@ -534,7 +535,7 @@
 						{
 							params.store = new Ext.data.ArrayStore({
 								fields: ['value', 'name'],
-								data: [['', TR.i18n.please_select],
+								data: [['', TR.i18n.filter_value],
 									['V', TR.i18n.verified], 
 									['D', TR.i18n.declared],
 									['A', TR.i18n.approximated]]
@@ -544,7 +545,7 @@
 						{
 							params.store = new Ext.data.ArrayStore({
 								fields: ['value', 'name'],
-								data: [['', TR.i18n.please_select], 
+								data: [['', TR.i18n.filter_value], 
 									['true', TR.i18n.yes], 
 									['false', TR.i18n.no]]
 							});
@@ -558,7 +559,7 @@
 						params.editable = false;
 						params.store = new Ext.data.ArrayStore({
 							fields: ['value', 'name'],
-							data: [['', TR.i18n.please_select],['true', TR.i18n.yes]]
+							data: [['', TR.i18n.filter_value],['true', TR.i18n.yes]]
 						});
 					}
 					else if(valueType=='username'){
@@ -1716,8 +1717,10 @@
 				p.orgunitIds = TR.state.orgunitIds;
 				p.userOrganisationUnit = Ext.getCmp('userOrgunit').getValue();
 				p.userOrganisationUnitChildren = Ext.getCmp('userOrgunitChildren').getValue();
-				p.useCompletedEvents = Ext.getCmp('completedEventsOpt').getValue();
-				
+				if( Ext.getCmp('completedEventsOpt').getValue() =='true')
+				{
+					p.useCompletedEvents = Ext.getCmp('completedEventsOpt').getValue();
+				}
 				// Get searching values
 				p.searchingValues = [];
 				
@@ -1769,13 +1772,24 @@
 					for(var idx=0;idx<length;idx++)
 					{
 						var id = deId + '_' + idx;
-						var filterValue = Ext.getCmp('filter_' + id).rawValue;
-						if(filterValue==null || filterValue==TR.i18n.please_select)
+						
+						var filterField = Ext.getCmp('filter_' + id);
+						var filterValue = "";
+						if( filterField.hideValue = true )
 						{
-							filterValue = Ext.getCmp('filter_' + id).getValue();
-						}
-						var filter = deId + '_' + hidden 
+							var values = Ext.getCmp('filter_' + id).getValue();
+							for( var i in values ){
+								filterValue += values[i] + ";";
+							}
+							filterValue = filterValue.substring(0,filterValue.length - 1  );
+						}
+						else{
+							filterValue = filterField.rawValue;
+						}
+						
+						var filter = deId + '_' + hidden + '_';
 						if( filterValue!='' ){
+							filterValue = filterValue.toLowerCase();
 							var filterOpt = Ext.getCmp('filter_opt_' + id).rawValue;
 							filter += '_' + filterOpt + ' ';
 							if( filterOpt == 'IN' )
@@ -1810,7 +1824,14 @@
 				document.getElementById('programStageId').value = TR.cmp.params.programStage.getValue();				
 				document.getElementById('userOrganisationUnit').value = Ext.getCmp('userOrgunit').getValue();
 				document.getElementById('userOrganisationUnitChildren').value = Ext.getCmp('userOrgunitChildren').getValue();
-				document.getElementById('useCompletedEvents').value = Ext.getCmp('completedEventsOpt').getValue();
+				if( Ext.getCmp('completedEventsOpt').getValue() =='true')
+				{
+					document.getElementById('useCompletedEvents').value = 'true';
+				}
+				else
+				{
+					document.getElementById('useCompletedEvents').value = '';
+				}
 
 				// orgunits
 				var orgunitIdList = document.getElementById('orgunitIds');
@@ -1868,13 +1889,24 @@
 					for(var idx=0;idx<length;idx++)
 					{
 						var id = deId + '_' + idx;
-						var filterValue = Ext.getCmp('filter_' + id).rawValue;
-						if(filterValue==null || filterValue==TR.i18n.please_select)
+						
+						var filterField = Ext.getCmp('filter_' + id);
+						var filterValue = "";
+						if( filterField.hideValue = true )
 						{
-							filterValue = Ext.getCmp('filter_' + id).getValue();
-						}
-						var filter = deId + '_' + hidden 
+							var values = Ext.getCmp('filter_' + id).getValue();
+							for( var i in values ){
+								filterValue += values[i] + ";";
+							}
+							filterValue = filterValue.substring(0,filterValue.length - 1  );
+						}
+						else{
+							filterValue = filterField.rawValue;
+						}
+						
+						var filter = deId + '_' + hidden + '_';
 						if( filterValue!=''){
+							filterValue = filterValue.toLowerCase();
 							var filterOpt = Ext.getCmp('filter_opt_' + id).rawValue;
 							filter += '_' + filterOpt + ' ';
 						
@@ -2127,11 +2159,21 @@
 					{
 						var id = deId + '_' + idx;
 						var filterOpt = Ext.getCmp('filter_opt_' + id).rawValue;
-						var filterValue = Ext.getCmp('filter_' + id).rawValue;
-						if(filterValue==null || filterValue==TR.i18n.please_select)
+						
+						var filterField = Ext.getCmp('filter_' + id);
+						var filterValue = "";
+						if( filterField.hideValue = true )
 						{
-							filterValue = Ext.getCmp('filter_' + id).getValue();
-						}
+							var values = Ext.getCmp('filter_' + id).getValue();
+							for( var i in values ){
+								filterValue += values[i] + ";";
+							}
+							filterValue = filterValue.substring(0,filterValue.length - 1  );
+						}
+						else{
+							filterValue = filterField.rawValue;
+						}
+						
 						var filter = deId.split('_')[1] + "_" + filterOpt + '_';
 					
 						if( filterValue!=TR.i18n.please_select)
@@ -2183,7 +2225,10 @@
 				
 				p.facilityLB = TR.cmp.settings.facilityLB.getValue();
 				p.position = position;
-				p.useCompletedEvents = Ext.getCmp('completedEventsOpt').getValue();
+				if( Ext.getCmp('completedEventsOpt').getValue() =='true')
+				{
+					p.useCompletedEvents = Ext.getCmp('completedEventsOpt').getValue();
+				}
 				
 				return p;
 			},
@@ -2194,7 +2239,15 @@
 				document.getElementById('userOrganisationUnitChildren').value = Ext.getCmp('userOrgunitChildren').getValue();
 				document.getElementById('facilityLB').value = TR.cmp.settings.facilityLB.getValue();
 				document.getElementById('position').value = TR.state.aggregateReport.getPosition();
-				document.getElementById('useCompletedEvents').value = Ext.getCmp('completedEventsOpt').getValue();
+				if( Ext.getCmp('completedEventsOpt').getValue() =='true')
+				{
+					document.getElementById('useCompletedEvents').value = true;
+				}
+				else
+				{
+					document.getElementById('useCompletedEvents').value = '';
+				}
+				
 				if( Ext.getCmp('dataElementGroupByCbx').getValue() != null 
 					&& Ext.getCmp('dataElementGroupByCbx').getValue() != '' ){
 					document.getElementById('deGroupBy').value = Ext.getCmp('dataElementGroupByCbx').getValue().split('_')[1];
@@ -2238,11 +2291,21 @@
 					{
 						var id = deId + '_' + idx;
 						var filterOpt = Ext.getCmp('filter_opt_' + id).rawValue;
-						var filterValue = Ext.getCmp('filter_' + id).rawValue;
-						if(filterValue==null || filterValue==TR.i18n.please_select)
+						
+						var filterField = Ext.getCmp('filter_' + id);
+						var filterValue = "";
+						if( filterField.hideValue = true )
 						{
-							filterValue = Ext.getCmp('filter_' + id).getValue();
-						}
+							var values = Ext.getCmp('filter_' + id).getValue();
+							for( var i in values ){
+								filterValue += values[i] + ";";
+							}
+							filterValue = filterValue.substring(0,filterValue.length - 1  );
+						}
+						else{
+							filterValue = filterField.rawValue;
+						}
+						
 						var filter = deId.split('_')[1] + "_" + filterOpt + '_';
 					
 						if(filterValue!=TR.i18n.please_select)

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm	2013-03-05 14:47:06 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/cacheManifest.vm	2013-03-13 18:38:19 +0000
@@ -1,5 +1,5 @@
 CACHE MANIFEST
-# 2.11-SNAPSHOT V28
+# 2.11-SNAPSHOT V30
 NETWORK:
 *
 CACHE:

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2013-02-25 03:05:26 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/javascript/anonymousRegistration.js	2013-03-13 18:38:19 +0000
@@ -373,7 +373,7 @@
 		var input = jQuery( item );
 		params += '&searchingValues=de_' + input.val() + '_false_';
 	});
-
+	
 	if(listAll){
 		params += '&startDate=';
 		params += '&endDate=';
@@ -404,8 +404,8 @@
 
 				if( value !=''){
 					searchingValue += getValueFormula(value);
+					params += '&searchingValues=' + searchingValue;
 				}
-				params += '&searchingValues=' + searchingValue;
 				searchingValue = '';
 				value = '';
 			}

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm	2013-03-13 17:24:42 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/programStageInstancesList.vm	2013-03-13 18:38:19 +0000
@@ -24,15 +24,14 @@
 			<table class="listTable">
 				<thead>
 					<tr>
-						<th>#</th>
-						#set($noCols = $grid.getHeaders().size() )
-						#set($metaData = $noCols - $valueTypes.size() )
+						<th># </th>
 						#set($index = 0)
+						#set( $noHeader = $grid.getHeaders().size() )
+						#set( $metaData = $noHeader - $valueTypes.size() - 3 )
 						#foreach( $col in $grid.getHeaders() )
-							#if($index < $noCols - 2 )
-								#if( $index==1 || $index > $metaData )
-									<th>$col.name</th>
-								#end
+							#if( $index == 1 
+								|| ( $index > $metaData && $index < $noHeader - 2 ))
+								<th>$col.name</th>
 							#end
 							#set($index = $index + 1)
 						#end
@@ -54,7 +53,8 @@
 									#set($psid = $col)
 								#elseif($velocityCount == $noCols - 1)
 									#set($completed = $col)
-								#elseif( $index==1 || $index > $metaData )
+								#elseif( $index == 1 
+									|| ( $index > $metaData && $index < $noHeader - 2 ))
 									<td>$!col</td>
 								#end
 								#set($index = $index + 1)