← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12591: Add filter options for data elements in tabular report.

 

------------------------------------------------------------
revno: 12591
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2013-10-11 20:49:41 +0700
message:
  Add filter options for data elements in tabular report.
modified:
  dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java
  dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties
  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/i18n.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/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java	2013-09-27 17:04:23 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/patient/GetPatientAction.java	2013-10-11 13:49:41 +0000
@@ -315,17 +315,8 @@
 
             for ( PatientAttributeValue patientAttributeValue : patientAttributeValues )
             {
-                if ( PatientAttribute.TYPE_COMBO.equalsIgnoreCase( patientAttributeValue.getPatientAttribute()
-                    .getValueType() ) )
-                {
-                    patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
-                        patientAttributeValue.getPatientAttributeOption().getName() );
-                }
-                else
-                {
-                    patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
+               patientAttributeValueMap.put( patientAttributeValue.getPatientAttribute().getId(),
                         patientAttributeValue.getValue() );
-                }
             }
         }
 

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-10-11 07:11:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties	2013-10-11 13:49:41 +0000
@@ -509,8 +509,8 @@
 filter_value = Filter value
 filter_values = Filter values
 fill_filter_values_for_all_selected_data_elements = Please fill filter values for all selected data elements
-data_filter = Data filters
-show_hide_filter_values = Show/hide filter values
+data_items = Data items
+show_hide_selected_values = Show/hide selected values
 use_completed_events = Use completed events
 date_period_range = Date period range
 select_from_date = Select from date
@@ -687,4 +687,6 @@
 orgunit_search_type = Orgunit search type
 selected_and_all_below = Selected and all below
 all_visible = All visible
-all_in_system = All in system
\ No newline at end of file
+all_in_system = All in system
+selected_items = Selected items
+dimension = Dimension
\ No newline at end of file

=== 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-10-11 09:33:54 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js	2013-10-11 13:49:41 +0000
@@ -141,7 +141,7 @@
         west_fill: 117,
         west_fill_accordion_organisationunit: 43,
         west_maxheight_accordion_organisationunit: 225,
-        center_tbar_height: 31,
+        center_tbar_height: 30,
         east_gridcolumn_height: 30,
         form_label_width: 90,
 		grid_row_height: 27,
@@ -152,7 +152,7 @@
 		window_record_width: 450,
 		window_record_height: 300,
 		west_dataelements_multiselect: 120,
-		west_dataelements_filter_panel: 130,
+		west_dataelements_filter_panel: 250,
 		west_dataelements_expand_filter_panel: 280,
 		west_dataelements_collapse_filter_panel: 130,
 		west_dataelements_expand_aggregate_filter_panel: 230,
@@ -448,7 +448,7 @@
 					xtype: 'label',
 					id: 'filter_lb_' + fieldid,
 					text:name,
-					width:(TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 60
+					width:(TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 100
 				};
 				
 				var opt = "";
@@ -463,6 +463,7 @@
 				items[2] = this.createFilterField(valueType, fieldid, filter);
 				if( idx == 0 ){
 					items[3] = this.addFieldBtn( p, id, name, valueType, idx );
+					items[4] = this.addFitlerOptionBox( p, id, name, valueType, idx );
 				}
 				else
 				{
@@ -551,7 +552,7 @@
 				params.id = 'filter_' + id;
 				params.cls = 'tr-textfield-alt1';
 				params.emptyText = TR.i18n.filter_value;
-				params.width = (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 50;
+				params.width = (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 80;
 				xtype = xtype.toLowerCase();
 				if( valueType=='GENDER'){
 					params.xtype = 'combobox';
@@ -676,6 +677,23 @@
 					Ext.getCmp(p).remove(e4);
 				}
 				return params;
+			},
+			addFitlerOptionBox: function( p, id ){
+				var params = {};
+				params.xtype = 'combobox';
+				params.id = 'filter_dimension_' + id;
+				params.width = 75;
+				params.queryMode = 'local';
+				params.valueField = 'value';
+				params.displayField = 'name';
+				params.editable = false;
+				params.store = new Ext.data.ArrayStore({
+						fields: ['value','name'],
+						data: [ ['dimension',TR.i18n.dimension],['filter',TR.i18n.filter] ]
+					});
+				params.value = 'dimension';
+				
+				return params;
 			}
         },
         positionFilter:{
@@ -1608,6 +1626,7 @@
 			// Get searching values
 			
 			p.dimension = [];
+			p.filter = [];
 			
 			// User orgunits
 			
@@ -1640,10 +1659,15 @@
 				var deId = r.data.id;
 				var length = Ext.getCmp('filterPanel_' + deId).items.length/4;
 				var hidden = TR.state.caseBasedReport.isColHidden(deId);
+				var dimensionOption = 'dimension';
 				
 				for(var idx=0;idx<length;idx++)
 				{
 					var id = deId + '_' + idx;
+					if( idx==0 )
+					{
+						dimensionOption = Ext.getCmp('filter_dimension_' + deId ).getValue();
+					}
 					
 					var filterOpt = Ext.getCmp('filter_opt_' + id).getValue();
 					var filterValue = Ext.getCmp('filter_' + id).rawValue.toLowerCase();;
@@ -1666,7 +1690,12 @@
 						}
 					}
 					
-					p.dimension.push( filter );
+					if( dimensionOption=='dimension' ){
+						p.dimension.push( filter );
+					}
+					else{
+						p.filter.push( filter );
+					}
 				}
 			});
 					
