dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #16936
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 6582: (patient) Tabular report with EXTJS.
------------------------------------------------------------
revno: 6582
committer: Tran Chau <tran.hispvietnam@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2012-04-15 15:08:22 +0700
message:
(patient) Tabular report with EXTJS.
added:
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/
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/css/
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/css/style.css
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowleft.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowleftdouble.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowright.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowrightdouble.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/clearFilter.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/error_m.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/error_s.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/exit.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/ok.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/pdf.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/refresh.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/warning.png
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/xls.gif
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/index.html
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/jsonIdentifierTypes.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStages.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonminOrganisationUnitChildren.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseIdentifierTypes.vm
modified:
dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java
dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml
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/struts.xml
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm
dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.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-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java'
--- dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2012-04-11 06:25:02 +0000
+++ dhis-2/dhis-services/dhis-service-patient/src/main/java/org/hisp/dhis/program/hibernate/HibernateProgramStageInstanceStore.java 2012-04-15 08:08:22 +0000
@@ -37,10 +37,8 @@
import org.amplecode.quick.StatementHolder;
import org.amplecode.quick.StatementManager;
-import org.hibernate.Criteria;
import org.hibernate.Query;
import org.hibernate.criterion.Order;
-import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.hisp.dhis.hibernate.HibernateGenericStore;
import org.hisp.dhis.jdbc.StatementBuilder;
@@ -187,17 +185,14 @@
.setFirstResult( min ).setMaxResults( max ).list();
}
- @SuppressWarnings( "unchecked" )
public List<ProgramStageInstance> get( ProgramStage programStage, Map<Integer, String> searchingIdenKeys,
Map<Integer, String> searchingAttrKeys, Map<Integer, String> searchingDEKeys, Collection<Integer> orgunitIds,
Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc, int min, int max )
{
- if ( searchingDEKeys.keySet().size() > 0 )
- {
String sql = getTabularReportStatement( false, programStage, searchingIdenKeys, searchingAttrKeys,
searchingDEKeys, orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc )
+ statementBuilder.limitRecord( min, max );
-
+
List<Integer> ids = executeSQL( sql );
List<ProgramStageInstance> programStageInstances = new ArrayList<ProgramStageInstance>();
@@ -208,40 +203,12 @@
}
return programStageInstances;
- }
-
- Criteria criteria = (getCriteria( Restrictions.eq( "programStage", programStage ), Restrictions.in(
- "organisationUnit.id", orgunitIds ), Restrictions.between( "executionDate", startDate, endDate ) ))
- .setFirstResult( min ).setMaxResults( max );
-
- if ( orderByOrgunitAsc )
- {
- criteria.addOrder( Order.asc( "organisationUnit" ) );
- }
- else
- {
- criteria.addOrder( Order.desc( "organisationUnit" ) );
- }
-
- if ( orderByExecutionDateByAsc )
- {
- criteria.addOrder( Order.asc( "executionDate" ) );
- }
- else
- {
- criteria.addOrder( Order.desc( "executionDate" ) );
- }
-
- return criteria.list();
}
- @SuppressWarnings( "unchecked" )
public List<ProgramStageInstance> get( ProgramStage programStage, Map<Integer, String> searchingIdenKeys,
Map<Integer, String> searchingAttrKeys, Map<Integer, String> searchingDEKeys, Collection<Integer> orgunitIds,
Date startDate, Date endDate, boolean orderByOrgunitAsc, boolean orderByExecutionDateByAsc )
{
- if ( searchingDEKeys.keySet().size() > 0 )
- {
String sql = getTabularReportStatement( false, programStage, searchingIdenKeys, searchingAttrKeys,
searchingDEKeys, orgunitIds, startDate, endDate, orderByOrgunitAsc, orderByExecutionDateByAsc );
@@ -255,51 +222,17 @@
}
return programStageInstances;
- }
-
- Criteria criteria = (getCriteria( Restrictions.eq( "programStage", programStage ), Restrictions.in(
- "organisationUnit.id", orgunitIds ), Restrictions.between( "executionDate", startDate, endDate ) ));
-
- if ( orderByOrgunitAsc )
- {
- criteria = criteria.addOrder( Order.asc( "organisationUnit" ) );
- }
- else
- {
- criteria = criteria.addOrder( Order.desc( "organisationUnit" ) );
- }
-
- if ( orderByExecutionDateByAsc )
- {
- criteria = criteria.addOrder( Order.asc( "executionDate" ) );
- }
- else
- {
- criteria = criteria.addOrder( Order.desc( "executionDate" ) );
- }
-
- return criteria.list();
}
public int count( ProgramStage programStage, Map<Integer, String> searchingIdenKeys,
Map<Integer, String> searchingAttrKeys, Map<Integer, String> searchingDEKeys, Collection<Integer> orgunitIds,
Date startDate, Date endDate )
{
- if ( searchingIdenKeys.keySet().size() > 0 || searchingAttrKeys.keySet().size() > 0
- || searchingDEKeys.keySet().size() > 0 )
- {
- String sql = getTabularReportStatement( false, programStage, searchingIdenKeys, searchingAttrKeys,
+ String sql = getTabularReportStatement( true, programStage, searchingIdenKeys, searchingAttrKeys,
searchingDEKeys, orgunitIds, startDate, endDate, true, true );
List<Integer> countRow = executeSQL( sql );
return (countRow != null && countRow.size() > 0) ? countRow.get( 0 ) : 0;
- }
-
- Number rs = (Number) (getCriteria( Restrictions.eq( "programStage", programStage ), Restrictions.in(
- "organisationUnit.id", orgunitIds ), Restrictions.between( "dueDate", startDate, endDate ) ))
- .setProjection( Projections.rowCount() ).uniqueResult();
-
- return rs != null ? rs.intValue() : 0;
}
private String getTabularReportStatement( boolean isCount, ProgramStage programStage,
@@ -337,7 +270,7 @@
}
}
- condition += "WHERE psi.executiondate >= '" + DateUtils.getMediumDateString( startDate )
+ condition += "WHERE psi.executiondate >= '" + DateUtils.getMediumDateString( startDate )
+ "' AND psi.executiondate <= '" + DateUtils.getMediumDateString( endDate ) + "' "
+ " AND psi.organisationunitid in " + splitListHelper( orgunitIds ) + " ";
@@ -348,12 +281,12 @@
Iterator<Integer> idenKeys = searchingIdenKeys.keySet().iterator();
boolean index = false;
while ( idenKeys.hasNext() )
- {
+ {
Integer attributeId = idenKeys.next();
if ( index )
{
- condition += " AND psi.programstageinstanceid in ( " + sqlID + " WHERE 1=1 ";;
+ condition += " AND psi.programstageinstanceid in ( " + sqlID + " WHERE psi.programstageid = " + programStage.getId() + " ";
}
condition += " AND pid.patientidentifierTypeid=" + attributeId + " AND lower(pid.identifier) ";
@@ -420,11 +353,8 @@
{
Integer dataElementId = deKeys.next();
- //if ( index )
- //{
- condition += " AND psi.programstageinstanceid in ( " + sqlDE + " WHERE 1=1 ";
- //}
-
+ condition += " AND psi.programstageinstanceid in ( " + sqlDE + " WHERE 1=1 ";
+
condition += " AND pdv.dataElementid=" + dataElementId + " AND lower(pdv.value) ";
String compareValue = searchingDEKeys.get( dataElementId ).toLowerCase();
@@ -436,19 +366,14 @@
condition += compareValue;
- //if ( index )
- //{
- condition += ") ";
- //}
-
- //index = true;
+ condition += ") ";
}
if ( isCount )
{
- return "select count(psi.programstageinstanceid) " + condition;
+ return "select count( distinct psi.programstageinstanceid ) " + condition;
}
-
+
condition += " ORDER BY psi.organisationunitid ";
condition += orderByOrgunitAsc ? "asc" : "desc";
condition += ", psi.executiondate ";
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-04-11 06:25:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/java/org/hisp/dhis/caseentry/action/report/GenerateTabularReportAction.java 2012-04-15 08:08:22 +0000
@@ -43,9 +43,9 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitHierarchy;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.paging.ActionPagingSupport;
import org.hisp.dhis.patient.PatientAttribute;
+import org.hisp.dhis.patient.PatientAttributeOption;
import org.hisp.dhis.patient.PatientAttributeService;
import org.hisp.dhis.patient.PatientIdentifierType;
import org.hisp.dhis.patient.PatientIdentifierTypeService;
@@ -67,18 +67,13 @@
private String PREFIX_PATIENT_ATTRIBUTE = "attr";
private String PREFIX_DATA_ELEMENT = "de";
+
+ private String VALUE_TYPE_OPTION_SET = "optionSet";
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
- private OrganisationUnitSelectionManager selectionManager;
-
- public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
- {
- this.selectionManager = selectionManager;
- }
-
private OrganisationUnitService organisationUnitService;
public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
@@ -153,6 +148,13 @@
this.endDate = endDate;
}
+ private List<String> values = new ArrayList<String>();
+
+ public List<String> getValues()
+ {
+ return values;
+ }
+
private List<String> searchingValues = new ArrayList<String>();
public void setSearchingValues( List<String> searchingValues )
@@ -160,11 +162,6 @@
this.searchingValues = searchingValues;
}
- public List<String> getSearchingValues()
- {
- return searchingValues;
- }
-
private boolean orderByOrgunitAsc;
public void setOrderByOrgunitAsc( boolean orderByOrgunitAsc )
@@ -249,6 +246,20 @@
this.facilityLB = facilityLB;
}
+ private List<String> valueTypes = new ArrayList<String>();
+
+ public List<String> getValueTypes()
+ {
+ return valueTypes;
+ }
+
+ private Map<Integer, List<String>> mapSuggestedValues = new HashMap<Integer, List<String>>();
+
+ public Map<Integer, List<String>> getMapSuggestedValues()
+ {
+ return mapSuggestedValues;
+ }
+
private Map<Integer, String> searchingIdenKeys = new HashMap<Integer, String>();
private Map<Integer, String> searchingAttrKeys = new HashMap<Integer, String>();
@@ -266,10 +277,7 @@
// Get orgunitIds
// ---------------------------------------------------------------------
- OrganisationUnit selectedOrgunit = selectionManager.getSelectedOrganisationUnit();
-
- // OrganisationUnit selectedOrgunit =
- // organisationUnitService.getOrganisationUnit( orgunitId );
+ OrganisationUnit selectedOrgunit = organisationUnitService.getOrganisationUnit( orgunitId );
Set<Integer> orgunitIds = new HashSet<Integer>();
@@ -313,10 +321,12 @@
if ( type == null )
{
- total = programStageInstanceService.countProgramStageInstances( programStage, searchingIdenKeys,
+ int totalRecords = programStageInstanceService.countProgramStageInstances( programStage, searchingIdenKeys,
searchingAttrKeys, searchingDEKeys, orgunitIds, startValue, endValue );
- this.paging = createPaging( total );
+ total = getNumberOfPages( totalRecords );
+
+ this.paging = createPaging( totalRecords );
grid = programStageInstanceService.getTabularReport( programStage, identifierTypes, patientAttributes,
dataElements, searchingIdenKeys, searchingAttrKeys, searchingDEKeys, orgunitIds, level, startValue,
@@ -337,12 +347,18 @@
// Supportive methods
// ---------------------------------------------------------------------
+ public int getNumberOfPages( int totalRecord )
+ {
+ int pageSize = this.getDefaultPageSize();
+ return (totalRecord % pageSize == 0) ? (totalRecord / pageSize) : (totalRecord / pageSize + 1);
+ }
+
private void getParams()
{
// ---------------------------------------------------------------------
// Get Patient-Identifier searching-keys
// ---------------------------------------------------------------------
-
+ int index = 0;
for ( String searchingValue : searchingValues )
{
String[] infor = searchingValue.split( "_" );
@@ -351,28 +367,105 @@
if ( objectType.equals( PREFIX_IDENTIFIER_TYPE ) )
{
- identifierTypes.add( identifierTypeService.getPatientIdentifierType( objectId ) );
+ PatientIdentifierType identifierType = identifierTypeService.getPatientIdentifierType( objectId );
+ identifierTypes.add( identifierType );
+
+ // Get value-type && suggested-values
+ valueTypes.add( identifierType.getType() );
+
+ // Get searching-value
if ( infor.length == 3 )
{
searchingIdenKeys.put( objectId, infor[2].trim() );
+ values.add( infor[2].trim() );
+ }
+ else
+ {
+ values.add( "" );
}
}
else if ( objectType.equals( PREFIX_PATIENT_ATTRIBUTE ) )
{
- patientAttributes.add( patientAttributeService.getPatientAttribute( objectId ) );
+ PatientAttribute attribute = patientAttributeService.getPatientAttribute( objectId );
+ patientAttributes.add( attribute );
+
+ // Get value-type && suggested-values
+ valueTypes.add( attribute.getValueType() );
+ mapSuggestedValues.put( index, getSuggestedAttrValues( attribute ) );
+
+ // Get searching-value
if ( infor.length == 3 )
{
searchingAttrKeys.put( objectId, infor[2].trim() );
+ values.add( infor[2].trim() );
+ }
+ else
+ {
+ values.add( "" );
}
}
else if ( objectType.equals( PREFIX_DATA_ELEMENT ) )
{
- dataElements.add( dataElementService.getDataElement( objectId ) );
+ DataElement dataElement = dataElementService.getDataElement( objectId );
+ dataElements.add( dataElement );
+
+ // Get value-type && suggested-values
+ String valueType = ( dataElement.getOptionSet() != null ) ? VALUE_TYPE_OPTION_SET : dataElement.getType();
+ valueTypes.add( valueType );
+ mapSuggestedValues.put( index, getSuggestedDEValues( dataElement ) );
+
if ( infor.length == 3 )
{
searchingDEKeys.put( objectId, infor[2].trim() );
- }
- }
- }
- }
+ values.add( infor[2].trim() );
+ }
+ else
+ {
+ values.add( "" );
+ }
+ }
+
+ index++;
+ }
+ }
+
+ private List<String> getSuggestedAttrValues( PatientAttribute patientAttribute )
+ {
+ List<String> values = new ArrayList<String>();
+ String valueType = patientAttribute.getValueType();
+
+ if ( valueType.equals( PatientAttribute.TYPE_BOOL ) )
+ {
+ values.add( i18n.getString( "yes" ) );
+ values.add( i18n.getString( "no" ) );
+ }
+ else if ( valueType.equals( PatientAttribute.TYPE_COMBO ) )
+ {
+ for ( PatientAttributeOption attributeOption : patientAttribute.getAttributeOptions() )
+ {
+ values.add( attributeOption.getName() );
+ }
+ }
+
+ return values;
+ }
+
+ private List<String> getSuggestedDEValues( DataElement dataElement )
+ {
+ List<String> values = new ArrayList<String>();
+ String valueType = dataElement.getType();
+
+ if ( valueType.equals( DataElement.VALUE_TYPE_BOOL ) )
+ {
+ values.add( i18n.getString( "yes" ) );
+ values.add( i18n.getString( "no" ) );
+ }
+ else if ( dataElement.getOptionSet() != null )
+ {
+ values = dataElement.getOptionSet().getOptions();
+ }
+
+ return values;
+ }
+
}
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-04-11 06:25:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/META-INF/dhis/beans.xml 2012-04-15 08:08:22 +0000
@@ -334,8 +334,6 @@
id="org.hisp.dhis.caseentry.action.report.GenerateTabularReportAction"
class="org.hisp.dhis.caseentry.action.report.GenerateTabularReportAction"
scope="prototype">
- <property name="selectionManager"
- ref="org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager" />
<property name="programStageService" ref="org.hisp.dhis.program.ProgramStageService" />
<property name="dataElementService" ref="org.hisp.dhis.dataelement.DataElementService" />
<property name="programStageInstanceService"
=== 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 2012-04-11 06:25:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/org/hisp/dhis/caseentry/i18n_module.properties 2012-04-15 08:08:22 +0000
@@ -309,4 +309,7 @@
download = Download
xls = XLS
pdf = PDF
-pdf = PDF
\ No newline at end of file
+show_hide_settings_panel = Show/Hide Settings Panel
+page = Page
+et_no_data = No data returned from server
+et_no_dataelement = Please select at least one data element.
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-04-11 06:25:02 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/resources/struts.xml 2012-04-15 08:08:22 +0000
@@ -339,22 +339,22 @@
/dhis-web-commons/ajax/jsonResponseInput.vm</result>
</action>
- <action name="generateTabularReport"
+ <!-- action name="generateTabularReport"
class="org.hisp.dhis.caseentry.action.report.GenerateTabularReportAction">
<result name="success" type="velocity">/content.vm</result>
<result name="xls" type="gridXlsResult" />
<result name="pdf" type="gridPdfResult" />
<param name="page">/dhis-web-caseentry/tabularReportResult.vm</param>
<param name="requiredAuthorities">F_GENERATE_BENEFICIARY_TABULAR_REPORT</param>
- </action>
+ </action -->
- <!-- action name="generateTabularReport"
+ <action name="generateTabularReport"
class="org.hisp.dhis.caseentry.action.report.GenerateTabularReportAction">
<result name="success" type="velocity-json">/dhis-web-caseentry/jsonTabularReport.vm</result>
<result name="xls" type="gridXlsResult" />
<result name="pdf" type="gridPdfResult" />
<param name="requiredAuthorities">F_GENERATE_BENEFICIARY_TABULAR_REPORT</param>
- </action> -->
+ </action>
<action name="searchTabularReport"
class="org.hisp.dhis.caseentry.action.report.GenerateTabularReportAction">
=== added directory 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app'
=== added 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 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/app.js 2012-04-15 08:08:22 +0000
@@ -0,0 +1,1924 @@
+TR.conf = {
+ init: {
+ ajax: {
+ jsonfy: function(r) {
+ r = Ext.JSON.decode(r.responseText);
+ var obj = {system: {rootnode: {id: r.rn[0], name: r.rn[1], level: 1}, user: {id: r.user.id, isadmin: r.user.isAdmin, organisationunit: {id: r.user.ou[0], name: r.user.ou[1]}}}};
+ for (var program in r.programs) {
+ obj.system.program = [];
+ for (var i = 0; i < r.programs.length; i++) {
+ obj.system.program.push({id: r.programs[i].id, name: r.programs[i].name});
+ }
+ }
+
+ for (var level in r.levels) {
+ obj.system.level = [];
+ for (var i = 0; i < r.levels.length; i++) {
+ obj.system.level.push({value: r.levels[i].value, name: r.levels[i].name});
+ }
+ }
+
+ return obj;
+ }
+ }
+ },
+ finals: {
+ ajax: {
+ path_lib: '../../dhis-web-commons/javascripts/',
+ path_root: '../',
+ path_commons: '../',
+ path_api: '../../api/',
+ path_images: 'images/',
+ initialize: 'tabularInitialize.action',
+ program_get: 'getReportPrograms.action',
+ identifiertypes_get: 'loadReportIdentifierTypes.action',
+ patientattributes_get: 'loadReportAttributes.action',
+ programstages_get: 'loadReportProgramStages.action',
+ dataelements_get: 'loadDataElements.action',
+ organisationunitchildren_get: 'getOrganisationUnitChildren.action',
+ generatetabularreport_get: 'generateTabularReport.action',
+ redirect: 'index.action'
+ },
+ params: {
+ data: {
+ value: 'data',
+ rawvalue: TR.i18n.regular_program,
+ warning: {
+ filter: TR.i18n.wm_multiple_filter_ind_de
+ }
+ },
+ program: {
+ value: 'program',
+ rawvalue: TR.i18n.program
+ },
+ organisationunit: {
+ value: 'organisationunit',
+ rawvalue: TR.i18n.organisation_unit,
+ warning: {
+ filter: TR.i18n.wm_multiple_filter_orgunit
+ }
+ },
+ identifierType: {
+ value: 'identifierType',
+ rawvalue: TR.i18n.identifier
+ },
+ patientAttribute: {
+ value: 'patientAttribute',
+ rawvalue: TR.i18n.attribute
+ },
+ programStage: {
+ value: 'programStage',
+ rawvalue: TR.i18n.program_stage
+ },
+ dataelement: {
+ value: 'dataelement',
+ rawvalue: TR.i18n.data_element
+ }
+ },
+ data: {
+ domain: 'domain_',
+ },
+ image: {
+ xls: 'xls',
+ pdf: 'pdf'
+ },
+ cmd: {
+ init: 'init_',
+ none: 'none_',
+ urlparam: 'id'
+ }
+ },
+ statusbar: {
+ icon: {
+ error: 'error_s.png',
+ warning: 'warning.png',
+ ok: 'ok.png'
+ }
+ },
+ layout: {
+ west_width: 424,
+ west_fieldset_width: 402,
+ west_width_subtractor: 18,
+ west_fill: 117,
+ west_fill_accordion_organisationunit: 75,
+ west_maxheight_accordion_organisationunit: 700,
+ center_tbar_height: 31,
+ east_gridcolumn_height: 30,
+ form_label_width: 90
+ }
+};
+
+Ext.Loader.setConfig({enabled: true});
+Ext.Loader.setPath('Ext.ux', TR.conf.finals.ajax.path_lib + 'ext-ux');
+Ext.require('Ext.ux.form.MultiSelect');
+
+
+Ext.Loader.setPath('Ext.ux', TR.conf.finals.ajax.path_lib + 'ext-ux');
+Ext.require('Ext.ux.form.MultiSelect');
+
+Ext.onReady( function() {
+ Ext.override(Ext.form.FieldSet,{setExpanded:function(a){var b=this,c=b.checkboxCmp,d=b.toggleCmp,e;a=!!a;if(c){c.setValue(a)}if(d){d.setType(a?"up":"down")}if(a){e="expand";b.removeCls(b.baseCls+"-collapsed")}else{e="collapse";b.addCls(b.baseCls+"-collapsed")}b.collapsed=!a;b.doComponentLayout();b.fireEvent(e,b);return b}});
+ Ext.QuickTips.init();
+ document.body.oncontextmenu = function(){return false;};
+
+ Ext.Ajax.request({
+ url: TR.conf.finals.ajax.path_root + TR.conf.finals.ajax.initialize,
+ success: function(r) {
+
+ TR.init = TR.conf.init.ajax.jsonfy(r);
+ TR.init.initialize = function() {
+ TR.init.cmd = TR.util.getUrlParam(TR.conf.finals.cmd.urlparam) || TR.conf.finals.cmd.init;
+ };
+
+ TR.cmp = {
+ region: {},
+ settings: {},
+ params: {
+ program:{},
+ identifierType: {},
+ patientAttribute: {},
+ programStage: {},
+ dataelement: {},
+ organisationunit: {}
+ },
+ options: {},
+ toolbar: {
+ menuitem: {}
+ },
+ statusbar: {}
+ };
+
+ TR.util = {
+ getCmp: function(q) {
+ return TR.viewport.query(q)[0];
+ },
+ getUrlParam: function(s) {
+ var output = '';
+ var href = window.location.href;
+ if (href.indexOf('?') > -1 ) {
+ var query = href.substr(href.indexOf('?') + 1);
+ var query = query.split('&');
+ for (var i = 0; i < query.length; i++) {
+ if (query[i].indexOf('=') > -1) {
+ var a = query[i].split('=');
+ if (a[0].toLowerCase() === s) {
+ output = a[1];
+ break;
+ }
+ }
+ }
+ }
+ return unescape(output);
+ },
+ viewport: {
+ getSize: function() {
+ return {x: TR.cmp.region.center.getWidth(), y: TR.cmp.region.center.getHeight()};
+ },
+ getXY: function() {
+ return {x: TR.cmp.region.center.x + 15, y: TR.cmp.region.center.y + 43};
+ },
+ getPageCenterX: function(cmp) {
+ return ((screen.width/2)-(cmp.width/2));
+ },
+ getPageCenterY: function(cmp) {
+ return ((screen.height/2)-((cmp.height/2)-100));
+ },
+ resizeParams: function() {
+ var a = [TR.cmp.params.identifierType.panel, TR.cmp.params.patientAttribute.panel,
+ TR.cmp.params.dataelement.panel, TR.cmp.params.organisationunit.treepanel];
+ for (var i = 0; i < a.length; i++) {
+ if (!a[i].collapsed) {
+ a[i].fireEvent('expand');
+ }
+ }
+ }
+ },
+ multiselect: {
+ select: function(a, s) {
+ var selected = a.getValue();
+ if (selected.length) {
+ var array = [];
+ Ext.Array.each(selected, function(item) {
+ array.push({id: item, name: a.store.getAt(a.store.findExact('id', item)).data.name});
+ });
+ s.store.add(array);
+ }
+ this.filterAvailable(a, s);
+ },
+ selectAll: function(a, s) {
+ var array = [];
+ a.store.each( function(r) {
+ array.push({id: r.data.id, name: r.data.name});
+ });
+ s.store.add(array);
+ this.filterAvailable(a, s);
+ },
+ unselect: function(a, s) {
+ var selected = s.getValue();
+ if (selected.length) {
+ Ext.Array.each(selected, function(item) {
+ s.store.remove(s.store.getAt(s.store.findExact('id', item)));
+ });
+ this.filterAvailable(a, s);
+ }
+ },
+ unselectAll: function(a, s) {
+ s.store.removeAll();
+ a.store.clearFilter();
+ },
+ filterAvailable: function(a, s) {
+ a.store.filterBy( function(r) {
+ var filter = true;
+ s.store.each( function(r2) {
+ if (r.data.id === r2.data.id) {
+ filter = false;
+ }
+ });
+ return filter;
+ });
+ a.store.sort('name', 'ASC');
+ },
+ setHeight: function(ms, panel, fill) {
+ for (var i = 0; i < ms.length; i++) {
+ ms[i].setHeight(panel.getHeight() - fill);
+ }
+ }
+ },
+ store: {
+ addToStorage: function(s, records) {
+ s.each( function(r) {
+ if (!s.storage[r.data.id]) {
+ s.storage[r.data.id] = {id: r.data.id, name: TR.util.string.getEncodedString(r.data.name), parent: s.parent};
+ }
+ });
+ if (records) {
+ Ext.Array.each(records, function(r) {
+ if (!s.storage[r.data.id]) {
+ s.storage[r.data.id] = {id: r.data.id, name: TR.util.string.getEncodedString(r.data.name), parent: s.parent};
+ }
+ });
+ }
+ },
+ loadFromStorage: function(s) {
+ var items = [];
+ s.removeAll();
+ for (var obj in s.storage) {
+ if (s.storage[obj].parent === s.parent) {
+ items.push(s.storage[obj]);
+ }
+ }
+ s.add(items);
+ s.sort('name', 'ASC');
+ },
+ containsParent: function(s) {
+ for (var obj in s.storage) {
+ if (s.storage[obj].parent === s.parent) {
+ return true;
+ }
+ }
+ return false;
+ }
+ },
+ notification: {
+ error: function(title, text) {
+ title = title || '';
+ text = text || '';
+ Ext.create('Ext.window.Window', {
+ title: title,
+ cls: 'tr-messagebox',
+ iconCls: 'tr-window-title-messagebox',
+ modal: true,
+ width: 300,
+ items: [
+ {
+ xtype: 'label',
+ width: 40,
+ text: text
+ }
+ ]
+ }).show();
+ TR.cmp.statusbar.panel.setWidth(TR.cmp.region.center.getWidth());
+ TR.cmp.statusbar.panel.update('<img src="' + TR.conf.finals.ajax.path_images + TR.conf.statusbar.icon.error + '" style="padding:0 5px 0 0"/>' + text);
+ },
+ warning: function(text) {
+ text = text || '';
+ TR.cmp.statusbar.panel.setWidth(TR.cmp.region.center.getWidth());
+ TR.cmp.statusbar.panel.update('<img src="' + TR.conf.finals.ajax.path_images + TR.conf.statusbar.icon.warning + '" style="padding:0 5px 0 0"/>' + text);
+ },
+ ok: function() {
+ TR.cmp.statusbar.panel.setWidth(TR.cmp.region.center.getWidth());
+ TR.cmp.statusbar.panel.update('<img src="' + TR.conf.finals.ajax.path_images + TR.conf.statusbar.icon.ok + '" style="padding:0 5px 0 0"/> ');
+ }
+ },
+ mask: {
+ showMask: function(cmp, str) {
+ if (TR.mask) {
+ TR.mask.destroy();
+ }
+ TR.mask = new Ext.LoadMask(cmp, {msg: str});
+ TR.mask.show();
+ },
+ hideMask: function() {
+ if (TR.mask) {
+ TR.mask.hide();
+ }
+ }
+ },
+ /*FIXME:This is probably not going to work as intended with UNICODE?*/
+ string: {
+ getEncodedString: function(text) {
+ return text.replace(/[^a-zA-Z 0-9(){}<>_!+;:?*&%#-]+/g,'');
+ }
+ },
+ getValueFormula: function( value )
+ {
+ if( value.indexOf('"') != value.lastIndexOf('"') )
+ {
+ value = value.replace(/"/g,"'");
+ }
+ // if key is [xyz] && [=xyz]
+ if( value.indexOf("'")==-1 ){
+ var flag = value.match(/[>|>=|<|<=|=|!=]+[ ]*/);
+
+ if( flag == null )
+ {
+ value = "='"+ value + "'";
+ }
+ else
+ {
+ value = value.replace( flag, flag + "'");
+ value += "'";
+ }
+ }
+ // if key is ['xyz'] && [='xyz']
+ // if( value.indexOf("'") != value.lastIndexOf("'") )
+ else
+ {
+ var flag = value.match(/[>|>=|<|<=|=|!=]+[ ]*/);
+
+ if( flag == null )
+ {
+ value = "="+ value;
+ }
+ }
+
+ return value;
+ }
+ };
+
+ TR.store = {
+ params: function() {
+ return Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ data: [
+ {id: TR.conf.finals.params.data.value, name: TR.conf.finals.params.data.rawvalue},
+ {id: TR.conf.finals.params.program.value, name: TR.conf.finals.params.program.rawvalue},
+ {id: TR.conf.finals.params.organisationunit.value, name: TR.conf.finals.params.organisationunit.rawvalue},
+ {id: TR.conf.finals.params.identifierType.value, name: TR.conf.finals.params.identifierType.rawvalue},
+ {id: TR.conf.finals.params.patientAttribute.value, name: TR.conf.finals.params.patientAttribute.rawvalue},
+ {id: TR.conf.finals.params.programStage.value, name: TR.conf.finals.params.programStage.rawvalue},
+ {id: TR.conf.finals.params.dataelement.value, name: TR.conf.finals.params.dataelement.rawvalue}
+ ]
+ });
+ },
+ program: {
+ available: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ proxy: {
+ type: 'ajax',
+ url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.programs_get,
+ reader: {
+ type: 'json',
+ root: 'programs'
+ }
+ },
+ data:TR.init.system.program,
+ storage: {},
+ listeners: {
+ load: function(s) {
+ s.add({id: 0, name: TR.i18n.please_select, index: -1});
+ s.sort('index', 'ASC');
+ }
+ }
+ }),
+ selected: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ data: []
+ })
+ },
+ identifierType: {
+ available: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ proxy: {
+ type: 'ajax',
+ url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.identifiertypes_get,
+ reader: {
+ type: 'json',
+ root: 'identifierTypes'
+ }
+ },
+ isloaded: false,
+ storage: {},
+ listeners: {
+ load: function(s) {
+ this.isloaded = true;
+ TR.util.store.addToStorage(s);
+ TR.util.multiselect.filterAvailable(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected);
+ }
+ }
+ }),
+ selected: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ data: []
+ })
+ },
+ patientAttribute: {
+ available: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ proxy: {
+ type: 'ajax',
+ url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.patientattributes_get,
+ reader: {
+ type: 'json',
+ root: 'patientAttributes'
+ }
+ },
+ isloaded: false,
+ storage: {},
+ listeners: {
+ load: function(s) {
+ this.isloaded = true;
+ TR.util.store.addToStorage(s);
+ TR.util.multiselect.filterAvailable(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected);
+ }
+ }
+ }),
+ selected: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ data: []
+ })
+ },
+ programStage: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ proxy: {
+ type: 'ajax',
+ url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.programstages_get,
+ reader: {
+ type: 'json',
+ root: 'programStages'
+ }
+ },
+ listeners:{
+ load: function(s) {
+ Ext.override(Ext.LoadMask, {
+ onHide: function() {
+ this.callParent();
+ }
+ });
+ }
+ }
+ }),
+ dataelement: {
+ available: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ proxy: {
+ type: 'ajax',
+ url: TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.dataelements_get,
+ reader: {
+ type: 'json',
+ root: 'dataElements'
+ }
+ },
+ isloaded: false,
+ storage: {},
+ listeners: {
+ load: function(s) {
+ this.isloaded = true;
+ TR.util.store.addToStorage(s);
+ TR.util.multiselect.filterAvailable(TR.cmp.params.dataelement.available, TR.cmp.params.dataelement.selected);
+ }
+ }
+ }),
+ selected: Ext.create('Ext.data.Store', {
+ fields: ['id', 'name'],
+ data: []
+ })
+ },
+ datatable: null,
+ getDataTableStore: function() {
+
+ this.datatable = Ext.create('Ext.data.Store', {
+ fields: TR.value.fields,
+ data: TR.value.values,
+ proxy: {
+ type: 'memory',
+ reader: {
+ type: 'json',
+ root: 'items'
+ }
+ },
+ storage: {}
+ });
+ }
+ };
+
+ TR.state = {
+ filterValues:[],
+ currentPage: 1,
+ total: 1,
+ generateReport: function( type ) {
+ // Validation
+ if( this.filterValues.length==0 && !this.validation.objects() )
+ {
+ return;
+ }
+ // Get url
+ var url = TR.conf.finals.ajax.path_root + TR.conf.finals.ajax.generatetabularreport_get;
+ // Export to XLS or PDF
+ if( type)
+ {
+ url += "?" + "type=" + type + "&";
+ var params = ( this.filterValues.length==0 ) ? this.getURLParams() : this.getURLFilterValues() ;
+ window.location.href = url + params;
+ }
+ // Show report on grid
+ else
+ {
+ var params = ( this.filterValues.length == 0 ) ? TR.state.getParams() : this.filterValues;
+ TR.util.mask.showMask(TR.cmp.region.center, TR.i18n.loading);
+
+ Ext.Ajax.request({
+ url: url,
+ method: "POST",
+ scope: this,
+ params: params,
+ success: function(r) {
+ var json = Ext.JSON.decode(r.responseText);
+ TR.state.total = json.total;
+ TR.value.valueTypes = json.valueTypes;
+ TR.value.fields = json.fields;
+ TR.value.values = json.items;
+
+ if ( json.items.length > 1 )
+ {
+ TR.store.getDataTableStore();
+ TR.datatable.getDataTable();
+ TR.datatable.setPagingToolbarStatus();
+ TR.util.mask.hideMask();
+ }
+ else
+ {
+ TR.util.mask.hideMask();
+ TR.util.notification.error(TR.i18n.et_no_data, TR.i18n.et_no_data);
+ }
+ }
+ });
+ }
+ TR.util.notification.ok();
+ },
+ getBaseParams: function() {
+ var p = {};
+
+ p.startDate = TR.cmp.settings.startDate.rawValue;
+ p.endDate = TR.cmp.settings.endDate.rawValue;
+ p.facilityLB = TR.cmp.settings.facilityLB.getValue();
+ p.level = TR.cmp.settings.level.getValue();
+ p.orgunitId = TR.cmp.params.organisationunit.treepanel.getSelectionModel().getSelection()[0].data.id
+ p.orderByOrgunitAsc = 'true';
+ p.orderByExecutionDateByAsc= 'true';
+ p.programStageId = TR.cmp.params.programStage.getValue();
+ p.currentPage = this.currentPage;
+ p.pageSize = this.pageSize;
+
+ return p;
+ },
+ getParams: function() {
+ var p = {};
+ //p.program = TR.cmp.settings.program.getValue();
+ p.startDate = TR.cmp.settings.startDate.rawValue;
+ p.endDate = TR.cmp.settings.endDate.rawValue;
+ p.facilityLB = TR.cmp.settings.facilityLB.getValue();
+ p.level = TR.cmp.settings.level.getValue();
+ p.orgunitId = TR.cmp.params.organisationunit.treepanel.getSelectionModel().getSelection()[0].data.id
+ p.orderByOrgunitAsc = 'true';
+ p.orderByExecutionDateByAsc= 'true';
+ p.programStageId = TR.cmp.params.programStage.getValue();
+ p.currentPage = this.currentPage;
+ p.pageSize = this.pageSize;
+
+ p.searchingValues = [];
+ // Identifier Types
+ TR.cmp.params.identifierType.selected.store.each( function(r) {
+ p.searchingValues.push( 'iden_' + r.data.id + '_');
+ });
+ // Patient Attributes
+ TR.cmp.params.patientAttribute.selected.store.each( function(r) {
+ p.searchingValues.push( 'attr_' + r.data.id + '_');
+ });
+ // Data elements
+ TR.cmp.params.dataelement.selected.store.each( function(r) {
+ p.searchingValues.push( 'de_' + r.data.id + '_');
+ });
+
+ return p;
+ },
+ getURLParams: function() {
+ var p = "";
+ p += "startDate=" + TR.cmp.settings.startDate.rawValue;
+ p += "&endDate=" + TR.cmp.settings.endDate.rawValue;
+ p += "&facilityLB=" + TR.cmp.settings.facilityLB.getValue();
+ p += "&level=" + TR.cmp.settings.level.getValue();
+ p += "&orgunitId=" + TR.cmp.params.organisationunit.treepanel.getSelectionModel().getSelection()[0].data.id
+ p += "&orderByOrgunitAsc=" + 'true';
+ p += "&orderByExecutionDateByAsc=" +'true';
+ p += "&programStageId=" + TR.cmp.params.programStage.getValue();
+ p += "¤tPage=" + this.currentPage;
+ p += "&pageSize=" + this.pageSize;
+
+ // Identifier Types
+ TR.cmp.params.identifierType.selected.store.each( function(r) {
+ p += "&searchingValues=" + 'iden_' + r.data.id + '_';
+ });
+ // Patient Attributes
+ TR.cmp.params.patientAttribute.selected.store.each( function(r) {
+ p += "&searchingValues=" +'attr_' + r.data.id + '_';
+ });
+ // Data elements
+ TR.cmp.params.dataelement.selected.store.each( function(r) {
+ p += "&searchingValues=" + 'de_' + r.data.id + '_';
+ });
+
+ return p;
+ },
+ getURLFilterValues: function() {
+ var p = "";
+ p += "startDate=" + TR.cmp.settings.startDate.rawValue;
+ p += "&endDate=" + TR.cmp.settings.endDate.rawValue;
+ p += "&facilityLB=" + TR.cmp.settings.facilityLB.getValue();
+ p += "&level=" + TR.cmp.settings.level.getValue();
+ p += "&orgunitId=" + TR.cmp.params.organisationunit.treepanel.getSelectionModel().getSelection()[0].data.id
+ p += "&orderByOrgunitAsc=" + 'true';
+ p += "&orderByExecutionDateByAsc=" +'true';
+ p += "&programStageId=" + TR.cmp.params.programStage.getValue();
+ p += "¤tPage=" + this.currentPage;
+ p += "&pageSize=" + this.pageSize;
+
+ // Searching values
+ for( var i = 0; i<this.filterValues.searchingValues.length; i++ ){
+ p += "&searchingValues=" + this.filterValues.searchingValues[i];
+ }
+ return p;
+ },
+ validation: {
+ params: function() {
+ if (!TR.c.params.program ) {
+ TR.util.notification.error(TR.i18n.et_invalid_params_setup, TR.i18n.em_invalid_params_setup);
+ return false;
+ }
+ return true;
+ },
+ objects: function() {
+
+ if (TR.cmp.settings.program.getValue() == null) {
+ TR.util.notification.error(TR.i18n.et_no_programs, TR.i18n.et_no_programs);
+ return false;
+ }
+
+ if (!TR.cmp.params.organisationunit.treepanel.getSelectionModel().getSelection().length) {
+ TR.util.notification.error(TR.i18n.et_no_orgunits, TR.i18n.em_no_orgunits);
+ return false;
+ }
+
+ if (!TR.cmp.params.dataelement.selected.store.data.length) {
+ TR.util.notification.error(TR.i18n.et_no_dataelement, TR.i18n.et_no_dataelement);
+ return false;
+ }
+
+ return true;
+ },
+
+ render: function() {
+ if (!TR.c.isrendered) {
+ TR.cmp.toolbar.datatable.enable();
+ TR.c.isrendered = true;
+ }
+ },
+ response: function(r) {
+ if (!r.responseText) {
+ TR.util.mask.hideMask();
+ TR.util.notification.error(TR.i18n.et_invalid_uid, TR.i18n.em_invalid_uid);
+ return false;
+ }
+ return true;
+ },
+ value: function() {
+ if (!TR.value.values.length) {
+ TR.util.mask.hideMask();
+ TR.util.notification.error(TR.i18n.et_no_data, TR.i18n.em_no_data);
+ return false;
+ }
+ return true;
+ }
+ }
+ };
+
+ TR.value = {
+ valueTypes: [],
+ fields: [],
+ values: []
+ };
+
+ TR.datatable = {
+ datatable: null,
+ getDataTable: function() {
+ // column
+ var cols = [];
+ cols[0] = {
+ header: '#',
+ dataIndex: 'id',
+ width: 50,
+ height: TR.conf.layout.east_gridcolumn_height,
+ sortable: false,
+ draggable: false
+ }
+
+ cols[1] = {
+ header: TR.i18n.report_unit,
+ dataIndex: 'col1',
+ height: TR.conf.layout.east_gridcolumn_height,
+ sortable: false,
+ draggable: false
+ };
+
+ cols[2] = {
+ header: TR.i18n.report_date,
+ dataIndex: 'col2',
+ width: 150,
+ height: TR.conf.layout.east_gridcolumn_height,
+ sortable: false,
+ draggable: false
+ };
+
+ var index = 3;
+ TR.cmp.params.identifierType.selected.store.each( function(r) {
+ var dataIndex = "col" + index;
+ cols[index] = {
+ header: r.data.name,
+ dataIndex: dataIndex,
+ width: 150,
+ height: TR.conf.layout.east_gridcolumn_height,
+ name: "iden_"+ r.data.id + "_",
+ sortable: false,
+ draggable: false,
+ editor: {
+ xtype: 'textfield',
+ allowBlank: true
+ }
+ };
+ index++;
+ });
+
+ TR.cmp.params.patientAttribute.selected.store.each( function(r) {
+ var dataIndex = "col" + index;
+ cols[index] = {
+ header: r.data.name,
+ dataIndex: dataIndex,
+ width: 150,
+ height: TR.conf.layout.east_gridcolumn_height,
+ name: "attr_"+ r.data.id + "_",
+ groupable: true,
+ flex:1,
+ sortable: false,
+ draggable: false,
+ editor: {
+ xtype: TR.value.valueTypes[index].valueType,
+ queryMode: 'local',
+ editable: true,
+ valueField: 'name',
+ displayField: 'name',
+ allowBlank: true,
+ store: new Ext.data.ArrayStore({
+ fields: ['name'],
+ data: TR.value.valueTypes[index].suggestedValues,
+ })
+ }
+ };
+ index++;
+ });
+
+ TR.cmp.params.dataelement.selected.store.each( function(r) {
+ var dataIndex = "col" + index;
+ cols[index] = {
+ header: r.data.name,
+ dataIndex: dataIndex,
+ width: 150,
+ height: TR.conf.layout.east_gridcolumn_height,
+ groupable: true,
+ name: "de_"+ r.data.id + "_",
+ flex:1,
+ sortable: false,
+ draggable: false,
+ editor: {
+ xtype: TR.value.valueTypes[index].valueType,
+ queryMode: 'local',
+ editable: true,
+ valueField: 'name',
+ displayField: 'name',
+ allowBlank: true,
+ store: new Ext.data.ArrayStore({
+ fields: ['name'],
+ data: TR.value.valueTypes[index].suggestedValues,
+ })
+ }
+ };
+ index++;
+ });
+
+ // grid
+ this.datatable = Ext.create('Ext.grid.Panel', {
+ height: TR.util.viewport.getSize().y - 68,
+ cls: 'x-grid-row-alt',
+ stripeRows: true,
+ columns: cols,
+ lbar: [
+ {
+ xtype: 'label',
+ text: "",
+ style: 'font-size:11px; font-weight:bold; padding:13px 10px 0 10px'
+ },
+ {
+ xtype: 'button',
+ icon: 'images/clearFilter.png',
+ name: TR.i18n.clear,
+ value:"",
+ tooltip: TR.i18n.clear,
+ width: 30,
+ listeners: {
+ click: function() {
+ var p = TR.state.getBaseParams();
+ p.searchingValues = [];
+ var cols = TR.datatable.datatable.columns;
+ for( var i=0; i<cols.length; i++ )
+ {
+ var dataIndex = cols[i].dataIndex;
+ if( TR.store.datatable.first() )
+ {
+ TR.store.datatable.first().data[dataIndex] = "";
+ }
+ if( cols[i].name )
+ {
+ p.searchingValues.push( cols[i].name );
+ }
+ };
+
+ TR.state.filterValues = p;
+ TR.exe.execute();
+ }
+ }
+ }
+ ],
+ scroll: 'both',
+ bbar: [
+ {
+ xtype: 'button',
+ icon: 'images/arrowleftdouble.png',
+ id:'firstPageBtn',
+ width: 22,
+ handler: function() {
+ TR.exe.paging(1);
+ }
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowleft.png',
+ id:'previousPageBtn',
+ width: 22,
+ handler: function() {
+ TR.exe.paging( eval(TR.cmp.settings.currentPage.rawValue) - 1 );
+ }
+ },
+ {
+ xtype: 'label',
+ text: '|'
+ },
+ {
+ xtype: 'label',
+ text: TR.i18n.page
+ },
+ {
+ xtype: 'textfield',
+ cls: 'tr-textfield-alt1',
+ id:'currentPage',
+ value: '1',
+ listeners: {
+ added: function() {
+ TR.cmp.settings.currentPage = this;
+ },
+ specialkey: function( textfield, e, eOpts ){
+
+ if (e.keyCode == e.ENTER)
+ {
+ var oldValue = TR.state.currentPage;
+ var newValue = textfield.rawValue;
+ if( newValue < 1 || newValue > TR.state.total )
+ {
+ textfield.setValue(oldValue);
+ }
+ else
+ {
+ TR.exe.paging( newValue );
+ }
+ }
+ }
+ },
+ },
+ {
+ xtype: 'label',
+ text: ' of ' + TR.state.total + ' | '
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowright.png',
+ id:'nextPageBtn',
+ handler: function() {
+ TR.exe.paging( eval(TR.cmp.settings.currentPage.rawValue) + 1 );
+ }
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowrightdouble.png',
+ id:'lastPageBtn',
+ handler: function() {
+ TR.exe.paging( TR.state.total );
+ }
+ },
+ {
+ xtype: 'label',
+ text: '|'
+ },
+ {
+ xtype: 'button',
+ icon: 'images/refresh.png',
+ handler: function() {
+ TR.exe.paging( TR.cmp.settings.currentPage.rawValue );
+ }
+ }
+ ],
+ plugins: [
+ Ext.create('Ext.grid.plugin.RowEditing', {
+ clicksToEdit: 1,
+ editStyle: 'row',
+ clicksToMoveEditor: 1,
+ autoScroll: true,
+ errorSummary: false,
+ listeners: {
+ beforeedit: function( editor, e)
+ {
+ if( editor.rowIdx > 0 )
+ {
+ return false;
+ }
+ },
+ edit: function( editor, e ){
+ var p = TR.state.getBaseParams();
+ p.searchingValues = [];
+ var colLen = editor.grid.columns.length;
+ for( var i=0; i<colLen; i++ )
+ {
+ var col = editor.grid.columns[i];
+ if( col.name )
+ {
+ var dataIndex = col.dataIndex;
+ var value = col.field.rawValue;
+ if( value!=null && value!= '')
+ {
+ value = TR.util.getValueFormula(value);
+ }
+ p.searchingValues.push( col.name + value );
+ }
+ };
+
+ TR.state.filterValues = p;
+ TR.exe.execute();
+ TR.datatable.getDataTable();
+ }
+ }
+ })
+ //, group
+
+ ],
+ store: TR.store.datatable
+ ,listeners: {
+ celldblclick: function(grid,rowIndex,cellIndex,e){
+ if( rowIndex==0 && cellIndex==0 )
+ {
+ grid.getView().focusRow(this.rowIndex);
+ }
+ }
+ }
+ });
+
+ if (Ext.grid.RowEditor) {
+ Ext.apply(Ext.grid.RowEditor.prototype, {
+ saveBtnText : TR.i18n.filter,
+ cancelBtnText : TR.i18n.cancel,
+ });
+ }
+
+ TR.cmp.region.center.removeAll(true);
+ TR.cmp.region.center.add(this.datatable);
+
+ return this.datatable;
+
+ },
+ setPagingToolbarStatus: function() {
+ if( TR.state.currentPage == TR.state.total == 1 )
+ {
+ Ext.getCmp('firstPageBtn').disable();
+ Ext.getCmp('previousPageBtn').disable();
+ Ext.getCmp('nextPageBtn').disable();
+ Ext.getCmp('lastPageBtn').disable();
+ }
+ else if( TR.state.currentPage == TR.state.total )
+ {
+ Ext.getCmp('firstPageBtn').enable();
+ Ext.getCmp('previousPageBtn').enable();
+ Ext.getCmp('nextPageBtn').disable();
+ Ext.getCmp('lastPageBtn').disable();
+ }
+ else if( TR.state.currentPage == 1 )
+ {
+ Ext.getCmp('firstPageBtn').disable();
+ Ext.getCmp('previousPageBtn').disable();
+ Ext.getCmp('nextPageBtn').enable();
+ Ext.getCmp('lastPageBtn').enable();
+ }
+ else
+ {
+ Ext.getCmp('firstPageBtn').enable();
+ Ext.getCmp('previousPageBtn').enable();
+ Ext.getCmp('nextPageBtn').enable();
+ Ext.getCmp('lastPageBtn').enable();
+ }
+ }
+ };
+
+ TR.exe = {
+ execute: function( type ) {
+ TR.state.generateReport(type);
+ },
+ paging: function( currentPage )
+ {
+ TR.state.currentPage = currentPage;
+ TR.exe.execute();
+ Ext.getCmp('currentPage').setValue( currentPage );
+ TR.datatable.setPagingToolbarStatus();
+ },
+ datatable: function() {
+ TR.store.getDataTableStore();
+ TR.datatable.getDataTable();
+ TR.datatable.setPagingToolbarStatus();
+ }
+ };
+
+ TR.viewport = Ext.create('Ext.container.Viewport', {
+ layout: 'border',
+ renderTo: Ext.getBody(),
+ isrendered: false,
+ items: [
+ {
+ region: 'west',
+ preventHeader: true,
+ collapsible: true,
+ collapseMode: 'mini',
+ items: [
+ {
+ xtype: 'toolbar',
+ items: [
+ {
+ xtype: 'panel',
+ bodyStyle: 'border-style:none; background-color:transparent; padding:0 2px',
+ items: [
+ {
+ xtype: 'label',
+ text: TR.i18n.programs,
+ style: 'font-size:11px; font-weight:bold; padding:0 3px'
+ },
+ { bodyStyle: 'padding:1px 0; border-style:none; background-color:transparent' },
+ {
+ xtype: 'combobox',
+ cls: 'tr-combo',
+ id:'programCombobox',
+ fieldLabel: TR.i18n.program,
+ labelStyle: 'padding-left:7px;font-weight:bold;',
+ labelWidth: TR.conf.layout.form_label_width,
+ name: TR.init.system.programs,
+ emptyText: TR.i18n.please_select,
+ queryMode: 'local',
+ editable: false,
+ valueField: 'id',
+ displayField: 'name',
+ width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor,
+ store: TR.store.program.available,
+ listeners: {
+ added: function() {
+ TR.cmp.settings.program = this;
+ },
+ select: function(cb) {
+ // IDENTIFIER TYPE
+ var storeIdentifierType = TR.store.identifierType.available;
+ TR.store.identifierType.selected.loadData([],false);
+ storeIdentifierType.parent = cb.getValue();
+
+ if (TR.util.store.containsParent(storeIdentifierType)) {
+ TR.util.store.loadFromStorage(storeIdentifierType);
+ TR.util.multiselect.filterAvailable(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected);
+ }
+ else {
+ storeIdentifierType.load({params: {programId: cb.getValue()}});
+ }
+
+ // PATIENT ATTRIBUTE
+ var storePatientAttribute = TR.store.patientAttribute.available;
+ storePatientAttribute.parent = cb.getValue();
+ TR.store.patientAttribute.selected.loadData([],false);
+
+ if (TR.util.store.containsParent(storePatientAttribute)) {
+ TR.util.store.loadFromStorage(storePatientAttribute);
+ TR.util.multiselect.filterAvailable(TR.cmp.params.patientAttribute.available, TR.cmp.params.patientAttribute.selected);
+ }
+ else {
+ storePatientAttribute.load({params: {programId: cb.getValue()}});
+ }
+
+ // PROGRAM-STAGE
+ var storeProgramStage = TR.store.programStage;
+ TR.store.dataelement.selected.loadData([],false);
+ storeProgramStage.parent = cb.getValue();
+ storeProgramStage.load({params: {programId: cb.getValue()}});
+ }
+ }
+ },
+ {
+ xtype: 'panel',
+ bodyStyle: 'border-style:none; background-color:transparent; padding:0 2px',
+ layout: 'column',
+ items: [
+ { bodyStyle: 'padding:1px 0; border-style:none; background-color:transparent' },
+ {
+ xtype: 'datefield',
+ cls: 'tr-textfield-alt1',
+ id:'startDate',
+ fieldLabel: TR.i18n.start_date,
+ labelStyle: 'padding-left:7px;font-weight:bold;',
+ labelWidth: TR.conf.layout.form_label_width,
+ labelAlign: 'top',
+ labelSeparator: '',
+ editable: false,
+ style: 'margin-right:6px',
+ width: ( TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor)/2 - 8,
+ format: TR.i18n.format_date,
+ value: new Date(),
+ listeners: {
+ added: function() {
+ TR.cmp.settings.startDate = this;
+ }
+ }
+ },
+ {
+ xtype: 'datefield',
+ cls: 'tr-textfield-alt1',
+ style: 'margin-left:6px',
+ id:'endDate',
+ fieldLabel: TR.i18n.end_date,
+ labelStyle: 'padding-left:7px;font-weight:bold;',
+ labelWidth: TR.conf.layout.form_label_width,
+ labelAlign: 'top',
+ labelSeparator: '',
+ editable: false,
+ width: ( TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor)/2 - 8,
+ format: TR.i18n.format_date,
+ value: new Date(),
+ listeners: {
+ added: function() {
+ TR.cmp.settings.endDate = this;
+ }
+ }
+ }
+ ]
+ }
+
+
+ ]
+ }]
+ },
+ {
+ xtype: 'panel',
+ bodyStyle: 'border-style:none; border-top:2px groove #eee; padding:10px 10px 0 10px;',
+ layout: 'fit',
+ items: [
+ {
+ xtype: 'panel',
+ layout: 'accordion',
+ activeOnTop: true,
+ cls: 'tr-accordion',
+ bodyStyle: 'border:0 none',
+ height: 350,
+ items: [
+ // ORGANISATION UNIT
+ {
+ title: '<div style="height:17px">' + TR.i18n.organisation_units + '</div>',
+ hideCollapseTool: true,
+ items: [
+ {
+ xtype: 'combobox',
+ cls: 'tr-combo',
+ id:'facilityLBCombobox',
+ fieldLabel: TR.i18n.use_data_from_level,
+ emptyText: TR.i18n.please_select,
+ queryMode: 'local',
+ editable: false,
+ valueField: 'value',
+ displayField: 'name',
+ width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor - 20,
+ store: new Ext.data.ArrayStore({
+ fields: ['value', 'name'],
+ data: [['all', TR.i18n.all], ['childrenOnly', TR.i18n.children_only], ['selected', TR.i18n.selected]],
+ }),
+ value: 'all',
+ listeners: {
+ added: function() {
+ TR.cmp.settings.facilityLB = this;
+ }
+ }
+ },
+ {
+ xtype: 'combobox',
+ cls: 'tr-combo',
+ id:'levelCombobox',
+ fieldLabel: TR.i18n.show_hierachy_from_level,
+ name: TR.conf.finals.programs,
+ emptyText: TR.i18n.please_select,
+ queryMode: 'local',
+ editable: false,
+ valueField: 'value',
+ displayField: 'name',
+ width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor - 20,
+ store: Ext.create('Ext.data.Store', {
+ fields: ['value', 'name'],
+ data: TR.init.system.level,
+ }),
+ value: '1',
+ listeners: {
+ added: function() {
+ TR.cmp.settings.level = this;
+ }
+ }
+ },
+ {
+ xtype: 'treepanel',
+ cls: 'tr-tree',
+ width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor,
+ height: TR.conf.layout.west_maxheight_accordion_organisationunit,
+ autoScroll: true,
+ multiSelect: false,
+ isrendered: false,
+ storage: {},
+ addToStorage: function(objects) {
+ for (var i = 0; i < objects.length; i++) {
+ this.storage[objects[i].id] = objects[i];
+ }
+ },
+ selectRoot: function() {
+ if (this.isrendered) {
+ if (!this.getSelectionModel().getSelection().length) {
+ this.getSelectionModel().select(this.getRootNode());
+ }
+ }
+ },
+ findNameById: function(id) {
+ var name = this.store.getNodeById(id) ? this.store.getNodeById(id).data.text : null;
+ if (!name) {
+ for (var k in this.storage) {
+ if (k == id) {
+ name = this.storage[k].name;
+ }
+ }
+ }
+ return name;
+ },
+ store: Ext.create('Ext.data.TreeStore', {
+ proxy: {
+ type: 'ajax',
+ url: TR.conf.finals.ajax.path_root + TR.conf.finals.ajax.organisationunitchildren_get
+ },
+ root: {
+ id: TR.init.system.rootnode.id,
+ text: TR.init.system.rootnode.name,
+ expanded: false
+ }
+ }),
+ listeners: {
+ added: function() {
+ TR.cmp.params.organisationunit.treepanel = this;
+ },
+ itemcontextmenu: function(v, r, h, i, e) {
+ if (v.menu) {
+ v.menu.destroy();
+ }
+ v.menu = Ext.create('Ext.menu.Menu', {
+ id: 'treepanel-contextmenu',
+ showSeparator: false
+ });
+ if (!r.data.leaf) {
+ v.menu.add({
+ id: 'treepanel-contextmenu-item',
+ text: TR.i18n.select_all_children,
+ icon: 'images/node-select-child.png',
+ handler: function() {
+ r.expand(false, function() {
+ v.getSelectionModel().select(r.childNodes, true);
+ v.getSelectionModel().deselect(r);
+ });
+ }
+ });
+ }
+ else {
+ return;
+ }
+
+ v.menu.showAt(e.xy);
+ }
+ }
+ }
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.organisationunit.panel = this;
+ },
+ expand: function() {
+ TR.cmp.params.organisationunit.treepanel.setHeight(TR.cmp.params.organisationunit.panel.getHeight() - TR.conf.layout.west_fill_accordion_organisationunit);
+ }
+ }
+ },
+
+ // IDENTIFIER TYPE
+ {
+ title: '<div style="height:17px">' + TR.i18n.identifier + '</div>',
+ hideCollapseTool: true,
+ items: [
+ {
+ xtype: 'panel',
+ layout: 'column',
+ bodyStyle: 'border-style:none',
+ items: [
+ Ext.create('Ext.ux.form.MultiSelect', {
+ name: 'availableIdentifierTypes',
+ cls: 'tr-toolbar-multiselect-left',
+ width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+ displayField: 'name',
+ valueField: 'id',
+ queryMode: 'local',
+ store: TR.store.identifierType.available,
+ tbar: [
+ {
+ xtype: 'label',
+ text: TR.i18n.available,
+ cls: 'tr-toolbar-multiselect-left-label'
+ },
+ '->',
+ {
+ xtype: 'button',
+ icon: 'images/arrowright.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.select(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected);
+ }
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowrightdouble.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.selectAll(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected);
+ }
+ },
+ ' '
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.identifierType.available = this;
+ },
+ afterrender: function() {
+ this.boundList.on('itemdblclick', function() {
+ TR.util.multiselect.select(this, TR.cmp.params.identifierType.selected);
+ }, this);
+ }
+ }
+ }),
+ {
+ xtype: 'multiselect',
+ name: 'selectedIdentifierTypes',
+ cls: 'tr-toolbar-multiselect-right',
+ width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+ displayField: 'name',
+ valueField: 'id',
+ ddReorder: true,
+ queryMode: 'local',
+ store: TR.store.identifierType.selected,
+ tbar: [
+ ' ',
+ {
+ xtype: 'button',
+ icon: 'images/arrowleftdouble.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.unselectAll(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected);
+ }
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowleft.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.unselect(TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected);
+ }
+ },
+ '->',
+ {
+ xtype: 'label',
+ text: TR.i18n.selected,
+ cls: 'tr-toolbar-multiselect-right-label'
+ }
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.identifierType.selected = this;
+ },
+ afterrender: function() {
+ this.boundList.on('itemdblclick', function() {
+ TR.util.multiselect.unselect(TR.cmp.params.identifierType.available, this);
+ }, this);
+ }
+ }
+ }
+ ]
+ }
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.identifierType.panel = this;
+ },
+ expand: function() {
+ TR.util.multiselect.setHeight(
+ [TR.cmp.params.identifierType.available, TR.cmp.params.identifierType.selected],
+ TR.cmp.params.identifierType.panel
+ );
+
+ var programId = Ext.getCmp('programCombobox').getValue();
+ if ( programId!=null && !TR.store.identifierType.available.isloaded ) {
+ TR.store.identifierType.available.load({params: {programId: programId}});
+ }
+ }
+ }
+ },
+
+ // PATIENT-ATTRIBUTE
+ {
+ title: '<div style="height:17px">' + TR.i18n.attribute + '</div>',
+ hideCollapseTool: true,
+ items: [
+ {
+ xtype: 'panel',
+ layout: 'column',
+ bodyStyle: 'border-style:none',
+ items: [
+ Ext.create('Ext.ux.form.MultiSelect', {
+ name: 'availablePatientAttributes',
+ cls: 'tr-toolbar-multiselect-left',
+ width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+ displayField: 'name',
+ valueField: 'id',
+ queryMode: 'local',
+ store: TR.store.patientAttribute.available,
+ tbar: [
+ {
+ xtype: 'label',
+ text: TR.i18n.available,
+ cls: 'tr-toolbar-multiselect-left-label'
+ },
+ '->',
+ {
+ xtype: 'button',
+ icon: 'images/arrowright.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.select(TR.cmp.params.patientAttribute.available, TR.cmp.params.patientAttribute.selected);
+ }
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowrightdouble.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.selectAll(TR.cmp.params.patientAttribute.available, TR.cmp.params.patientAttribute.selected);
+ }
+ },
+ ' '
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.patientAttribute.available = this;
+ },
+ afterrender: function() {
+ this.boundList.on('itemdblclick', function() {
+ TR.util.multiselect.select(this, TR.cmp.params.patientAttribute.selected);
+ }, this);
+ }
+ }
+ }),
+ {
+ xtype: 'multiselect',
+ name: 'selectedPatientAttribute',
+ cls: 'tr-toolbar-multiselect-right',
+ width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+ displayField: 'name',
+ valueField: 'id',
+ ddReorder: true,
+ queryMode: 'local',
+ store: TR.store.patientAttribute.selected,
+ tbar: [
+ ' ',
+ {
+ xtype: 'button',
+ icon: 'images/arrowleftdouble.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.unselectAll(TR.cmp.params.patientAttribute.available, TR.cmp.params.patientAttribute.selected);
+ }
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowleft.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.unselect(TR.cmp.params.patientAttribute.available, TR.cmp.params.patientAttribute.selected);
+ }
+ },
+ '->',
+ {
+ xtype: 'label',
+ text: TR.i18n.selected,
+ cls: 'tr-toolbar-multiselect-right-label'
+ }
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.patientAttribute.selected = this;
+ },
+ afterrender: function() {
+ this.boundList.on('itemdblclick', function() {
+ TR.util.multiselect.unselect(TR.cmp.params.patientAttribute.available, this);
+ }, this);
+ }
+ }
+ }
+ ]
+ }
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.patientAttribute.panel = this;
+ },
+ expand: function() {
+ TR.util.multiselect.setHeight(
+ [TR.cmp.params.patientAttribute.available, TR.cmp.params.patientAttribute.selected],
+ TR.cmp.params.patientAttribute.panel
+ );
+
+ var programId = Ext.getCmp('programCombobox').getValue();
+ if ( programId!=null && !TR.store.patientAttribute.available.isloaded ) {
+ TR.store.patientAttribute.available.load({params: {programId: programId}});
+ }
+ }
+ }
+ },
+
+ // DATA ELEMENTS
+ {
+ title: '<div style="height:17px">' + TR.i18n.data_element + '</div>',
+ hideCollapseTool: true,
+ items: [
+ {
+ xtype: 'combobox',
+ cls: 'tr-combo',
+ id:'programStageCombobox',
+ labelStyle: 'padding-left:7px;',
+ labelWidth: 90,
+ fieldLabel: TR.i18n.program_stage,
+ emptyText: TR.i18n.please_select,
+ queryMode: 'local',
+ editable: false,
+ valueField: 'id',
+ displayField: 'name',
+ style: 'margin-bottom:8px',
+ width: TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor,
+ store: TR.store.programStage,
+ listeners: {
+ added: function() {
+ TR.cmp.params.programStage = this;
+ },
+ select: function(cb) {
+ var store = TR.store.dataelement.available;
+ TR.store.dataelement.selected.loadData([],false);
+ store.parent = cb.getValue();
+
+ if (TR.util.store.containsParent(store)) {
+ TR.util.store.loadFromStorage(store);
+ TR.util.multiselect.filterAvailable(TR.cmp.params.dataelement.available, TR.cmp.params.dataelement.selected);
+ }
+ else {
+ store.load({params: {programStageId: cb.getValue()}});
+ }
+ }
+ }
+ },
+ {
+ xtype: 'panel',
+ layout: 'column',
+ bodyStyle: 'border-style:none',
+ items: [
+ Ext.create('Ext.ux.form.MultiSelect', {
+ name: 'availableDataelementAttributes',
+ cls: 'tr-toolbar-multiselect-left',
+ width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+ displayField: 'name',
+ valueField: 'id',
+ queryMode: 'remote',
+ store: TR.store.dataelement.available,
+ tbar: [
+ {
+ xtype: 'label',
+ text: TR.i18n.available,
+ cls: 'tr-toolbar-multiselect-left-label'
+ },
+ '->',
+ {
+ xtype: 'button',
+ icon: 'images/arrowright.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.select(TR.cmp.params.dataelement.available, TR.cmp.params.dataelement.selected);
+ }
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowrightdouble.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.selectAll(TR.cmp.params.dataelement.available, TR.cmp.params.dataelement.selected);
+ }
+ },
+ ' '
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.dataelement.available = this;
+ },
+ afterrender: function() {
+ this.boundList.on('itemdblclick', function() {
+ TR.util.multiselect.select(this, TR.cmp.params.dataelement.selected);
+ }, this);
+ }
+ }
+ }),
+ {
+ xtype: 'multiselect',
+ name: 'selectedDataelementAttribute',
+ cls: 'tr-toolbar-multiselect-right',
+ width: (TR.conf.layout.west_fieldset_width - TR.conf.layout.west_width_subtractor) / 2,
+ displayField: 'name',
+ valueField: 'id',
+ ddReorder: true,
+ queryMode: 'remote',
+ store: TR.store.dataelement.selected,
+ tbar: [
+ ' ',
+ {
+ xtype: 'button',
+ icon: 'images/arrowleftdouble.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.unselectAll(TR.cmp.params.dataelement.available, TR.cmp.params.dataelement.selected);
+ }
+ },
+ {
+ xtype: 'button',
+ icon: 'images/arrowleft.png',
+ width: 22,
+ handler: function() {
+ TR.util.multiselect.unselect(TR.cmp.params.dataelement.available, TR.cmp.params.dataelement.selected);
+ }
+ },
+ '->',
+ {
+ xtype: 'label',
+ text: TR.i18n.selected,
+ cls: 'tr-toolbar-multiselect-right-label'
+ }
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.dataelement.selected = this;
+ },
+ afterrender: function() {
+ this.boundList.on('itemdblclick', function() {
+ TR.util.multiselect.unselect(TR.cmp.params.dataelement.available, this);
+ }, this);
+ }
+ }
+ }
+ ]
+ }
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.params.dataelement.panel = this;
+ },
+ expand: function() {
+ TR.util.multiselect.setHeight(
+ [TR.cmp.params.dataelement.available, TR.cmp.params.dataelement.selected],
+ TR.cmp.params.dataelement.panel
+ );
+ }
+ }
+ }
+
+
+ ]
+ }
+ ]
+ }
+
+
+ ],
+ listeners: {
+ added: function() {
+ TR.cmp.region.west = this;
+ },
+ collapse: function() {
+ this.collapsed = true;
+ TR.cmp.toolbar.resizewest.setText('>>>');
+ },
+ expand: function() {
+ this.collapsed = false;
+ TR.cmp.toolbar.resizewest.setText('<<<');
+ }
+ }
+ },
+ // button for main form
+ {
+ id: 'center',
+ region: 'center',
+ layout: 'fit',
+ bodyStyle: 'padding-top:5px',
+ tbar: {
+ xtype: 'toolbar',
+ cls: 'tr-toolbar',
+ height: TR.conf.layout.center_tbar_height,
+ defaults: {
+ height: 26
+ },
+ items: [
+ {
+ xtype: 'button',
+ name: 'resizewest',
+ cls: 'tr-toolbar-btn-2',
+ text: '<<<',
+ tooltip: TR.i18n.show_hide_settings_panel,
+ handler: function() {
+ var p = TR.cmp.region.west;
+ if (p.collapsed) {
+ p.expand();
+ }
+ else {
+ p.collapse();
+ }
+ },
+ listeners: {
+ added: function() {
+ TR.cmp.toolbar.resizewest = this;
+ }
+ }
+ },
+
+ {
+ xtype: 'button',
+ cls: 'tr-toolbar-btn-1',
+ text: TR.i18n.generate,
+ handler: function() {
+ TR.exe.execute();
+ }
+ },
+ {
+ xtype: 'button',
+ cls: 'tr-toolbar-btn-1',
+ text: TR.i18n.download,
+ execute: function(type) {
+ TR.exe.execute( type );
+ },
+ listeners: {
+ afterrender: function(b) {
+ this.menu = Ext.create('Ext.menu.Menu', {
+ margin: '2 0 0 0',
+ shadow: false,
+ showSeparator: false,
+ items: [
+ {
+ text: TR.i18n.xls,
+ iconCls: 'tr-menu-item-xls',
+ minWidth: 105,
+ handler: function() {
+ b.execute(TR.conf.finals.image.xls);
+ }
+ },
+ {
+ text: TR.i18n.pdf,
+ iconCls: 'tr-menu-item-pdf',
+ minWidth: 105,
+ handler: function() {
+ b.execute(TR.conf.finals.image.pdf);
+ }
+ }
+ ]
+ });
+ }
+ }
+ },
+ '->',
+ {
+ xtype: 'button',
+ cls: 'tr-toolbar-btn-2',
+ text: 'Exit',
+ handler: function() {
+ window.location.href = TR.conf.finals.ajax.path_commons + TR.conf.finals.ajax.redirect;
+ }
+ },
+ ]
+ },
+ bbar: {
+ items: [
+ {
+ xtype: 'panel',
+ cls: 'tr-statusbar',
+ height: 24,
+ listeners: {
+ added: function() {
+ TR.cmp.statusbar.panel = this;
+ }
+ }
+ }
+ ]
+ },
+ listeners: {
+ added: function() {
+ TR.cmp.region.center = this;
+ },
+ resize: function() {
+ if (TR.cmp.statusbar.panel) {
+ TR.cmp.statusbar.panel.setWidth(TR.cmp.region.center.getWidth());
+ }
+ }
+ }
+ },
+ {
+ region: 'east',
+ preventHeader: true,
+ collapsible: true,
+ collapsed: true,
+ collapseMode: 'mini',
+ listeners: {
+ afterrender: function() {
+ TR.cmp.region.east = this;
+ }
+ }
+ }
+ ],
+ listeners: {
+ afterrender: function(vp) {
+ TR.init.initialize(vp);
+ },
+ resize: function(vp) {
+ TR.cmp.region.west.setWidth(TR.conf.layout.west_width);
+
+ TR.util.viewport.resizeParams();
+
+ if (TR.datatable.datatable) {
+ TR.datatable.datatable.setHeight( TR.util.viewport.getSize().y - 68 );
+ }
+ }
+ }
+ });
+
+ }});
+});
\ No newline at end of file
=== added directory 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/css'
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/css/style.css'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/css/style.css 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/css/style.css 2012-04-15 08:08:22 +0000
@@ -0,0 +1,764 @@
+TR.utilbody {
+ font: normal 10px arial,sans-serif,ubuntu,consolas;
+}
+
+.x-body, .x-btn-default-toolbar-small .x-btn-inner, .x-form-item, .x-panel-header-text-default {
+ font-family: arial,sans-serif,ubuntu,consolas;
+}
+
+.x-panel-body {
+ font-size: 11px;
+}
+
+/* Disable class invisible */
+.tr-invisible .x-form-item-body {
+ display: none;
+}
+
+/* Combobox empty text */
+.x-form-empty-field, textarea.x-form-empty-field {
+ font-size: 20px;
+ color: red;
+}
+
+/* Combobox text position*/
+.x-webkit .x-form-empty-field {
+ line-height: 14px;
+}
+
+/* Combobox font size */
+.x-form-text, textarea.x-form-field {
+ font-size: 10px;
+}
+
+/* Combobox border-radius */
+.tr-combo input {
+ -moz-border-radius: 2px 0px 0px 0px;
+ -webkit-border-radius: 2px 0px 0px 0px;
+ -o-border-radius: 2px 0px 0px 0px;
+ -ms-border-radius: 2px 0px 0px 0px;
+ -khtml-border-radius: 2px 0px 0px 0px;
+ border-radius: 2px 0px 0px 0px;
+}
+
+/* Combobox text position */
+.tr-combo .x-form-text {
+ padding-left: 4px;
+}
+
+/* Combobox field label font */
+.x-form-item-label {
+ font: 11px arial,sans-serif,ubuntu,consolas;
+ color: #111;
+}
+
+/* Splitter column */
+.x-splitter {
+ display: none;
+}
+
+/* Fieldset border */
+.x-fieldset {
+ border: 1px solid #ddd;
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+ padding-top: 8px;
+ padding-bottom: 4px;
+}
+
+/* Fieldset header */
+.x-fieldset-header {
+ padding-right: 7px;
+}
+.x-fieldset-header .x-fieldset-header-text {
+ padding-left: 3px;
+}
+
+/* Fieldset trigger icons */
+.tr-fieldset .x-tool img {
+ background-image: url('../images/tool-sprites.gif');
+ width: 25px;
+}
+
+ /* Untoggeled */
+.x-tool-over .x-tool-toggle {
+ background-position: -25px -60px;
+}
+.x-panel-collapsed .x-tool-over .x-tool-toggle, .x-fieldset-collapsed .x-tool-over .x-tool-toggle {
+ background-position: -25px -75px;
+}
+ /* Toggeled */
+.x-tool-down {
+ background-position: 0 -75px;
+}
+
+.x-tool-over .x-tool-down {
+ background-position: -25px -75px;
+}
+
+.x-tool-up {
+ background-position: 0 -60px;
+}
+
+.x-tool-over .x-tool-up {
+ background-position: -25px -60px;
+}
+
+/* Grid / Tree panel font color */
+.x-grid-row .x-grid-cell {
+ color: #222;
+ background-color: transparent;
+ border: 1px solid transparent;
+}
+
+.x-grid-row-selected .x-grid-cell {
+ border: 1px solid transparent;
+}
+
+.x-grid-row-over {
+ background-color: #f1f1f1;
+}
+
+.x-grid-row-over .x-grid-cell-first, .x-grid-row-selected .x-grid-cell-first {
+ -moz-border-radius: 2px 0 0 2px;
+ -webkit-border-radius: 2px 0 0 2px;
+ -o-border-radius: 2px 0 0 2px;
+ -ms-border-radius: 2px 0 0 2px;
+ -khtml-border-radius: 2px 0 0 2px;
+ border-radius: 2px 0 0 2px;
+}
+
+.x-grid-row-over .x-grid-cell-last, .x-grid-row-selected .x-grid-cell-last {
+ -moz-border-radius: 0 2px 2px 0;
+ -webkit-border-radius: 0 2px 2px 0;
+ -o-border-radius: 0 2px 2px 0;
+ -ms-border-radius: 0 2px 2px 0;
+ -khtml-border-radius: 0 2px 2px 0;
+ border-radius: 0 2px 2px 0;
+}
+
+/* TR menu grid */
+.tr-menugrid .x-grid-row .x-grid-cell, .tr-menugrid .x-grid-row-selected .x-grid-cell {
+ border: 0 none;
+ border-top: 1px solid transparent;
+ border-bottom: 1px solid transparent;
+ background: #f1f1f1;
+}
+.tr-menugrid .x-grid-row .x-grid-cell-first, .tr-menugrid .x-grid-row-selected .x-grid-cell-first {
+ border: 1px solid transparent;
+ border-right: 0 none;
+}
+.tr-menugrid .x-grid-row .x-grid-cell-last, .tr-menugrid .x-grid-row-selected .x-grid-cell-last {
+ border: 1px solid transparent;
+ border-left: 0 none;
+}
+
+.tr-menugrid .x-grid-row-over .x-grid-cell {
+ border: 0 none;
+ border-top: 1px solid #9d9d9d;
+ border-bottom: 1px solid #9d9d9d;
+ background-image: none;
+ background-color: #E6E6E6;
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #eeeeee), color-stop(100%, #dcdcdc));
+ background-image: -webkit-linear-gradient(top, #eeeeee,#dcdcdc);
+ background-image: -moz-linear-gradient(top, #eeeeee,#dcdcdc);
+ background-image: -o-linear-gradient(top, #eeeeee,#dcdcdc);
+ background-image: -ms-linear-gradient(top, #eeeeee,#dcdcdc);
+ background-image: linear-gradient(top, #eeeeee,#dcdcdc);
+}
+.tr-menugrid .x-grid-row-over .x-grid-cell-first {
+ border: 1px solid #9d9d9d;
+ border-right: 0 none;
+ -moz-border-radius: 3px 0 0 3px;
+ -webkit-border-radius: 3px 0 0 3px;
+ -o-border-radius: 3px 0 0 3px;
+ -ms-border-radius: 3px 0 0 3px;
+ -khtml-border-radius: 3px 0 0 3px;
+ border-radius: 3px 0 0 3px;
+}
+.tr-menugrid .x-grid-row-over .x-grid-cell-last {
+ border: 1px solid #9d9d9d;
+ border-left: 0 none;
+ -moz-border-radius: 0 3px 3px 0;
+ -webkit-border-radius: 0 3px 3px 0;
+ -o-border-radius: 0 3px 3px 0;
+ -ms-border-radius: 0 3px 3px 0;
+ -khtml-border-radius: 0 3px 3px 0;
+ border-radius: 0 3px 3px 0;
+}
+
+/* Tree panel node height */
+.tr-tree .x-tree-panel .x-grid-row .x-grid-cell-inner {
+ height: 17px;
+}
+
+/* Tree panel selected row background */
+.tr-tree .x-grid-row-selected .x-grid-cell, .tr-tree .x-grid-row-selected .x-grid-rowwrap-div {
+ background-color: #e0e0e0;
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+}
+
+/* Tree panel hover row background */
+.tr-tree .x-grid-cell {
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+}
+
+/* Panel border */
+.x-panel .x-grid-body {
+ border-style: none;
+}
+
+/* Multiselect inner border */
+.x-fit-item {
+ border-style: none;
+}
+
+/* Boundlist (multiselect, comboboxlist etc) */
+.x-boundlist-item {
+ color: #333;
+ padding: 3px 2px 3px 4px;
+ font-size: 10px;
+ border: 1px solid transparent;
+}
+.x-boundlist-item-over {
+ background-color: #f1f1f1;
+ border-color: #f1f1f1;
+}
+.x-boundlist-selected {
+ background-color: #d3d3d3;
+ border-color: #d3d3d3;
+}
+
+/* Checkbox box label */
+.x-form-cb-label-after {
+ padding-left: 1px;
+ font-size: 11px;
+}
+/* TR checkbox */
+.tr-checkbox .x-form-item-label {
+ padding-left: 5px;
+}
+.tr-checkbox .x-form-cb-label-after {
+ margin-left: 3px;
+ font-size: 11px;
+}
+
+/* Checkbox icons */
+.x-form-checkbox {
+ background-image: url('../images/checkbox.gif');
+}
+
+/* TR toolbar checkbox */
+.tr-toolbar .x-form-cb-wrap {
+ padding-top: 5px;
+}
+.tr-toolbar .x-form-cb-label-after {
+ margin-left: 3px;
+ color: #333;
+}
+
+/* Button tr-toolbar font size */
+.tr-toolbar * {
+ font-size: 11px;
+}
+.tr-toolbar .tr-toolbar-btn-1 * {
+ color: #111;
+ font-weight: bold;
+}
+.tr-toolbar .tr-toolbar-btn-2 * {
+ color: #444;
+}
+
+/* Button chart image */
+.x-btn-default-toolbar-small-icon button {
+ width: 32px !important;
+}
+.x-btn-default-toolbar-small-icon .x-btn-icon {
+ width: 32px;
+ height: 32px;
+}
+.x-btn-arrow {
+ background-image: url('../images/arrow.png');
+}
+
+/* Button border */
+.x-btn-default-toolbar-small {
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+ border-width: 1px;
+}
+
+.x-btn-default-toolbar-small-over {
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+ border-color: #aaa;
+ border-style: solid;
+ border-width: 1px;
+}
+
+/* Toolbar separator */
+.x-toolbar .x-toolbar-separator-horizontal {
+ height: 15px;
+ border-right: 1px solid #f2f2f2;
+}
+
+/* Toolbar background */
+.x-toolbar-default {
+ border-color: #D0D0D0;
+ background-image: none;
+ background-color: #f3f3f3;
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f1f1f1), color-stop(100%, #f5f5f5));
+ background-image: -webkit-linear-gradient(top, #f1f1f1,#f5f5f5);
+ background-image: -moz-linear-gradient(top, #f1f1f1,#f5f5f5);
+ background-image: -o-linear-gradient(top, #f1f1f1,#f5f5f5);
+ background-image: -ms-linear-gradient(top, #f1f1f1,#f5f5f5);
+ background-image: linear-gradient(top, #f1f1f1,#f5f5f5);
+}
+
+/* Tooltip */
+.x-tip {
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+ padding: 0 2px;
+ border-width: 2px;
+ border-style: solid;
+ background-color: #f1f1f1;
+}
+
+.x-tip .x-tip-body {
+ padding: 5px;
+}
+
+/* Chart tips (tooltip) */
+.x-tip .x-tip-header .x-box-item {
+ text-align: center;
+}
+
+/* Grid datatable column header */
+.x-column-header-inner .x-column-header-text {
+ font-size: 11px;
+}
+
+/* Grid row/cell text position */
+.x-grid-cell-inner {
+ line-height: 15px;
+ font-size: 10px;
+ cursor: pointer;
+ cursor: hand;
+}
+
+/* Grid datatable column chooser */
+.x-column-header-over .x-column-header-trigger, .x-column-header-open .x-column-header-trigger {
+ display: none;
+}
+
+/* Toolbar second bar chart settings */
+#chartsettings_tb {
+ background: #f5f5f5;
+ padding: 5px 0 0 8px;
+ border-style: none;
+ border-top: 1px dashed #ccc;
+}
+
+#chartoptions_tb {
+ background: #f5f5f5;
+ height: 100%;
+ padding: 6px 0 0 8px;
+ border-top: 2px ridge #e1e1e1;
+ border-right: 0 none;
+ border-bottom: 1px solid #ccc;
+ border-left: 0 none;
+}
+
+/* Toolbar favorites */
+#favorite_t {
+ border-bottom-width: 1px !important;
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+}
+
+/* Multiselect dock border radius */
+.tr-toolbar-multiselect-left .x-docked-top {
+ -o-border-top-left-radius: 2px;
+ -icab-border-top-left-radius: 2px;
+ -khtml-border-top-left-radius: 2px;
+ -moz-border-radius-topleft: 2px;
+ -webkit-border-top-left-radius: 2px;
+ border-top-left-radius: 2px;
+}
+
+.tr-toolbar-multiselect-right .x-docked-top {
+ -o-border-top-right-radius: 2px;
+ -icab-border-top-right-radius: 2px;
+ -khtml-border-top-right-radius: 2px;
+ -moz-border-radius-topright: 2px;
+ -webkit-border-top-right-radius: 2px;
+ border-top-right-radius: 2px;
+}
+
+/* Multiselect docked bar font size */
+.tr-toolbar-multiselect-left .tr-toolbar-multiselect-left-label {
+ font-size: 11px;
+ padding-left: 6px;
+}
+.tr-toolbar-multiselect-right .tr-toolbar-multiselect-right-label {
+ font-size: 11px;
+ padding-right: 7px;
+}
+
+/* Multiselect boundlist */
+.tr-toolbar-multiselect-left .x-boundlist-item-over {
+ background-color: transparent;
+ border-color: transparent;
+}
+.tr-toolbar-multiselect-left .x-boundlist-selected {
+ background-color: #e5e5e5;
+ border-color: #e5e5e5;
+}
+
+.tr-toolbar-multiselect-right .x-boundlist-item-over {
+ background-color: transparent;
+ border-color: transparent;
+}
+.tr-toolbar-multiselect-right .x-boundlist-selected {
+ background-color: #e5e5e5;
+ border-color: #e5e5e5;
+}
+
+/* Menu */
+.x-menu-body {
+ border-color: #bbb;
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+}
+
+/* Treepanel contextmenu */
+#treepanel-contextmenu {
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #aaa;
+}
+
+/* Menu item */
+.x-menu-item-link {
+ padding: 4px 5px 4px 28px;
+}
+
+/* Menu item color */
+.x-menu-item-text {
+ color: #111;
+}
+
+/* Fieldset */
+.tr-fieldset-title-link {
+ color:#000;
+ font-size: 11px;
+ font-weight: bold;
+ text-decoration: none;
+}
+.tr-fieldset-title-link-alt1 {
+ color:#555;
+ font-size: 11px;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+/* Multiselect */
+.tr-multiselect {
+ color: #111;
+}
+
+/* Chart tips */
+.tr-chart-tips .x-tip-body {
+ font-size: 27px;
+}
+.tr-chart-tips-pie .x-tip-body {
+ font-size: 17px;
+}
+
+/* Window */
+.tr-window-title-favorite {
+ padding-left: 19px;
+ background-image: url('../images/favorite.png');
+}
+.tr-window-title-datatable {
+ padding-left: 19px;
+ background-image: url('../images/datatable.png');
+}
+.tr-window-title-messagebox {
+ padding-left: 16px;
+ background-image: url('../images/error_m.png');
+ background-position-y: 1px;
+}
+
+/* Label heading periods */
+.tr-label-period-heading {
+ font-size: 11px;
+ font-weight: bold;
+ color: #444;
+ line-height: 20px;
+}
+
+/* Grid datatable columns */
+.x-grid-header-ct {
+ border-style: none;
+}
+
+/* Grid datatable first row border top */
+.tr-datatable .x-fit-item {
+ border-top: 1px solid #d0d0d0;
+}
+
+/* Menu item icon */
+.tr-menu-item-xls {
+ background-image:url('../images/xls.gif');
+}
+
+.tr-menu-item-pdf {
+ background-image:url('../images/pdf.png');
+}
+
+.tr-menu-item-datatable {
+ background-image:url('../images/datatable.png');
+}
+
+.tr-menu-item-edit {
+ background-image:url('../images/edit.png');
+}
+
+/* Textfield */
+.tr-textfield .x-form-field, .tr-textfield-alt1 .x-form-field {
+ height: 26px;
+ padding-left: 4px;
+ -moz-border-radius: 2px 2px 2px 2px;
+ -webkit-border-radius: 2px 2px 2px 2px;
+ -o-border-radius: 2px 2px 2px 2px;
+ -ms-border-radius: 2px 2px 2px 2px;
+ -khtml-border-radius: 2px 2px 2px 2px;
+ border-radius: 2px 2px 2px 2px;
+ font-size: 11px;
+ color: #333;
+}
+.tr-textfield .x-form-item-label {
+ padding-left: 5px;
+ line-height: 20px;
+}
+.tr-textfield-alt1 .x-form-item-label {
+ padding-left: 5px;
+ line-height: 8px;
+}
+
+/* TR window confirm list */
+.tr-window-confirm-list .x-panel-body {
+ color: #444;
+ font-size: 10px;
+ border-style: none;
+}
+
+/* Button TR menu toggle group */
+.tr-radiogroup .x-form-cb-wrap {
+ padding-left: 7px;
+}
+.tr-radiogroup .x-form-cb-label-after {
+ padding-left: 2px;
+ font-size: 11px;
+ color: #444;
+}
+.tr-radiogroup .x-form-radio-group {
+ padding-top: 5px;
+}
+
+/* TR menu grid icon/text position aligned with menuitem */
+.tr-menugrid .x-grid-cell-inner {
+ padding: 4px 3px;
+ font-size: 10px;
+ color: #444;
+ line-height: 16px;
+}
+
+/* TR menu grid background now looks like a menu */
+.tr-menugrid .x-grid-view {
+ background-color: #f1f1f1;
+}
+
+/* TR messagebox alert */
+.tr-messagebox .x-window-body-default {
+ background-color: #fff;
+ padding: 14px 10px 15px 15px;
+ color: #333;
+ font-size: 11px;
+}
+
+.tr-messagebox .x-toolbar-footer-docked-bottom {
+ display: none;
+}
+
+/* TR statusbar */
+.tr-statusbar .x-panel-body-default {
+ padding: 5px 0 0 6px;
+ border: 0 none;
+ background-color: transparent;
+ color: #111;
+ vertical-align: top;
+ font-size: 10px;
+ line-height: 14px;
+}
+
+/* TR accordion */
+.tr-accordion .x-accordion-item .x-accordion-hd, .tr-accordion .tr-accordion-options .x-accordion-hd { /* accordion title bar, shared */
+ padding: 6px 5px 4px 8px;
+ border: 0 none;
+ cursor: pointer;
+ -o-border-top-left-radius: 1px;
+ -icab-border-top-left-radius: 1px;
+ -khtml-border-top-left-radius: 1px;
+ -moz-border-radius-topleft: 1px;
+ -webkit-border-top-left-radius: 1px;
+ border-top-left-radius: 1px;
+ -o-border-top-right-radius: 1px;
+ -icab-border-top-right-radius: 1px;
+ -khtml-border-top-right-radius: 1px;
+ -moz-border-radius-topright: 1px;
+ -webkit-border-top-right-radius: 1px;
+ border-top-right-radius: 1px;
+}
+.tr-accordion .x-accordion-item .x-accordion-hd { /* accordion title dock, default */
+ background-image: none;
+ background-color: #e0e0e0;
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #dcdcdc), color-stop(100%, #e5e5e5)) !important;
+ background-image: -webkit-linear-gradient(top, #dcdcdc, #e5e5e5) !important;
+ background-image: -moz-linear-gradient(top, #dcdcdc, #e5e5e5) !important;
+ background-image: -o-linear-gradient(top, #dcdcdc, #e5e5e5) !important;
+ background-image: -ms-linear-gradient(top, #dcdcdc, #e5e5e5) !important;
+ background-image: linear-gradient(top, #dcdcdc, #e5e5e5) !important;
+}
+.tr-accordion .tr-accordion-options .x-accordion-hd { /* accordion title dock, options */
+ background-image: none;
+ background-color: #d0d0d0;
+ background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #cccccc), color-stop(100%, #d3d3d3)) !important;
+ background-image: -webkit-linear-gradient(top, #cccccc, #d3d3d3) !important;
+ background-image: -moz-linear-gradient(top, #cccccc, #d3d3d3) !important;
+ background-image: -o-linear-gradient(top, #cccccc, #d3d3d3) !important;
+ background-image: -ms-linear-gradient(top, #cccccc, #d3d3d3) !important;
+ background-image: linear-gradient(top, #cccccc, #d3d3d3) !important;
+}
+.tr-accordion .collapsed .x-accordion-hd { /* accordion title dock, default, collapsed */
+ padding-bottom: 5px !important;
+}
+
+.tr-accordion .x-accordion-item, .tr-accordion-options .x-accordion-item { /* accordion title dock outer, shared */
+ -o-border-top-left-radius: 2px;
+ -icab-border-top-left-radius: 2px;
+ -khtml-border-top-left-radius: 2px;
+ -moz-border-radius-topleft: 2px;
+ -webkit-border-top-left-radius: 2px;
+ border-top-left-radius: 2px;
+ -o-border-top-right-radius: 2px;
+ -icab-border-top-right-radius: 2px;
+ -khtml-border-top-right-radius: 2px;
+ -moz-border-radius-topright: 2px;
+ -webkit-border-top-right-radius: 2px;
+ border-top-right-radius: 2px;
+}
+.tr-accordion .x-accordion-item { /* accordion title dock outer, default */
+ border: 1px solid #c5c5c5;
+ border-bottom: 0 none;
+}
+.tr-accordion .tr-accordion-options { /* accordion title dock outer, options */
+ border: 1px solid #c0c0c0;
+}
+
+.tr-accordion .x-accordion-hd .x-panel-header-text { /* accordion title dock text, shared */
+ font-weight: bold;
+ cursor: pointer;
+}
+
+.tr-accordion .x-accordion-body { /* accordion item body */
+ padding: 8px 8px 2px 8px;
+ border-top: 1px solid #c5c5c5 !important;
+}
+
+.tr-accordion .x-accordion-hd-sibling-expanded {
+ -moz-box-shadow: none;
+ -webkit-box-shadow: none;
+ -o-box-shadow: none;
+ box-shadow: none;
+}
+
+.tr-accordion .tr-toolbar-multiselect-left, .tr-accordion .tr-toolbar-multiselect-right {
+ margin-bottom: 0;
+}
+
+.tr-accordion .tr-combo .x-form-text, .tr-accordion .tr-combo .x-form-trigger { /* accordion combo box */
+ height: 24px;
+ padding-top: 2px;
+}
+.tr-accordion .tr-combo .x-form-item-label { /* accordion combo box label */
+ padding: 4px 0 0;
+}
+
+.x-grid-row-alt
+{
+ background-color: #F4F4F4;
+ border-bottom-color: #CCCCCC;
+ border-bottom-style: solid;
+ border-top-color: #CCCCCC;
+ border-top-style: solid;
+}
+
+.custom-grid .x-grid-row-over .x-grid-cell {
+ background-color: #ff6;
+ border-bottom-color: #999;
+ border-bottom-style: dashed;
+ border-top-color: #999;
+ border-top-style: dashed;
+}
+
+/* Grid cells in the selected row */
+.custom-grid .x-grid-row-selected .x-grid-cell {
+ background-color: #ff0 !important;
+ border-bottom-color: #999;
+ border-bottom-style: solid;
+ border-top-color: #999;
+ border-top-style: solid;
+}
=== added directory 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images'
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowleft.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowleft.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowleft.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowleftdouble.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowleftdouble.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowleftdouble.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowright.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowright.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowright.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowrightdouble.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowrightdouble.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/arrowrightdouble.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/clearFilter.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/clearFilter.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/clearFilter.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/error_m.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/error_m.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/error_m.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/error_s.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/error_s.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/error_s.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/exit.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/exit.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/exit.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/ok.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/ok.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/ok.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/pdf.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/pdf.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/pdf.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/refresh.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/refresh.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/refresh.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/warning.png'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/warning.png 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/warning.png 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/xls.gif'
Binary files dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/xls.gif 1970-01-01 00:00:00 +0000 and dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/images/xls.gif 2012-04-15 08:08:22 +0000 differ
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/index.html'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/index.html 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/app/index.html 2012-04-15 08:08:22 +0000
@@ -0,0 +1,16 @@
+<html>
+<head>
+ <title>DHIS 2 Beneficary Tabular Report</title>
+ <link rel="stylesheet" type="text/css" href="../../dhis-web-commons/javascripts/ext/resources/css/ext-all-gray.css" />
+ <link rel="stylesheet" type="text/css" href="css/style.css" />
+</head>
+
+<body>
+ <script type="text/javascript">TR = {};</script>
+ <script type="text/javascript" src="i18n.action"></script>
+ <script type="text/javascript" src="../../dhis-web-commons/javascripts/ext/ext-all.js"></script>
+
+ <script type="text/javascript" src="app.js"></script>
+
+</body>
+</html>
=== added 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 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/i18n.vm 2012-04-15 08:08:22 +0000
@@ -0,0 +1,37 @@
+TR.i18n = {
+title:'$encoder.jsEscape($i18n.getString( 'title' ) , "'")',
+programs: '$encoder.jsEscape($i18n.getString( 'program' ) , "'")',
+identifier:'$encoder.jsEscape($i18n.getString( 'identifier' ) , "'")',
+attribute:'$encoder.jsEscape($i18n.getString( 'attribute' ) , "'")',
+start_date:'$encoder.jsEscape($i18n.getString( 'start_date' ) , "'")',
+end_date:'$encoder.jsEscape($i18n.getString( 'end_date' ) , "'")',
+et_no_programs:'$encoder.jsEscape($i18n.getString( 'et_no_programs' ) , "'")',
+data_element:'$encoder.jsEscape($i18n.getString( 'data_element' ) , "'")',
+program_stage:'$encoder.jsEscape($i18n.getString( 'program_stage' ) , "'")',
+please_select:'[' + '$encoder.jsEscape($i18n.getString( 'please_select' ) , "'")' + ']',
+all_attribute_groups:'$encoder.jsEscape($i18n.getString( 'all_attribute_groups' ) , "'")',
+format_date: 'Y-m-d',
+use_data_from_level:'$encoder.jsEscape($i18n.getString( 'use_data_from_level' ) , "'")',
+use_data_from_level:'$encoder.jsEscape($i18n.getString( 'use_data_from_level' ) , "'")',
+all: '$encoder.jsEscape($i18n.getString( 'all' ) , "'")',
+children_only: '$encoder.jsEscape($i18n.getString( 'children_only' ) , "'")',
+selected: '$encoder.jsEscape($i18n.getString( 'selected' ) , "'")',
+show_hierachy_from_level: '$encoder.jsEscape($i18n.getString( 'show_hierachy_from_level' ) , "'")',
+report_unit: '$encoder.jsEscape($i18n.getString( 'report_unit' ) , "'")',
+report_date: '$encoder.jsEscape($i18n.getString( 'report_date' ) , "'")',
+et_no_dataelement:'$encoder.jsEscape($i18n.getString( 'et_no_dataelement' ) , "'")',
+download:'$encoder.jsEscape($i18n.getString( 'download' ) , "'")',
+xls:'$encoder.jsEscape($i18n.getString( 'xls' ) , "'")',
+pdf:'$encoder.jsEscape($i18n.getString( 'pdf' ) , "'")',
+filter:'$encoder.jsEscape($i18n.getString( 'filter' ) , "'")',
+cancel:'$encoder.jsEscape($i18n.getString( 'cancel' ) , "'")',
+clear:'$encoder.jsEscape($i18n.getString( 'clear' ) , "'")',
+show_hide_settings_panel:'$encoder.jsEscape($i18n.getString( 'show_hide_settings_panel' ) , "'")',
+updating:'$encoder.jsEscape($i18n.getString( 'updating' ) , "'")',
+data_table:'$encoder.jsEscape($i18n.getString( 'data_table' ) , "'")',
+page:'$encoder.jsEscape($i18n.getString( 'page' ) , "'")',
+loading:'$encoder.jsEscape($i18n.getString( 'loading' ) , "'")',
+generate:'$encoder.jsEscape($i18n.getString( 'generate' ) , "'")',
+et_no_data : '$encoder.jsEscape($i18n.getString( 'et_no_data' ) , "'")',
+
+};
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm 2012-03-07 02:40:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/index.vm 2012-04-15 08:08:22 +0000
@@ -7,7 +7,7 @@
#introListImgItem( "multipledataEntrySelect.action" "multiple_name_based_data_entry" "dataentry" )
#introListImgItem( "anonymousRegistration.action" "anonymous_events" "dataentry" )
#introListImgItem( "reportSelect.action" "program_summary" "summaryreport" )
- #introListImgItem( "tabularReportSelect.action" "tabular_report" "summaryreport" )
+ #introListImgItem( "app/index.html" "tabular_report" "summaryreport" )
#introListImgItem( "visitplan.action" "visit_plan" "visitplan" )
#introListImgItem( "caseAggregationForm.action" "case_aggregation" "caseaggregation" )
</ul>
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonIdentifierTypes.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonIdentifierTypes.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonIdentifierTypes.vm 2012-04-15 08:08:22 +0000
@@ -0,0 +1,10 @@
+#set( $size = ${identifierTypes.size()} )
+{ "identifierTypes": [
+ #foreach( ${identifierType} in $!{identifierTypes} )
+ {
+ "id": "${identifierType.id}",
+ "name": "$!encoder.jsonEncode( ${identifierType.name} )"
+ }#if( $velocityCount < $size ),#end
+ #end
+ ]
+}
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStages.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStages.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonProgramStages.vm 2012-04-15 08:08:22 +0000
@@ -0,0 +1,11 @@
+#set( $size = ${programStages.size()} )
+{ "programStages": [
+ #foreach( ${programStage} in $!{programStages} )
+ {
+ "id": "${programStage.id}",
+ "name": "$!encoder.jsonEncode( ${programStage.name} )",
+ "anonymous": "${programStage.anonymous}"
+ }#if( $velocityCount < $size ),#end
+ #end
+ ]
+}
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularInitialize.vm 2012-04-15 08:08:22 +0000
@@ -0,0 +1,34 @@
+{
+ "user":
+ {
+ "id":"$!currentUser.id",
+ "isAdmin":true,
+ "ou":[
+ "$!currentUser.organisationUnit.id",
+ "$!encoder.jsonEncode(${currentUser.organisationUnit.name})"
+ ]
+ },
+ "rn":[
+ "$!{rootNode.id}",
+ "$!encoder.jsonEncode(${rootNode.name})"
+ ],
+
+ "programs": [
+ #foreach( $program in $programs )
+ {
+ "id": "${program.id}" ,
+ "name": "$!encoder.jsonEncode( ${program.name} )",
+ "anonymous": "$program.anonymous"
+ }#if( $velocityCount < $programs.size() ),#end
+ #end
+ ],
+
+ "levels": [
+ #foreach( $level in $levels )
+ {
+ "value": "${level.level}" ,
+ "name": "${level.level}"
+ }#if($velocityCount < $levels.size()),#end
+ #end
+ ]
+}
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonTabularReport.vm 2012-04-15 08:08:22 +0000
@@ -0,0 +1,71 @@
+{
+#if( $grid.getRows().size() > 0)
+ #set( $noHeader = $grid.getRows().get(0).size() )
+ 'total': "$total",
+ 'valueTypes':[
+ {"valueType": "", "suggestedValues":[]},
+ {"valueType": "", "suggestedValues":[]},
+ {"valueType": "", "suggestedValues":[]},
+ #set( $index = 0 )
+ #foreach( $valueType in $valueTypes )
+ {
+ "valueType":
+ #if( $valueType == 'number' || $valueType == 'NUMBER' )
+ "textfield"
+ #elseif( $valueType == 'bool' || $valueType == 'YES/NO' || $valueType =='optionSet' )
+ "combobox"
+ #elseif( $valueType == 'date' || $valueType == 'DATE' )
+ "textfield"
+ #else
+ "textfield"
+ #end,
+
+ #set( $suggestedValues = $mapSuggestedValues.get($index) )
+ "suggestedValues":[
+ #foreach( $suggestedValue in $suggestedValues )
+ ["$!encoder.jsonEncode( ${suggestedValue} )"]
+ #if( $velocityCount < $suggestedValues.size() ),#end
+ #end
+ ]
+ }
+ #if( $velocityCount < $valueTypes.size() ),#end
+ #set( $index = $index + 1 )
+ #end
+ ],
+ 'fields':[
+ "id",
+ #foreach( $col in $grid.getRows().get(0) )
+ "col$velocityCount"
+ #if( $velocityCount < $noHeader ),#end
+ #end
+ ],
+ 'items':[
+ {
+ "id":"$i18n.getString( 'filter' )",
+ "col1": "",
+ "col2": "",
+ #set( $index = 3 )
+ #foreach( $value in $values )
+ "col$index": "$value"
+ #if( $velocityCount < $values.size() ),#end
+ #set( $index = $index + 1 )
+ #end
+ },
+ #foreach( $row in $grid.getRows() )
+ {
+ #set( $nr = ( ( $paging.getCurrentPage() - 1 ) * $paging.pageSize ) + $velocityCount )
+ "id":$nr,
+ #foreach( $col in $row )
+ "col$velocityCount": "$!encoder.htmlEncode( $col )"
+ #if( $velocityCount < $noHeader ),#end
+ #end
+ },
+ #end
+ ]
+#else
+ 'total': 0,
+ 'valueTypes':[],
+ 'fields':[],
+ 'items':[]
+#end
+}
\ No newline at end of file
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonminOrganisationUnitChildren.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonminOrganisationUnitChildren.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/jsonminOrganisationUnitChildren.vm 2012-04-15 08:08:22 +0000
@@ -0,0 +1,1 @@
+#set($size = $units.size())[#foreach($unit in $units){"id":${unit.id},"level":${unit.level},"text":"$encoder.jsonEncode(${unit.name})"#if(!$unit.hasChild()),"leaf":true#end}#if($velocityCount < $size),#end#end]
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm 2012-03-07 02:40:08 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/menu.vm 2012-04-15 08:08:22 +0000
@@ -14,7 +14,7 @@
<h2>$i18n.getString( "reports" ) </h2>
<ul>
<li><a href="reportSelect.action">$i18n.getString( "program_summary" ) </a></li>
- <li><a href="tabularReportSelect.action"> $i18n.getString( "tabular_report" ) </a></li>
+ <li><a href="app/index.html"> $i18n.getString( "tabular_report" ) </a></li>
</ul>
<h2>$i18n.getString( "activity_planning" ) </h2>
=== added file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseIdentifierTypes.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseIdentifierTypes.vm 1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responseIdentifierTypes.vm 2012-04-15 08:08:22 +0000
@@ -0,0 +1,29 @@
+#set( $size = $identifierTypes.size() )
+{
+"identifierTypes": [
+ #foreach( $identifierType in $identifierTypes )
+ {
+ "id": ${identifierType.id} ,
+ "name": "$!encoder.jsonEncode( ${identifierType.name} )"
+ }#if( $velocityCount < $size ),#end
+ #end],
+
+#set( $size = $attributes.size() )
+"patientAttributes": [
+ #foreach( $attribute in $attributes )
+ {
+ "id": ${attribute.id} ,
+ "name": "$!encoder.jsonEncode( ${attribute.name} )"
+ }#if( $velocityCount < $size ),#end
+ #end],
+
+#set( $size = $programStages.size() )
+"programStages": [
+ #foreach( $programStage in $programStages )
+ {
+ "id": ${programStage.id} ,
+ "name": "$!encoder.jsonEncode( ${programStage.name} )",
+ "irregular":${programStage.irregular}
+ }#if( $velocityCount < $size ),#end
+ #end]
+}
\ No newline at end of file
=== modified file 'dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm'
--- dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm 2012-03-09 04:46:32 +0000
+++ dhis-2/dhis-web/dhis-web-caseentry/src/main/webapp/dhis-web-caseentry/responsePrograms.vm 2012-04-15 08:08:22 +0000
@@ -5,7 +5,7 @@
{
"id": ${program.id} ,
"name": "$!encoder.jsonEncode( ${program.name} )",
- "singleEvent": "$program.singleEvent"
+ "anonymous": "$program.anonymous"
}#if( $velocityCount < $size ),#end
#end]
}
\ No newline at end of file