dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20668
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9571: Ad-hoc aggregated reports in Tabular reports(WIP) - Favorites
------------------------------------------------------------
revno: 9571
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-01-22 14:56:19 +0700
message:
Ad-hoc aggregated reports in Tabular reports(WIP) - Favorites
modified:
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
--
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/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-01-22 06:42:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-01-22 07:56:19 +0000
@@ -533,7 +533,7 @@
fill_filter_values_for_all_selected_data_elements = Please fill filter values for all selected data elements
data_filter = Data filter
show_hide_filter_values = Show/hide filter values
-use_completed_events = User completed events
+use_completed_events = Use completed events
date_period_range = Date period range
select_from_date = Select from date
select_to_date = Select to date
=== 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-01-22 06:42:20 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-01-22 07:56:19 +0000
@@ -803,7 +803,7 @@
return text.replace(/[^a-zA-Z 0-9(){}<>_!+;:?*&%#-]+/g,'');
}
},
- getValueFormula: function( value ){
+ getValueFormula: function( value ){
if( value.indexOf('"') != value.lastIndexOf('"') )
{
value = value.replace(/"/g,"'");
@@ -1151,17 +1151,27 @@
}
// Filter values
-
- for (var i = 0; i < f.filterValues.length; i++) {
- var filter = f.filterValues[i].split('_');
- var id = 'de_' + filter[0];
- Ext.getCmp('filter_opt_' + id ).setValue(filter[1]);
- Ext.getCmp('filter_' + id ).rawValue = filter[2];
- if( filter.length == 5 )
- {
- id += '_1';
- Ext.getCmp('filter_opt_' + id ).setValue(filter[1]);
- Ext.getCmp('filter_' + id ).rawValue = filter[2];
+
+ Ext.getCmp('filterPanel').removeAll();
+ for (var j = 0; j < f.selectedDEs.length; j++) {
+ var id = f.selectedDEs[j].id;
+ var name = TR.util.string.getEncodedString(f.selectedDEs[j].name);
+ var valueType = f.selectedDEs[j].valueType;
+
+ for (var i = 0; i < f.filterValues.length; i++) {
+ var filter = f.filterValues[i].split('_');
+ var fitlerId = 'de_' + filter[0];
+ if(id==fitlerId){
+ TR.util.multiselect.addFilterField( 'filterPanel', fitlerId, name, valueType );
+ var idx = Ext.getCmp('p_' + fitlerId).items.length/4 - 1;
+ var value = filter[2].replace('(','').replace(')','').replace(/,/g, ';').replace(/'/g, '');
+
+ if(valueType=='list'){
+ Ext.getCmp('filter_' + fitlerId + '_' + idx ).store.add({o:value});
+ }
+ Ext.getCmp('filter_opt_' + fitlerId + '_' + idx ).setValue(filter[1]);
+ Ext.getCmp('filter_' + fitlerId + '_' + idx ).setValue(value);
+ }
}
}
@@ -1958,41 +1968,34 @@
// Filter values
- p.deFilters = [];
TR.cmp.params.dataelement.selected.store.each( function(r) {
var valueType = r.data.valueType;
var deId = r.data.id;
- var filterOpt = Ext.getCmp('filter_opt_' + deId).rawValue;
- var filterValue = Ext.getCmp('filter_' + deId).rawValue;
- var filter = deId.split('_')[1] + "_" + filterOpt + '_';
-
- if( valueType == 'string' || valueType == 'trueOnly'
- || valueType == 'bool' || valueType == 'list' )
- {
- var filterValues = filterValue.split(";");
- filter +=" (";
- for(var i=0;i<filterValues.length;i++)
- {
- filter += "'"+ filterValues[i] +"',";
- }
- filter = filter.substr(0,filter.length - 1) + " ) ";
- }
- else
- {
- filter += filterValue;
-
- var deId = deId + '_1';
- if( Ext.getCmp('filter_' + deId) != undefined
- && Ext.getCmp('filter_' + deId).rawValue != '' )
- {
- filterOpt = Ext.getCmp('filter_opt_' + deId).rawValue;
- filterValue = Ext.getCmp('filter_' + deId).rawValue;
- filter += "_" + filterOpt + "_" + filterValue;
- }
-
- }
- p += "&deFilters=" + filter;
-
+ var length = Ext.getCmp('p_' + deId).items.length/4;
+
+ for(var idx=0;idx<length;idx++)
+ {
+ var id = deId + '_' + idx;
+ var filterOpt = Ext.getCmp('filter_opt_' + id).rawValue;
+ var filterValue = Ext.getCmp('filter_' + id).rawValue;
+ var filter = deId.split('_')[1] + "_" + filterOpt + '_';
+
+ if( valueType == 'list' )
+ {
+ var filterValues = filterValue.split(";");
+ filter +=" (";
+ for(var i=0;i<filterValues.length;i++)
+ {
+ filter += "'"+ filterValues[i] +"',";
+ }
+ filter = filter.substr(0,filter.length - 1) + " ) ";
+ }
+ else
+ {
+ filter += "'" + filterValue + "'";
+ }
+ p += "&deFilters=" + filter;
+ }
});
// Period range