@@ -4290,19 +4319,19 @@
         layout: 'border',
         renderTo: Ext.getBody(),
         isrendered: false,
-        items: [
+		items: [
             {
                 region: 'west',
                 preventHeader: true,
                 collapsible: true,
                 collapseMode: 'mini',
                 items: [
-				{
-					xtype: 'toolbar',
-					style: 'padding-top:1px; border-style:none',
-					width: TR.conf.layout.west_fieldset_width + 50,
-					bodyStyle: 'border-style:none; background-color:transparent; padding:4px 0 0 8px',
-                    items: [
+					{
+						xtype: 'toolbar',
+						style: 'padding-top:1px; border-style:none;',
+						width: TR.conf.layout.west_fieldset_width + 50,
+						bodyStyle: 'border-style:none; background-color:transparent; padding:4px 0 0 8px',
+						items: [
 						{
 							xtype: 'panel',
 							bodyStyle: 'border-style:none; background-color:transparent; padding:10px 0 0 8px',
@@ -4480,16 +4509,16 @@
 					},                            
 					{
 						xtype: 'panel',
-                        bodyStyle: 'border-style:none; border-top:2px groove #eee; padding:10px 10px 0 10px;',
+                        bodyStyle: 'border-style:none; border-top:2px groove #eee; padding:2px 2px 0 2px;magrin-left:32px;',
                         layout: 'fit',
                         items: [
 							{
 								xtype: 'panel',
 								layout: 'accordion',
+								bodyStyle: 'border-style:none;',
 								activeOnTop: true,
 								cls: 'tr-accordion',
-								bodyStyle: 'border:0 none',
-								height: 475,
+								height: 554,
 								items: [
 							
 									// DATE-RANGE
@@ -4852,7 +4881,7 @@
 												fieldLabel: TR.i18n.orgunit_groups,
 												labelWidth: 135,
 												emptyText: TR.i18n.please_select,
-												width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor,
+												width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor + 28,
 												store: TR.store.orgunitGroup,
 												listeners: {
 													added: function() {
@@ -4908,7 +4937,7 @@
 												xtype: 'toolbar',
 												id: 'organisationunit_t',
 												style: 'margin-bottom: 5px',
-												width: TR.conf.layout.west_fieldset_width - 18,
+												width: TR.conf.layout.west_fieldset_width + 10,
 												xable: function(checked, value) {
 													if (checked || value) {
 														this.disable();
@@ -4993,7 +5022,7 @@
 												xtype: 'treepanel',
 												id: 'treeOrg',
 												cls: 'tr-tree',
-												width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor,
+												width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor + 28,
 												rootVisible: false,
 												autoScroll: true,
 												multiSelect: true,
@@ -5165,20 +5194,21 @@
 									
 									// DATA ELEMENTS
 									{
-										title: '<div id="dataElementTabTitle" style="height:17px;background-image:url(images/data.png); background-repeat:no-repeat; padding-left:20px;">' + TR.i18n.data_filter + '</div>',
+										title: '<div id="dataElementTabTitle" style="height:17px;background-image:url(images/data.png); background-repeat:no-repeat; padding-left:20px;">' + TR.i18n.data_items + '</div>',
 										hideCollapseTool: true,
 										items: [
 											{
 												xtype: 'combobox',
 												cls: 'tr-combo',
 												id: 'sectionCombobox',
+												style: 'magrin-left:2px;',
 												fieldLabel: TR.i18n.section,
 												emptyText: TR.i18n.please_select,
 												queryMode: 'local',
 												editable: false,
 												valueField: 'id',
 												displayField: 'name',
-												width: TR.conf.layout.west_fieldset_width - 20,
+												width: TR.conf.layout.west_fieldset_width - 10,
 												store: TR.store.programStageSection,
 												listeners: {
 													added: function() {
@@ -5208,12 +5238,12 @@
 											{
 												xtype: 'panel',
 												layout: 'column',
-												bodyStyle: 'border-style:none',
+												bodyStyle: 'border-style:none;magrin-left:2px;height:7005px;',
 												items: [
 													{
 														xtype: 'toolbar',
 														id: 'avalableDEBar',
-														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 + 14,
 														cls: 'tr-toolbar-multiselect-left',
 														items: [
 															{
@@ -5246,7 +5276,7 @@
 													{
 														xtype: 'toolbar',
 														id: 'selectedDEBar',
-														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 + 14,
 														cls: 'tr-toolbar-multiselect-left',
 														items: [
 															' ',
@@ -5281,7 +5311,7 @@
 														id: 'availableDataelements',
 														name: 'availableDataelements',
 														cls: 'tr-toolbar-multiselect-left',
-														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 + 14,
 														height: TR.conf.layout.west_dataelements_multiselect,
 														displayField: 'name',
 														valueField: 'id',
@@ -5345,7 +5375,7 @@
 														id: 'selectedDataelements',
 														name: 'selectedDataelements',
 														cls: 'tr-toolbar-multiselect-right',
-														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 + 14,
 														height: TR.conf.layout.west_dataelements_multiselect,
 														displayField: 'name',
 														valueField: 'id',
@@ -5407,20 +5437,20 @@
 													},
 													{
 														xtype: 'toolbar',
-														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor),
+														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) + 28,
 														cls: 'tr-toolbar-multiselect-left',
-														style: 'margin-top:10px;',
+														style: 'margin-top:2px;',
 														items: [
 															{
 																xtype: 'label',	
-																text: TR.i18n.filter_values,
+																text: TR.i18n.selected_items,
 																cls: 'tr-toolbar-multiselect-left-label'
 															},
 															'->',
 															{
 																xtype: 'button',
 																icon: 'images/arrowup.png',
-																tooltip: TR.i18n.show_hide_filter_values,
+																tooltip: TR.i18n.show_hide_selected_values,
 																up: true,
 																width: 22,
 																handler: function() {
@@ -5460,10 +5490,10 @@
 														xtype: 'panel',
 														layout: 'column',
 														id: 'filterPanel',
-														bodyStyle: 'background-color:transparent; padding:10px 10px 0px 3px;overflow-x: hidden; overflow-y: auto;',
+														bodyStyle: 'background-color:transparent; padding:2px 2px 2px 2px;overflow-x:hidden;overflow-y:auto;',
 														overflowX: 'hidden',
 														height: TR.conf.layout.west_dataelements_filter_panel,
-														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor),
+														width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) + 28,
 														items: []
 													}
 												]
@@ -5500,7 +5530,7 @@
                 id: 'center',
                 region: 'center',
                 layout: 'fit',
-                bodyStyle: 'padding-top:0px, padding-bottom:0px',
+                bodyStyle: 'padding-top:0px, padding-bottom:0px;',
                 tbar: {
                     xtype: 'toolbar',
                     cls: 'tr-toolbar',

=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm	2013-10-10 05:29:57 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm	2013-10-11 13:49:41 +0000
@@ -141,11 +141,11 @@
 columns: '$encoder.jsEscape($i18n.getString( 'columns' ) , "'")',
 filters: '$encoder.jsEscape($i18n.getString( 'filters' ) , "'")',
 wm_multiple_filter_ind_de: '$encoder.jsEscape($i18n.getString( 'wm_multiple_filter_ind_de' ) , "'")',
-filter_values: '$encoder.jsEscape($i18n.getString( 'filter_values' ) , "'")',
+selected_items: '$encoder.jsEscape($i18n.getString( 'selected_items' ) , "'")',
 fill_filter_values_for_all_selected_data_elements: '$encoder.jsEscape($i18n.getString( 'fill_filter_values_for_all_selected_data_elements' ) , "'")',
-data_filter: '$encoder.jsEscape($i18n.getString( 'data_filter' ) , "'")',
+data_items: '$encoder.jsEscape($i18n.getString( 'data_items' ) , "'")',
 use_completed_events: '$encoder.jsEscape($i18n.getString( 'use_completed_events' ) , "'")',
-show_hide_filter_values: '$encoder.jsEscape($i18n.getString( 'show_hide_filter_values' ) , "'")',
+show_hide_selected_values: '$encoder.jsEscape($i18n.getString( 'show_hide_filter_values' ) , "'")',
 date_period_range: '$encoder.jsEscape($i18n.getString( 'date_period_range' ) , "'")',
 select_from_date: '$encoder.jsEscape($i18n.getString( 'select_from_date' ) , "'")',
 select_to_date: '$encoder.jsEscape($i18n.getString( 'select_to_date' ) , "'")',
@@ -214,4 +214,6 @@
 transgender: '$encoder.jsEscape($i18n.getString( 'transgender' ) , "'")',
 immediate_children: '$encoder.jsEscape($i18n.getString( 'immediate_children' ) , "'")',
 delete: '$encoder.jsEscape($i18n.getString( 'delete' ) , "'")',
+dimension: '$encoder.jsEscape($i18n.getString( 'dimension' ) , "'")',
+filter: '$encoder.jsEscape($i18n.getString( 'filter' ) , "'")',
 };
\ No newline at end of file