dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #25185
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12420: Improve Tabular report (WIP).
------------------------------------------------------------
revno: 12420
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-10-03 21:11:59 +0700
message:
Improve Tabular report (WIP).
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SetEventStatusAction.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/responseDataElements.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-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2013-09-23 08:37:56 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramStageInstance.java 2013-10-03 14:11:59 +0000
@@ -314,7 +314,7 @@
public Integer getEventStatus()
{
- if ( this.status != null )
+ if ( this.status != 0 )
{
return status;
}
=== modified file 'dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2013-09-27 11:10:25 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/patient/startup/TableAlteror.java 2013-10-03 14:11:59 +0000
@@ -248,6 +248,8 @@
executeSql( "update patientidentifiertype set orgunitScope=false where orgunitScope is null" );
executeSql( "update patientidentifiertype set programScope=false where programScope is null" );
+
+ executeSql( "update programstageinstance set status=0 where status is null" );
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SetEventStatusAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SetEventStatusAction.java 2013-09-18 06:54:48 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/reminder/SetEventStatusAction.java 2013-10-03 14:11:59 +0000
@@ -96,17 +96,17 @@
break;
case ProgramStageInstance.VISITED_STATUS:
programStageInstance.setCompleted( false );
- programStageInstance.setStatus( null );
+ programStageInstance.setStatus( ProgramStageInstance.ACTIVE_STATUS );
programStageInstanceService.updateProgramStageInstance( programStageInstance );
break;
case ProgramStageInstance.LATE_VISIT_STATUS:
programStageInstance.setCompleted( false );
- programStageInstance.setStatus( null );
+ programStageInstance.setStatus( ProgramStageInstance.ACTIVE_STATUS );
programStageInstanceService.updateProgramStageInstance( programStageInstance );
break;
case ProgramStageInstance.FUTURE_VISIT_STATUS:
programStageInstance.setCompleted( false );
- programStageInstance.setStatus( null );
+ programStageInstance.setStatus( ProgramStageInstance.ACTIVE_STATUS );
programStageInstanceService.updateProgramStageInstance( programStageInstance );
break;
case ProgramStageInstance.SKIPPED_STATUS:
=== 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-03 08:14:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2013-10-03 14:11:59 +0000
@@ -697,4 +697,5 @@
completed_enrollments_only = Completed enrollments only
both = both
column = Column
-row = Row
\ No newline at end of file
+row = Row
+show = Show
\ 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-03 08:14:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2013-10-03 14:11:59 +0000
@@ -494,30 +494,28 @@
params.value = 'EQ';
}
- if(valueType == 'string' || valueType == 'list' || valueType == 'username' ){
- var fixedId = id.substring(0, id.lastIndexOf('_') );
- if( fixedId=='fixedAttr_gender' || fixedId=='fixedAttr_dobType')
- {
- params.store = new Ext.data.ArrayStore({
- fields: ['value','name'],
- data: [ ['EQ','='],['IN',TR.i18n.in] ]
- });
- params.value = 'IN';
- }
- else
- {
- params.store = new Ext.data.ArrayStore({
- fields: ['value','name'],
- data: [ ['EQ','='],['LIKE',TR.i18n.like],['IN',TR.i18n.in] ]
- });
- params.value = 'IN';
- }
+ if( valueType=='GENDER' )
+ {
+ params.store = new Ext.data.ArrayStore({
+ fields: ['value','name'],
+ data: [ ['EQ','='] ]
+ });
+ params.value = 'EQ';
+ }
+ else if(valueType == 'string' || valueType == 'list' || valueType == 'username' )
+ {
+ params.store = new Ext.data.ArrayStore({
+ fields: ['value','name'],
+ data: [ ['EQ','='],['LIKE',TR.i18n.like],['IN',TR.i18n.in] ]
+ });
+ params.value = 'IN';
}
else if( valueType == 'trueOnly' || valueType == 'bool' ){
params.store = new Ext.data.ArrayStore({
fields: ['value','name'],
data: [ ['EQ','='] ]
});
+ params.value = 'EQ';
}
else
{
@@ -530,6 +528,7 @@
['LE','<='],
['NE','!=' ] ]
});
+ params.value = 'EQ';
}
params.listeners={};
@@ -554,8 +553,20 @@
params.emptyText = TR.i18n.filter_value;
params.width = (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2 - 50;
xtype = xtype.toLowerCase();
- if( xtype == 'datefield' )
- {
+ if( valueType=='GENDER'){
+ params.xtype = 'combobox';
+ params.queryMode = 'local';
+ params.valueField = 'value';
+ params.displayField = 'name';
+ params.editable = false;
+ params.store = new Ext.data.ArrayStore({
+ fields: ['value', 'name'],
+ data: [['F', TR.i18n.female],
+ ['M', TR.i18n.male],
+ ['T', TR.i18n.transgender]]
+ });
+ }
+ else if( xtype == 'datefield' ){
params.format = TR.i18n.format_date;
}
else if( xtype == 'combobox' )
@@ -1734,21 +1745,24 @@
{
var id = deId + '_' + idx;
- var filterOpt = Ext.getCmp('filter_opt_' + id).getValue();
- var filterValue = Ext.getCmp('filter_' + id).rawValue;
+ var filterOpt = Ext.getCmp('filter_opt_' + id).getValue();
+ var filterValue = Ext.getCmp('filter_' + id).rawValue.toLowerCase();;
+ if(deId=='GENDER'){
+ filterValue = Ext.getCmp('filter_' + id).getValue();
+ }
var filter = deId;
if( Ext.getCmp('filter_' + id).getValue()!=null
&& Ext.getCmp('filter_' + id).getValue()!=''){
- filterValue = filterValue.toLowerCase();
+ filterValue = filterValue
filter += ':' + filterOpt + ':';
if( filterOpt == 'IN' )
{
- filter +=filterValue.replace(/:/g,";");
+ filter += filterValue.replace(/:/g,";");
}
else
{
- filter += Ext.getCmp('filter_' + id).getValue();
+ filter += filterValue;
}
}
@@ -2076,7 +2090,18 @@
var json = Ext.JSON.decode(r.responseText);
TR.value.columns = json.headers;
- TR.value.values = json.rows;
+ var rows = json.rows;
+ for( var i in rows ){
+ var cols = rows[i];
+ for( var j in cols ){
+ var value = json.metaData.names[cols[j]];
+ if(value!=undefined){
+ rows[i][j] = value;
+ }
+ }
+ }
+
+ TR.value.values = rows;
// Get fields
@@ -2454,7 +2479,7 @@
getDataTable: function() {
var cols = [];
var reportType = Ext.getCmp('reportTypeGroup').getValue().reportType;
- if( reportType===true ){
+ if( reportType=='true' ){
cols = this.createCaseColTable();
}
else{
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm 2013-09-25 07:00:33 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseDataElements.vm 2013-10-03 14:11:59 +0000
@@ -1,38 +1,50 @@
{ "items": [
- #foreach( $iden in $identifierTypes )
- {
- "id": "$iden.uid",
- "name": "$encoder.xmlEncode(${iden.displayName} )",
- "valueType": #if( $iden.optionSet )
- "list"
- #else
- "${iden.type}"
- #end
- },
- #end
-
- #foreach( $attr in $patientAttributes )
- {
- "id": "$attr.uid",
- "name": "$encoder.xmlEncode(${attr.displayName} )",
- "valueType": #if( $attr.optionSet )
- "list"
- #else
- "${attr.type}"
- #end
- },
- #end
-
- #foreach( $psDataElement in $psDataElements )
- {
- "id": "$psDataElement.dataElement.uid",
- "name": "$encoder.xmlEncode(${psDataElement.dataElement.getFormNameFallback()} )",
- "valueType": #if( $psDataElement.dataElement.optionSet )
- "list_$psDataElement.dataElement.optionSet.uid"
- #else
- "${psDataElement.dataElement.type}"
- #end
- }#if( $velocityCount < $psDataElements.size() ),#end
+ #if( $auth.hasAccess( "dhis-web-caseentry", "accessPatientAttributes" ) )
+ {
+ "id": "GENDER",
+ "name": "$i18n.getString('gender')",
+ "valueType":"GENDER"
+ },
+ {
+ "id": "ISDEAD",
+ "name": "$i18n.getString('is_dead')",
+ "valueType": "bool"
+ },
+ #foreach( $iden in $identifierTypes )
+ {
+ "id": "$iden.uid",
+ "name": "$encoder.xmlEncode(${iden.displayName} )",
+ "valueType": #if( $iden.optionSet )
+ "list"
+ #else
+ "${iden.type}"
+ #end
+ },
+ #end
+
+ #foreach( $attr in $patientAttributes )
+ {
+ "id": "$attr.uid",
+ "name": "$encoder.xmlEncode(${attr.displayName} )",
+ "valueType": #if( $attr.optionSet )
+ "list"
+ #else
+ "${attr.type}"
+ #end
+ },
+ #end
+
+ #foreach( $psDataElement in $psDataElements )
+ {
+ "id": "$psDataElement.dataElement.uid",
+ "name": "$encoder.xmlEncode(${psDataElement.dataElement.getFormNameFallback()} )",
+ "valueType": #if( $psDataElement.dataElement.optionSet )
+ "list_$psDataElement.dataElement.optionSet.uid"
+ #else
+ "${psDataElement.dataElement.type}"
+ #end
+ }#if( $velocityCount < $psDataElements.size() ),#end
+ #end
#end
]
}
\ No newline at end of file