dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #12133
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3652: Merging Code from 2.1 For Data Analyser
------------------------------------------------------------
revno: 3652
committer: Mithilesh Kumar Thakur<mithilesh.hisp@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-05-18 16:42:17 +0530
message:
Merging Code from 2.1 For Data Analyser
added:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusDataSetWiseFormAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusDataSetWiseResultAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GetPeriodsForDataSetWiseAction.java
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseFront.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseResult.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePeriodForDataSetWise.vm
modified:
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterFormAction.java
local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterResultAction.java
local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml
local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties
local/in/dhis-web-dashboard/src/main/resources/struts.xml
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/css/StylesForTags.css
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/nr.js
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReporterFront.vm
local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReporterResult.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
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusDataSetWiseFormAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusDataSetWiseFormAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusDataSetWiseFormAction.java 2011-05-18 11:12:17 +0000
@@ -0,0 +1,66 @@
+package org.hisp.dhis.dataanalyser.ds.action;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
+
+import com.opensymphony.xwork2.Action;
+
+public class GenerateDataStatusDataSetWiseFormAction implements Action
+{
+
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private PeriodService periodService;
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+
+
+ // -------------------------------------------------------------------------
+ // Input & Output
+ // -------------------------------------------------------------------------
+ private List<PeriodType> periodTypes;
+
+ public List<PeriodType> getPeriodTypes()
+ {
+ return periodTypes;
+ }
+ // -------------------------------------------------------------------------
+ // Action Implementation
+ // -------------------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+ /* Periods Type */
+ periodTypes = new ArrayList<PeriodType>( periodService.getAllPeriodTypes() );
+
+ Iterator<PeriodType> periodTypeIterator = periodTypes.iterator();
+ while ( periodTypeIterator.hasNext() )
+ {
+ PeriodType type = periodTypeIterator.next();
+ if ( type.getName().equalsIgnoreCase("Daily") || type.getName().equalsIgnoreCase("Weekly") || type.getName().equalsIgnoreCase("Monthly") || type.getName().equalsIgnoreCase("quarterly") || type.getName().equalsIgnoreCase("yearly") )
+ {
+ }
+ else
+ {
+ periodTypeIterator.remove();
+ }
+ }
+/*
+ for( PeriodType type : periodTypes )
+ {
+ System.out.println( "Period Type Name is : " + type.getName() + ", Period Type Id is : " + type.getId() );
+ }
+
+*/ return SUCCESS;
+ }
+}
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusDataSetWiseResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusDataSetWiseResultAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GenerateDataStatusDataSetWiseResultAction.java 2011-05-18 11:12:17 +0000
@@ -0,0 +1,658 @@
+package org.hisp.dhis.dataanalyser.ds.action;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import jxl.format.Alignment;
+import jxl.format.Border;
+import jxl.format.BorderLineStyle;
+import jxl.format.Colour;
+import jxl.write.WritableCellFormat;
+
+import org.hisp.dhis.dataanalyser.util.DashBoardService;
+import org.hisp.dhis.dataelement.DataElement;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.options.displayproperty.DisplayPropertyHandler;
+import org.hisp.dhis.organisationunit.OrganisationUnit;
+import org.hisp.dhis.organisationunit.OrganisationUnitLevel;
+import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
+import org.hisp.dhis.organisationunit.comparator.OrganisationUnitShortNameComparator;
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.jdbc.support.rowset.SqlRowSet;
+
+import com.opensymphony.xwork2.Action;
+
+public class GenerateDataStatusDataSetWiseResultAction implements Action
+{
+
+ // ---------------------------------------------------------------
+ // Dependencies
+ // ---------------------------------------------------------------
+
+ private JdbcTemplate jdbcTemplate;
+
+ public void setJdbcTemplate( JdbcTemplate jdbcTemplate )
+ {
+ this.jdbcTemplate = jdbcTemplate;
+ }
+
+ private OrganisationUnitService organisationUnitService;
+
+ public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
+ {
+ this.organisationUnitService = organisationUnitService;
+ }
+
+ public OrganisationUnitService getOrganisationUnitService()
+ {
+ return organisationUnitService;
+ }
+
+ private PeriodService periodService;
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+ private DataSetService dataSetService;
+
+ public void setDataSetService( DataSetService dataSetService )
+ {
+ this.dataSetService = dataSetService;
+ }
+
+ private DashBoardService dashBoardService;
+
+ public void setDashBoardService( DashBoardService dashBoardService )
+ {
+ this.dashBoardService = dashBoardService;
+ }
+ // ---------------------------------------------------------------
+ // Input Parameters
+ // ---------------------------------------------------------------
+
+ private String periodTypeId;
+
+ public void setPeriodTypeId( String periodTypeId )
+ {
+ this.periodTypeId = periodTypeId;
+ }
+
+ private int sDateLB;
+
+ public void setSDateLB( int dateLB )
+ {
+ sDateLB = dateLB;
+ }
+
+ private int eDateLB;
+
+ public void setEDateLB( int dateLB )
+ {
+ eDateLB = dateLB;
+ }
+
+ private String facilityLB;
+
+ public void setFacilityLB( String facilityLB )
+ {
+ this.facilityLB = facilityLB;
+ }
+
+ private List<String> orgUnitListCB;
+
+ public void setOrgUnitListCB( List<String> orgUnitListCB )
+ {
+ this.orgUnitListCB = orgUnitListCB;
+ }
+
+ private String includeZeros;
+
+ public void setIncludeZeros( String includeZeros )
+ {
+ this.includeZeros = includeZeros;
+ }
+
+ public String getIncludeZeros()
+ {
+ return includeZeros;
+ }
+
+ private List<OrganisationUnit> orgUnitList;
+
+ public List<OrganisationUnit> getOrgUnitList()
+ {
+ return orgUnitList;
+ }
+
+ private DisplayPropertyHandler displayPropertyHandler;
+
+ public void setDisplayPropertyHandler( DisplayPropertyHandler displayPropertyHandler )
+ {
+ this.displayPropertyHandler = displayPropertyHandler;
+ }
+
+ private Collection<Period> periodList;
+
+ public Collection<Period> getPeriodList()
+ {
+ return periodList;
+ }
+
+ private List<DataSet> dataSetList;
+
+ public List<DataSet> getDataSetList()
+ {
+ return dataSetList;
+ }
+
+ private List<String> periodNameList;
+
+ public List<String> getPeriodNameList()
+ {
+ return periodNameList;
+ }
+
+ private int maxOULevel;
+
+ public int getMaxOULevel()
+ {
+ return maxOULevel;
+ }
+
+ private int minOULevel;
+
+ public int getMinOULevel()
+ {
+ return minOULevel;
+ }
+
+ String orgUnitInfo;
+
+
+ List<String> levelNames;
+
+ public List<String> getLevelNames()
+ {
+ return levelNames;
+ }
+
+ String deInfo;
+
+
+ String periodInfo;
+
+ private int dataSetMemberCount1;
+
+ public int getDataSetMemberCount1()
+ {
+ return dataSetMemberCount1;
+ }
+
+ //Set<Source> dso;
+
+ private Map<OrganisationUnit, Integer> ouMapForChildDSAssociation;
+
+ public Map<OrganisationUnit, Integer> getOuMapForChildDSAssociation()
+ {
+ return ouMapForChildDSAssociation;
+ }
+
+ private Map<OrganisationUnit, Integer> ouMapForColor;
+
+ public Map<OrganisationUnit, Integer> getOuMapForColor()
+ {
+ return ouMapForColor;
+ }
+
+ int orgUnitCount;
+
+ private Map<OrganisationUnit, List<Integer>> ouMapStatusResult;
+
+ public Map<OrganisationUnit, List<Integer>> getOuMapStatusResult()
+ {
+ return ouMapStatusResult;
+ }
+
+ private Map<OrganisationUnit, List<Integer>> ouMapSummaryStatusResult;
+
+ public Map<OrganisationUnit, List<Integer>> getOuMapSummaryStatusResult()
+ {
+ return ouMapSummaryStatusResult;
+ }
+ private Map<OrganisationUnit, List<Integer>> ouDataSetMapColor;
+
+ public Map<OrganisationUnit, List<Integer>> getOuDataSetMapColor()
+ {
+ return ouDataSetMapColor;
+ }
+
+ // ---------------------------------------------------------------
+ // Action Implementation
+ // ---------------------------------------------------------------
+
+ public String execute() throws Exception
+ {
+
+ System.out.println( "DataSet Wise Data Status Generation Start Time is : " + new Date() );
+ // Intialization
+ periodNameList = new ArrayList<String>();
+ //dataViewName = "";
+ ouMapForChildDSAssociation = new HashMap<OrganisationUnit, Integer>();
+ ouMapForColor = new HashMap<OrganisationUnit, Integer>();
+ orgUnitCount = 0;
+
+ ouMapStatusResult = new HashMap<OrganisationUnit, List<Integer>>();
+ ouMapSummaryStatusResult = new HashMap<OrganisationUnit, List<Integer>>();
+ //dsMapSummaryStatusResult = new HashMap<DataSet, Map<OrganisationUnit, List<Integer>>>();
+
+ ouDataSetMapColor = new HashMap<OrganisationUnit, List<Integer>>();
+
+ // Period Related Info
+ PeriodType periodType = periodService.getPeriodTypeByName( periodTypeId );
+
+ Period startPeriod = periodService.getPeriod( sDateLB );
+ Period endPeriod = periodService.getPeriod( eDateLB );
+ periodList = new ArrayList<Period>( periodService.getPeriodsBetweenDates( periodType, startPeriod.getStartDate(), endPeriod.getEndDate() ));
+
+ periodNameList = dashBoardService.getPeriodNamesByPeriodType( periodType, periodList );
+
+ maxOULevel = 1;
+ minOULevel = organisationUnitService.getNumberOfOrganisationalLevels();
+
+ // OrgUnit Related Info
+ OrganisationUnit selectedOrgUnit = new OrganisationUnit();
+ orgUnitList = new ArrayList<OrganisationUnit>();
+ if ( facilityLB.equals( "children" ) )
+ {
+ selectedOrgUnit = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitListCB.get( 0 ) ) );
+ orgUnitList = getChildOrgUnitTree( selectedOrgUnit );
+ }
+ else if ( facilityLB.equals( "immChildren" ) )
+ {
+ @SuppressWarnings( "unused" )
+ int number;
+
+ selectedOrgUnit = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitListCB.get( 0 ) ) );
+ number = selectedOrgUnit.getChildren().size();
+ orgUnitList = new ArrayList<OrganisationUnit>();
+
+ Iterator<String> orgUnitIterator = orgUnitListCB.iterator();
+ while ( orgUnitIterator.hasNext() )
+ {
+ OrganisationUnit o = organisationUnitService.getOrganisationUnit( Integer
+ .parseInt( (String) orgUnitIterator.next() ) );
+ orgUnitList.add( o );
+ List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>( o.getChildren() );
+ Collections.sort( organisationUnits, new OrganisationUnitShortNameComparator() );
+ orgUnitList.addAll( organisationUnits );
+ }
+ }
+ else
+ {
+ Iterator<String> orgUnitIterator = orgUnitListCB.iterator();
+ OrganisationUnit o;
+ while ( orgUnitIterator.hasNext() )
+ {
+ o = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitIterator.next() ) );
+ orgUnitList.add( o );
+ Collections.sort( orgUnitList, new OrganisationUnitShortNameComparator() );
+ displayPropertyHandler.handle( orgUnitList );
+ }
+ }
+
+ // OrgUnit Related Info for Data Set
+ List<OrganisationUnit> tempOrGUnitList = new ArrayList<OrganisationUnit>();
+ Iterator<String> orgUnitIterator = orgUnitListCB.iterator();
+ while( orgUnitIterator.hasNext())
+ {
+ OrganisationUnit orgUnit = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitIterator.next() ) );
+ List<OrganisationUnit> orgUnitChildList = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( orgUnit.getId() ) );
+ tempOrGUnitList.addAll( orgUnitChildList );
+ }
+
+ // DataSet Related Info
+ dataSetList = new ArrayList<DataSet>( dataSetService.getDataSetsByPeriodType( periodType ) );
+
+ String query = "";
+ String query2 = "";
+ String orgUnitId = "";
+ Iterator<DataSet> dsIterator = dataSetList.iterator();
+ while( dsIterator.hasNext() )
+ {
+ DataSet dSet = dsIterator.next();
+ //List<Source> dso = new ArrayList<Source>( dSet.getSources() );
+ List<OrganisationUnit> dso = new ArrayList<OrganisationUnit>( dSet.getSources() );
+
+ if( dso == null || dso.size() == 0 )
+ {
+ dsIterator.remove();
+ continue;
+ }
+
+ int flag = 1;
+ for( OrganisationUnit orgUnit : tempOrGUnitList )
+ {
+ if( dso.contains( orgUnit) )
+ {
+ flag = 2;
+ break;
+ }
+ }
+
+ if( flag == 1 )
+ {
+ dsIterator.remove();
+ continue;
+ }
+
+ dataSetMemberCount1 = 0;
+ for ( DataElement de : dSet.getDataElements() )
+ {
+ deInfo += "," + de.getId();
+ dataSetMemberCount1 += de.getCategoryCombo().getOptionCombos().size();
+ }
+
+ Iterator<OrganisationUnit> orgUnitListIterator = orgUnitList.iterator();
+ while ( orgUnitListIterator.hasNext() )
+ {
+ OrganisationUnit orgUnit = orgUnitListIterator.next();
+ orgUnitInfo = "" + orgUnit.getId();
+ if ( maxOULevel < organisationUnitService.getLevelOfOrganisationUnit( orgUnit ) )
+ maxOULevel = organisationUnitService.getLevelOfOrganisationUnit( orgUnit );
+
+ if ( minOULevel > organisationUnitService.getLevelOfOrganisationUnit( orgUnit ) )
+ minOULevel = organisationUnitService.getLevelOfOrganisationUnit( orgUnit );
+
+ Iterator<Period> periodIterator = periodList.iterator();
+ Period p;
+ double dataStatusPercentatge;
+ List<Integer> dsResults = new ArrayList<Integer>();
+ List<Integer> dsSummaryResults = new ArrayList<Integer>();
+
+ List<Integer> dsColors = new ArrayList<Integer>();
+
+ List<OrganisationUnit> childOrgUnits = new ArrayList<OrganisationUnit>();
+
+ if ( !dso.contains( orgUnit ) )
+ {
+ childOrgUnits = filterChildOrgUnitsByDataSet( orgUnit, dso );
+ ouMapForChildDSAssociation.put( orgUnit, childOrgUnits.size() );
+ //ouMapForColor.put( orgUnit, 0 );
+
+ }
+ else
+ {
+ ouMapForChildDSAssociation.put( orgUnit, -1 );
+ //ouMapForColor.put( orgUnit, 1 );
+ }
+
+ while ( periodIterator.hasNext() )
+ {
+ p = (Period) periodIterator.next();
+ periodInfo = "" + p.getId();
+
+ if ( dso == null )
+ {
+ dsResults.add( -1 );
+ dsSummaryResults.add( -1 );
+ ouMapForChildDSAssociation.put( orgUnit, -1 );
+
+ dsColors.add( 1 );
+ continue;
+ }
+ else if ( !dso.contains( orgUnit ) )
+ {
+ if( childOrgUnits == null || childOrgUnits.size() <= 0 )
+ {
+ dsResults.add( -2 );
+ dsSummaryResults.add( -2 );
+ ouMapForChildDSAssociation.put( orgUnit, -1 );
+
+ dsColors.add( 1 );
+ continue;
+ }
+
+ int dataStatusCount = 0;
+ Iterator<OrganisationUnit> assignedChildrenIterator = childOrgUnits.iterator();
+ while ( assignedChildrenIterator.hasNext() )
+ {
+ OrganisationUnit cUnit = (OrganisationUnit) assignedChildrenIterator.next();
+ orgUnitInfo = "-1";
+ orgUnitId = "-1,";
+ orgUnitId += String.valueOf( cUnit.getId() );
+ orgUnitCount = 0;
+ getOrgUnitInfo( orgUnit, dso );
+ if ( includeZeros == null )
+ {
+ query = "SELECT COUNT(*) FROM datavalue WHERE dataelementid IN (" + deInfo
+ + ") AND sourceid IN (" + orgUnitId + ") AND periodid IN (" + periodInfo
+ + ") and value <> 0";
+ }
+ else
+ {
+ query = "SELECT COUNT(*) FROM datavalue WHERE dataelementid IN (" + deInfo
+ + ") AND sourceid IN (" + orgUnitId + ") AND periodid IN (" + periodInfo + ")";
+ }
+
+ SqlRowSet sqlResultSet = jdbcTemplate.queryForRowSet( query );
+
+ if ( sqlResultSet.next() )
+ {
+ try
+ {
+ dataStatusPercentatge = ((double) sqlResultSet.getInt( 1 ) / (double) (dataSetMemberCount1)) * 100.0;
+ }
+ catch ( Exception e )
+ {
+ dataStatusPercentatge = 0.0;
+ }
+ }
+ else
+ dataStatusPercentatge = 0.0;
+
+ if ( dataStatusPercentatge > 100.0 )
+ dataStatusPercentatge = 100;
+
+ dataStatusPercentatge = Math.round( dataStatusPercentatge * Math.pow( 10, 0 ) )
+ / Math.pow( 10, 0 );
+
+ if ( dataStatusPercentatge >= 5.0 )
+ {
+ dataStatusCount += 1;
+ }
+ }
+
+ dsSummaryResults.add( dataStatusCount );
+ Double tempDouble = ( (double) dataStatusCount /(double) childOrgUnits.size() ) * 100.0;
+ tempDouble = Math.round( tempDouble * Math.pow( 10, 0 ) ) / Math.pow( 10, 0 );
+ dsResults.add( tempDouble.intValue() );
+
+ dsColors.add( 0 );
+ continue;
+ }
+ orgUnitInfo = "" + orgUnit.getId();
+
+ if ( includeZeros == null )
+ {
+ query2 = "SELECT COUNT(*) FROM datavalue WHERE dataelementid IN (" + deInfo
+ + ") AND sourceid IN (" + orgUnitInfo + ") AND periodid IN (" + periodInfo + ") and value <> 0";
+ }
+ else
+ {
+ query2 = "SELECT COUNT(*) FROM datavalue WHERE dataelementid IN (" + deInfo
+ + ") AND sourceid IN (" + orgUnitInfo + ") AND periodid IN (" + periodInfo + ")";
+ }
+
+ SqlRowSet sqlResultSet = jdbcTemplate.queryForRowSet( query2 );
+ if ( sqlResultSet.next() )
+ {
+ try
+ {
+ dataStatusPercentatge = ((double) sqlResultSet.getInt( 1 ) / (double) dataSetMemberCount1) * 100.0;
+ }
+ catch ( Exception e )
+ {
+ dataStatusPercentatge = 0.0;
+ }
+ }
+ else
+ dataStatusPercentatge = 0.0;
+
+ if ( dataStatusPercentatge > 100.0 )
+ dataStatusPercentatge = 100;
+
+ dataStatusPercentatge = Math.round( dataStatusPercentatge * Math.pow( 10, 0 ) ) / Math.pow( 10, 0 );
+
+ if ( dataStatusPercentatge >= 5.0 )
+ {
+ dsSummaryResults.add( 1 );
+ }
+ else
+ {
+ dsSummaryResults.add( 0 );
+ }
+
+ dsResults.add( -1 );
+ dsColors.add( 1 );
+
+ }
+
+ List<Integer> tempIntList = ouMapSummaryStatusResult.get( orgUnit );
+ if( tempIntList != null )
+ {
+ tempIntList.addAll( dsSummaryResults );
+ }
+ else
+ {
+ tempIntList = dsSummaryResults;
+ }
+
+ List<Integer> tempdsResultList = ouMapStatusResult.get( orgUnit );
+ if( tempdsResultList != null )
+ {
+ tempdsResultList.addAll( dsResults );
+ }
+ else
+ {
+ tempdsResultList = dsResults;
+ }
+
+ List<Integer> tempDsColorList = ouDataSetMapColor.get( orgUnit );
+ if( tempDsColorList != null )
+ {
+ tempDsColorList.addAll( dsColors );
+ }
+ else
+ {
+ tempDsColorList = dsColors;
+ }
+
+
+ ouMapSummaryStatusResult.put( orgUnit, tempIntList );
+ ouMapStatusResult.put( orgUnit, tempdsResultList );
+ ouDataSetMapColor.put( orgUnit, tempDsColorList );
+ }
+
+ }
+
+ // For Level Names
+
+ String ouLevelNames[] = new String[organisationUnitService.getNumberOfOrganisationalLevels() + 1];
+ for ( int i = 0; i < ouLevelNames.length; i++ )
+ {
+ ouLevelNames[i] = "Level" + i;
+ }
+
+ List<OrganisationUnitLevel> ouLevels = new ArrayList<OrganisationUnitLevel>( organisationUnitService.getFilledOrganisationUnitLevels() );
+ for ( OrganisationUnitLevel ouL : ouLevels )
+ {
+ ouLevelNames[ouL.getLevel()] = ouL.getName();
+ }
+
+ levelNames = new ArrayList<String>();
+ int count1 = minOULevel;
+
+ //System.out.println("Min Level is : " + minOULevel + ", Max Level is " + maxOULevel );
+
+ while ( count1 <= maxOULevel )
+ {
+ //System.out.println("Inside Level name Assign Loop" );
+ levelNames.add( ouLevelNames[count1] );
+ count1++;
+ }
+ System.out.println( "DataSet Wise Data Status Generation End Time is : " + new Date() );
+ return SUCCESS;
+
+ }
+
+ // Returns the OrgUnitTree for which Root is the orgUnit
+ @SuppressWarnings( "unchecked" )
+ public List<OrganisationUnit> getChildOrgUnitTree( OrganisationUnit orgUnit )
+ {
+ List<OrganisationUnit> orgUnitTree = new ArrayList<OrganisationUnit>();
+ orgUnitTree.add( orgUnit );
+
+ List<OrganisationUnit> children = new ArrayList<OrganisationUnit>( orgUnit.getChildren() );
+ Collections.sort( children, new OrganisationUnitNameComparator() );
+
+ Iterator childIterator = children.iterator();
+ OrganisationUnit child;
+ while ( childIterator.hasNext() )
+ {
+ child = (OrganisationUnit) childIterator.next();
+ orgUnitTree.addAll( getChildOrgUnitTree( child ) );
+ }
+ return orgUnitTree;
+ }// getChildOrgUnitTree end
+
+ private List<OrganisationUnit> filterChildOrgUnitsByDataSet( OrganisationUnit selectedOrganisationUnit, List<OrganisationUnit> dso )
+ {
+ List<OrganisationUnit> filteredOrganisationUnits = new ArrayList<OrganisationUnit>( organisationUnitService.getOrganisationUnitWithChildren( selectedOrganisationUnit.getId() ) );
+ filteredOrganisationUnits.retainAll( dso );
+ return filteredOrganisationUnits;
+ }
+
+ private void getOrgUnitInfo( OrganisationUnit organisationUnit, List<OrganisationUnit> dso )
+ {
+ Collection<OrganisationUnit> children = organisationUnit.getChildren();
+ Iterator<OrganisationUnit> childIterator = children.iterator();
+ OrganisationUnit child;
+
+ while ( childIterator.hasNext() )
+ {
+ child = childIterator.next();
+ if ( dso.contains( child ) )
+ {
+ orgUnitInfo += "," + child.getId();
+ orgUnitCount++;
+ }
+ getOrgUnitInfo( child, dso );
+ }
+ }
+
+ public WritableCellFormat getCellFormat1() throws Exception
+ {
+ WritableCellFormat wCellformat = new WritableCellFormat();
+
+ wCellformat.setBorder( Border.ALL, BorderLineStyle.THIN );
+ wCellformat.setAlignment( Alignment.CENTRE );
+ wCellformat.setBackground( Colour.GRAY_25 );
+ wCellformat.setWrap( true );
+
+ return wCellformat;
+ }
+
+}
=== added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GetPeriodsForDataSetWiseAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GetPeriodsForDataSetWiseAction.java 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/ds/action/GetPeriodsForDataSetWiseAction.java 2011-05-18 11:12:17 +0000
@@ -0,0 +1,139 @@
+package org.hisp.dhis.dataanalyser.ds.action;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hisp.dhis.period.Period;
+import org.hisp.dhis.period.PeriodService;
+import org.hisp.dhis.period.PeriodType;
+import org.hisp.dhis.period.comparator.PeriodComparator;
+
+import com.opensymphony.xwork2.Action;
+
+public class GetPeriodsForDataSetWiseAction implements Action
+{
+ // -------------------------------------------------------------------------
+ // Dependencies
+ // -------------------------------------------------------------------------
+
+ private PeriodService periodService;
+
+ public void setPeriodService( PeriodService periodService )
+ {
+ this.periodService = periodService;
+ }
+
+ // -------------------------------------------------------------------------
+ // Input & output
+ // -------------------------------------------------------------------------
+
+ private String id;
+
+ public void setId( String id )
+ {
+ this.id = id;
+ }
+
+ private List<Period> periods;
+
+ public List<Period> getPeriods()
+ {
+ return periods;
+ }
+
+ private List<String> periodNameList;
+
+ public List<String> getPeriodNameList()
+ {
+ return periodNameList;
+ }
+
+ private SimpleDateFormat simpleDateFormat1;
+
+ private SimpleDateFormat simpleDateFormat2;
+
+ // -------------------------------------------------------------------------
+ // Action implementation
+ // -------------------------------------------------------------------------
+
+ public String execute()
+ throws Exception
+ {
+ periodNameList = new ArrayList<String>();
+ System.out.println( "Period Type Id is : " + id );
+ PeriodType periodType = periodService.getPeriodTypeByName( id );
+
+ periods = new ArrayList<Period>( periodService.getPeriodsByPeriodType( periodType ) );
+
+ Iterator<Period> periodIterator = periods.iterator();
+ while( periodIterator.hasNext() )
+ {
+ Period p1 = periodIterator.next();
+
+ if ( p1.getStartDate().compareTo( new Date() ) > 0 )
+ {
+ periodIterator.remove( );
+ }
+
+ }
+ Collections.sort( periods, new PeriodComparator() );
+
+ if ( periodType.getName().equalsIgnoreCase( "monthly" ) )
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "MMM-yyyy" );
+ for ( Period p1 : periods )
+ {
+ periodNameList.add( simpleDateFormat1.format( p1.getStartDate() ) );
+ }
+ }
+ else if ( periodType.getName().equalsIgnoreCase( "quarterly" ) )
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "MMM" );
+ simpleDateFormat2 = new SimpleDateFormat( "MMM yyyy" );
+
+ for ( Period p1 : periods )
+ {
+ String tempPeriodName = simpleDateFormat1.format( p1.getStartDate() ) + " - "
+ + simpleDateFormat2.format( p1.getEndDate() );
+ periodNameList.add( tempPeriodName );
+ }
+ }
+ else if ( periodType.getName().equalsIgnoreCase( "yearly" ) )
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "yyyy" );
+
+ for ( Period p1 : periods )
+ {
+ //year = Integer.parseInt( simpleDateFormat1.format( p1.getStartDate() ) ) + 1;
+ //periodNameList.add( simpleDateFormat1.format( p1.getStartDate() ) + "-" + year );
+ periodNameList.add( simpleDateFormat1.format( p1.getStartDate() ) );
+ }
+ }
+ else if ( periodType.getName().equalsIgnoreCase( "daily" ) )
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "yyyy-MM-dd" );
+
+ for ( Period p1 : periods )
+ {
+ periodNameList.add( simpleDateFormat1.format( p1.getStartDate() ) );
+ }
+ }
+ else
+ {
+ simpleDateFormat1 = new SimpleDateFormat( "yyyy-MM-dd" );
+ for ( Period p1 : periods )
+ {
+ String tempPeriodName = simpleDateFormat1.format( p1.getStartDate() ) + " - "
+ + simpleDateFormat1.format( p1.getEndDate() );
+ periodNameList.add( tempPeriodName );
+ }
+ }
+
+ return SUCCESS;
+ }
+
+}
\ No newline at end of file
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterFormAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterFormAction.java 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterFormAction.java 2011-05-18 11:12:17 +0000
@@ -32,21 +32,16 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
-import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementGroup;
-import org.hisp.dhis.dataelement.DataElementService;
-import org.hisp.dhis.dataelement.comparator.DataElementGroupNameComparator;
-import org.hisp.dhis.dataelement.comparator.DataElementNameComparator;
+import org.hisp.dhis.dataset.DataSet;
+import org.hisp.dhis.dataset.DataSetService;
+import org.hisp.dhis.dataset.comparator.DataSetNameComparator;
import org.hisp.dhis.organisationunit.OrganisationUnit;
-import org.hisp.dhis.organisationunit.OrganisationUnitService;
-import org.hisp.dhis.period.MonthlyPeriodType;
import org.hisp.dhis.period.Period;
-import org.hisp.dhis.period.PeriodService;
-import org.hisp.dhis.period.comparator.PeriodComparator;
import com.opensymphony.xwork2.Action;
@@ -57,27 +52,13 @@
// Dependencies
// -------------------------------------------------------------------------
-
- private DataElementService dataElementService;
-
- public void setDataElementService( DataElementService dataElementService )
- {
- this.dataElementService = dataElementService;
- }
-
- private PeriodService periodService;
-
- public void setPeriodService(PeriodService periodService) {
- this.periodService = periodService;
- }
-
- @SuppressWarnings("unused")
- private OrganisationUnitService organisationUnitService;
-
- public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
- {
- this.organisationUnitService = organisationUnitService;
- }
+ private DataSetService dataSetService;
+
+ public void setDataSetService( DataSetService dataSetService )
+ {
+ this.dataSetService = dataSetService;
+ }
+
// -------------------------------------------------------------------------
// Comparator
@@ -146,35 +127,50 @@
{
return simpleDateFormat;
}
+
+ private List<DataSet> dataSetList;
+ public List<DataSet> getDataSetList()
+ {
+ return dataSetList;
+ }
+
+
public String execute()
throws Exception
{
- /* DataElements and Groups */
- dataElements = new ArrayList<DataElement>(dataElementService.getAllDataElements());
- dataElementGroups = new ArrayList<DataElementGroup>(dataElementService.getAllDataElementGroups());
-
- Collections.sort( dataElements, new DataElementNameComparator() );
- Collections.sort( dataElementGroups, new DataElementGroupNameComparator() );
-
- /* Monthly Periods */
- monthlyPeriods = new ArrayList<Period>( periodService.getPeriodsByPeriodType( new MonthlyPeriodType() ) );
-
- Iterator<Period> periodIterator = monthlyPeriods.iterator();
- while( periodIterator.hasNext() )
+ /* DataSet List */
+
+ dataSetList = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
+
+ Iterator<DataSet> dataSetListIterator = dataSetList.iterator();
+
+ while(dataSetListIterator.hasNext())
{
- Period p1 = periodIterator.next();
-
- if ( p1.getStartDate().compareTo( new Date() ) > 0 )
- {
- periodIterator.remove( );
- }
-
+ DataSet d = (DataSet) dataSetListIterator.next();
+
+
+ if ( d.getSources().size() <= 0 )
+ {
+ dataSetListIterator.remove();
+ }
+ else
+ {
+ // -------------------------------------------------------------------------
+ // Added to remove Indian Linelisting datasets
+ // -------------------------------------------------------------------------
+
+ if ( d.getId() == 8 || d.getId() == 9 || d.getId() == 10 || d.getId() == 14
+ || d.getId() == 15 || d.getId() == 35 || d.getId() == 36 || d.getId() == 37
+ || d.getId() == 38 )
+ {
+ dataSetListIterator.remove();
+ }
+ }
}
- Collections.sort( monthlyPeriods, new PeriodComparator() );
- simpleDateFormat = new SimpleDateFormat( "MMM - y" );
-
+ Collections.sort( dataSetList, new DataSetNameComparator() );
+
return SUCCESS;
}
=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterResultAction.java'
--- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterResultAction.java 2010-12-29 16:17:28 +0000
+++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dataanalyser/nr/action/GenerateNullReporterResultAction.java 2011-05-18 11:12:17 +0000
@@ -3,11 +3,14 @@
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.amplecode.quick.StatementManager;
import org.hisp.dhis.aggregation.AggregationService;
import org.hisp.dhis.dataelement.DataElement;
import org.hisp.dhis.dataelement.DataElementCategoryCombo;
@@ -20,7 +23,6 @@
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.organisationunit.comparator.OrganisationUnitNameComparator;
-import org.hisp.dhis.period.MonthlyPeriodType;
import org.hisp.dhis.period.Period;
import org.hisp.dhis.period.PeriodService;
import org.hisp.dhis.period.PeriodType;
@@ -28,9 +30,6 @@
import com.opensymphony.xwork2.Action;
-import java.util.Collections;
-import org.amplecode.quick.StatementManager;
-
public class GenerateNullReporterResultAction
implements Action
{
@@ -305,6 +304,20 @@
}
private Map<OrganisationUnit, Integer> ouChildCountMap;
+
+ private String selectedDataSet;
+
+ public void setSelectedDataSet( String selectedDataSet )
+ {
+ this.selectedDataSet = selectedDataSet;
+ }
+
+ private String dataSetName;
+
+ public String getDataSetName()
+ {
+ return dataSetName;
+ }
// ---------------------------------------------------------------
// Action Implementation
@@ -312,8 +325,9 @@
public String execute()
throws Exception
{
- statementManager.initialise();
+ statementManager.initialise();
// VelocityContext context = new VelocityContext();
+ System.out.println( "Null Report Generation Start Time is : " + new Date() );
simpleDateFormat = new SimpleDateFormat( "MMM y" );
nullReportResult = new HashMap<OrganisationUnit, Map<Period, List<DataElement>>>();
@@ -360,8 +374,8 @@
maxOuLevel = minOULevel;
}
- Period startDate = periodService.getPeriod( sDateLB );
- Period endDate = periodService.getPeriod( eDateLB );
+ //Period startDate = periodService.getPeriod( sDateLB );
+ //Period endDate = periodService.getPeriod( eDateLB );
List<OrganisationUnit> ouHavingNullValuesWithHigherLevel = new ArrayList<OrganisationUnit>();
ouHavingNullValuesWithLowerLevel = new ArrayList<OrganisationUnit>();
ouHavingNullValues = new ArrayList<OrganisationUnit>();
@@ -369,35 +383,32 @@
dePeriodTypeMap = new HashMap<DataElement, PeriodType>();
// periodDeListMap = new HashMap<Period, List<DataElement>>();
-
- for ( String deid : selectedDataElements )
+
+ DataSet dataSet = dataSetService.getDataSet( Integer.parseInt( selectedDataSet ) );
+ dataSetName = dataSet.getName();
+ // Collection<DataElement> dataElements = dataSet.getDataElements();
+ List<DataElement> dataElementList = new ArrayList<DataElement>( dataSet.getDataElements() );
+
+
+
+ //System.out.println("----------------Data Element Size is ------- " + dataElementList.size() );
+
+ for ( DataElement dataElement : dataElementList )
{
- DataElement de1 = dataElementService.getDataElement( Integer.parseInt( deid ) );
-
- dataSetList = new ArrayList<DataSet>( dataSetService.getAllDataSets() );
-
- int flag = 0;
- for ( DataSet ds : dataSetList )
- {
- if ( ds.getDataElements().contains( de1 ) )
- {
- dePeriodTypeMap.put( de1, ds.getPeriodType() );
- flag = 1;
- break;
- }
- }
- if ( flag == 0 )
- {
- dePeriodTypeMap.put( de1, new MonthlyPeriodType() );
- }
-
+ DataElement de1 = dataElementService.getDataElement( dataElement.getId() );
+ dePeriodTypeMap.put( de1, dataSet.getPeriodType() );
deList.add( de1 );
}
-
- periodsColl = new ArrayList<Period>( periodService.getIntersectingPeriods( startDate.getStartDate(), endDate
- .getEndDate() ) );
+
+
+ Period startPeriod = periodService.getPeriod( sDateLB );
+ Period endPeriod = periodService.getPeriod( eDateLB );
+ PeriodType dataSetPeriodType = dataSet.getPeriodType();
+ periodsColl = new ArrayList<Period>( periodService.getPeriodsBetweenDates( dataSetPeriodType, startPeriod.getStartDate(), endPeriod.getEndDate() ));
+
+ //periodsColl = new ArrayList<Period>( periodService.getIntersectingPeriods( startDate.getStartDate(), endDate.getEndDate() ) );
size = periodsColl.size();
- // System.out.println("periods size is "+size);
+ // System.out.println("periods size is " + size );
Collections.sort( periodsColl, new PeriodTypeComparator() );
periods = new ArrayList<Period>();
@@ -414,7 +425,7 @@
for ( DataElement de : deList )
{
- if ( (dePeriodTypeMap.get( de ).equals( p.getPeriodType() )) )
+ if ( ( dePeriodTypeMap.get( de ).equals( p.getPeriodType() )) )
{
double aggValue = 0;
if ( ouSelCB != null )
@@ -535,14 +546,14 @@
}
}
}
+ // System.out.println("---------------Size of data element List is " + resultDeList.size() );
if ( resultDeList.size() != 0 )
{
periodDeListMap.put( p, resultDeList );
// nullReportResult.put(curOu, periodDeListMap);
}
}
- // System.out.println("----------------------- " +
- // periodDeListMap.size() + " " + curOu );
+ //System.out.println("----------------------- " + periodDeListMap.size() + " " + curOu );
if ( periodDeListMap.size() != 0 )
{
@@ -585,10 +596,13 @@
{
size = 0;
}
+
+ //System.out.println("periods size is " + size );
Collections.sort( ouHavingNullValues, new OrganisationUnitNameComparator() );
Collections.sort( periods, new PeriodComparator() );
Collections.sort( periods, new PeriodTypeComparator() );
- statementManager.destroy();
+ statementManager.destroy();
+ System.out.println( "Null Report Generation End Time is : " + new Date() );
return SUCCESS;
}
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml'
--- local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2011-03-01 09:42:21 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2011-05-18 11:12:17 +0000
@@ -587,6 +587,45 @@
<property name="jdbcTemplate" ref="jdbcTemplate"/>
</bean>
+ <!-- DataStatus Data Set Wise -->
+ <bean id="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusDataSetWiseFormAction"
+ class="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusDataSetWiseFormAction"
+ scope="prototype">
+ <property name="periodService">
+ <ref bean="org.hisp.dhis.period.PeriodService"/>
+ </property>
+ </bean>
+
+ <bean id="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusDataSetWiseResultAction"
+ class="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusDataSetWiseResultAction"
+ scope="prototype">
+ <property name="dashBoardService">
+ <ref bean="org.hisp.dhis.dataanalyser.util.DashBoardService"/>
+ </property>
+ <property name="dataSetService">
+ <ref bean="org.hisp.dhis.dataset.DataSetService"/>
+ </property>
+ <property name="periodService">
+ <ref bean="org.hisp.dhis.period.PeriodService"/>
+ </property>
+ <property name="organisationUnitService">
+ <ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
+ </property>
+ <property name="jdbcTemplate" ref="jdbcTemplate"/>
+ </bean>
+
+
+ <bean id="org.hisp.dhis.dataanalyser.ds.action.GetPeriodsForDataSetWiseAction"
+ class="org.hisp.dhis.dataanalyser.ds.action.GetPeriodsForDataSetWiseAction"
+ scope="prototype">
+ <property name="periodService">
+ <ref bean="org.hisp.dhis.period.PeriodService"/>
+ </property>
+ </bean>
+
+
+
+
<!-- DataStatus For Mobile start -->
<bean id="org.hisp.dhis.dataanalyser.ds.mobile.action.GenerateDataStatusMobileFormAction"
@@ -872,7 +911,7 @@
<bean id="org.hisp.dhis.dataanalyser.nr.action.GenerateNullReporterFormAction"
class="org.hisp.dhis.dataanalyser.nr.action.GenerateNullReporterFormAction"
scope="prototype">
- <property name="dataElementService">
+<!-- <property name="dataElementService">
<ref bean="org.hisp.dhis.dataelement.DataElementService"/>
</property>
<property name="periodService">
@@ -880,7 +919,11 @@
</property>
<property name="organisationUnitService">
<ref bean="org.hisp.dhis.organisationunit.OrganisationUnitService"/>
- </property>
+ </property>-->
+ <property name="dataSetService">
+ <ref bean="org.hisp.dhis.dataset.DataSetService"></ref>
+
+ </property>
</bean>
<bean id="org.hisp.dhis.dataanalyser.nr.action.GenerateNullReporterResultAction"
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties'
--- local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties 2011-03-01 09:42:21 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/org/hisp/dhis/dataanalyser/i18n_module.properties 2011-05-18 11:12:17 +0000
@@ -94,6 +94,7 @@
organisation_unit_group_wise_data_entry_status_for = Organisation Unit Group Wise Data Entry Status For
organisation_unit_group = Organisation Unit Group
+
#-------DataStatus Null Reporter---------------------------#
nr_null_reporter = Null Reporter
@@ -120,6 +121,9 @@
oup_period = Period
oup_report = Report
oup_viewprofile = View Profile
-
-compare_view = Compare/View By
+compare_view = Compare/View By
+ds_dataset_wise = Data Status - Data Set Wise
+dsform_datasetwise = Data Status Form Data Set Wise
+ds_periodtype = Period Type
+select_periodtype = Select Period Type
=== modified file 'local/in/dhis-web-dashboard/src/main/resources/struts.xml'
--- local/in/dhis-web-dashboard/src/main/resources/struts.xml 2011-01-17 06:56:53 +0000
+++ local/in/dhis-web-dashboard/src/main/resources/struts.xml 2011-05-18 11:12:17 +0000
@@ -373,6 +373,30 @@
<param name="stylesheets">css/StylesForTags.css</param>
</action>
+ <!-- DataStatus Data Set Wise -->
+ <action name="dataStatusDataSetWiseForm"
+ class="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusDataSetWiseFormAction">
+ <result name="success" type="velocity">/main.vm</result>
+ <param name="page">/dhis-web-dashboard/dataStatusDataSetWiseFront.vm</param>
+ <param name="menu">/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm</param>
+ <param name="javascripts">../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ds.js,javascript/db.js,javascript/date.js,javascript/hashtable.js</param>
+ <param name="stylesheets">css/StylesForTags.css</param>
+ <interceptor-ref name="organisationUnitTreeStack"/>
+ </action>
+
+ <action name="dataStatusDataSetWiseResult"
+ class="org.hisp.dhis.dataanalyser.ds.action.GenerateDataStatusDataSetWiseResultAction">
+ <result name="success" type="velocity">/dhis-web-dashboard/dataStatusDataSetWiseResult.vm</result>
+ <param name="javascripts">javascript/ds.js,javascript/hashtable.js</param>
+ <param name="stylesheets">css/StylesForTags.css</param>
+ </action>
+
+ <action name="getPeriodsForDataSetWise"
+ class="org.hisp.dhis.dataanalyser.ds.action.GetPeriodsForDataSetWiseAction">
+ <result name="success" type="velocity-xml">/dhis-web-dashboard/responsePeriodForDataSetWise.vm</result>
+ <param name="onExceptionReturn">plainTextError</param>
+ </action>
+
<!-- DataStatus For Mobile start-->
<action name="dataStatusMobileForm"
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/css/StylesForTags.css'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/css/StylesForTags.css 2010-12-29 07:47:36 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/css/StylesForTags.css 2011-05-18 11:12:17 +0000
@@ -58,7 +58,7 @@
white-space: nowrap;
cursor: default;
text-align: center;
- border:1px dotted #C0C0C0;
+ border:1px solid #000000;
}
.TableHeadingCellStyles {
@@ -66,7 +66,7 @@
font-size: 11px;
white-space: nowrap;
cursor: default;
- border:1px dotted #C0C0C0;
+ border:1px solid #000000;
}
.DefaultFontStyles {
@@ -88,6 +88,6 @@
font-size: 11px;
white-space: wrap;
cursor: default;
- border:1px dotted #C0C0C0;
+ border:1px solid #000000;
}
=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseFront.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseFront.vm 2011-05-18 11:12:17 +0000
@@ -0,0 +1,62 @@
+<style type='text/css'>
+ .hidden{ display: none; }
+</style>
+
+<script>
+ // Global Variables
+ var selCategory = "";
+ var selFacility = "";
+ var ouName = "";
+ var dsName = "";
+ var sDateIndex = 0;
+ var eDateIndex = 0;
+ var sDate = "";
+ var eDate = "";
+ var curPeriodType = "";
+</script>
+
+<h3>$i18n.getString( "dsform_datasetwise" )</h3>
+<hr />
+
+<form id="ChartGenerationDataSetWiseForm" name="ChartGenerationDataSetWiseForm" action="dataStatusDataSetWiseResult.action" onsubmit="return formValidationsDataStatusDataSetWise()" method="get" target="chartWindow1">
+ <table align="center" style="border-collapse: collapse; margin-top: 0;" cellpadding="0" cellspacing="0" width="80%" border="0">
+ <tr>
+ <td class="NormalB">
+ 1. $i18n.getString( "ds_periodtype" ) : <br/>
+ <select id="periodTypeId" name="periodTypeId" onchange="getPeriodsForDataSetWise()" style="width:200px">
+ <option value="NA">[ $i18n.getString( "select_periodtype" ) ]</option>
+ #foreach ( $periodType in $periodTypes )
+ <option value='$periodType.name' title='$periodType.name'>$periodType.name</option>
+ #end
+ </select>
+ <br/><br/>
+ 2. $i18n.getString( "ga_from" )<br />
+ <select id="sDateLB" name="sDateLB" style="width:200px"></select>
+ <br/><br/>
+ 3. $i18n.getString( "ga_to" )<br />
+ <select id="eDateLB" name="eDateLB" style="width:200px"></select>
+ <br/><br/>
+ 4. $i18n.getString( "ga_facilityby" )<br/>
+ <select id="facilityLB" name="facilityLB" onchange="facilityChangeDataSetWiseFunction(event)" style="width:200px">
+ <option value="random" >Selected</option>
+ <option value="immChildren" selected>Immediate Children</option>
+ <option value="children" >Child Tree</option>
+ </select>
+ </td>
+ <td class="NormalB">
+ <input type="checkbox" name="includeZeros" id="includeZeros" checked> Include Zero
+ <br/><br/>
+ 5. $i18n.getString( "ga_orgunit" )<br />
+ <select name="orgUnitListCB" id="orgUnitListCB" multiple style="width:200px;height:100px" ondblclick="remOUDataSetWiseFunction()">
+ </select>
+ <br/><br/>
+ <input type="submit" name="ViewSummary" value="View DataSummary" style="width:200px" />
+ </td>
+ </tr>
+ </table>
+ <input type="hidden" name="selectedButton" id="selectedButton"/>
+</form>
+
+<script>
+ //getdSetPeriods();
+</script>
\ No newline at end of file
=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseResult.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusDataSetWiseResult.vm 2011-05-18 11:12:17 +0000
@@ -0,0 +1,125 @@
+
+<html>
+ <head>
+ <title>SummaryStatus Result</title>
+ <link type="text/css" rel="stylesheet" media="screen" href="css/StylesForTags.css">
+ <script>
+ var startDate = "$sDateLB";
+ var endDate = "$eDateLB";
+ var dsType = "$selectedButton";
+
+ function getImmChildInfo(evt, dsId, selOrgUnit)
+ {
+ immChildOption = "yes";
+
+ if( document.getElementById('includeZeros').checked )
+ {
+ evt.target.href = "summaryStatusResult.action?immChildOption="+immChildOption+"&dsId="+dsId+"&sDateLB="+startDate+"&eDateLB="+endDate+"&ouId="+selOrgUnit+"&selectedButton="+dsType+"&includeZeros="+includeZeros;
+ }
+ else
+ {
+ evt.target.href = "summaryStatusResult.action?immChildOption="+immChildOption+"&dsId="+dsId+"&sDateLB="+startDate+"&eDateLB="+endDate+"&ouId="+selOrgUnit+"&selectedButton="+dsType;
+ }
+ }
+
+ function exportDataStatusResultToWorkBook()
+ {
+ document.getElementById('htmlCode').value = document.getElementById('formResult').innerHTML;
+
+ return true;
+ }
+ </script>
+ </head>
+
+ <body>
+ <form id="form1" name="form1" action="exportDataStatusToExcel.action" method="post" onsubmit="return exportDataStatusResultToWorkBook()" target="_newtab">
+ <input type="hidden" name="htmlCode" id="htmlCode" />
+ <div align="right" class="NormalB">
+ <input type="checkbox" name="includeZeros" id="includeZeros" #if($includeZeros) checked #end /> Include Zero<br />
+ <input type="submit" name="ExportToWorkBook" value="Export To WorkBook" style="width: 160; height: 25; font-family:Arial; font-weight:bold; color:#000000">
+ </div>
+
+ <div id="formResult">
+
+ <div align="center" class="NormalB">Dataset wise Summary Status</div>
+ <div align="right">
+ <table width="15%" border="1">
+ <tr class="TableHeadingCellStyles" >
+ <td bgcolor="#a0c0a0"> </td>
+ <td align="left"> Entered ( 1 )</td>
+ </tr>
+ <tr class="TableHeadingCellStyles">
+ <td bgcolor="#ff0000"> </td>
+ <td align="left"> Not Entered ( 0 )</td>
+ </tr>
+ <tr class="TableHeadingCellStyles">
+ <td bgcolor="white"> </td>
+ <td align="left"> Not Assigned</td>
+ </tr>
+ </table>
+ </div>
+ <br /><br />
+
+ <div id="headingInfoId">
+ <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-style: solid" bordercolor="black" width="100%">
+
+ <tr class="TableHeadingCellStyles" align="center">
+ #foreach($levelName in $levelNames)
+ <td bgcolor="#C0C0C0" rowspan="2"><strong>$!levelName</strong></td>
+ #end
+ #foreach($dataSet in $dataSetList)
+ <td align="center" bgcolor="#C0C0C0" colspan="$periodNameList.size()"><strong>$dataSet.name</strong></td>
+ #end
+ </tr>
+ <tr class="TableHeadingCellStyles" align="center">
+ #foreach($dataSet in $dataSetList)
+ #foreach($periodname in $periodNameList)
+ <td bgcolor="#C0C0C0"><strong>$periodname</strong></td>
+ #end
+ #end
+ </tr>
+ #foreach($chiildorgUnit in $orgUnitList)
+ #set( $count1 = $minOULevel )
+ #set( $curOrgUnitLevel = $organisationUnitService.getLevelOfOrganisationUnit( $chiildorgUnit ) )
+ #set( $orgunitCount = $ouMapForChildDSAssociation.get( $chiildorgUnit ) )
+ ##set( $orgunitColor = $ouDataSetMapColor.get( $chiildorgUnit ) )
+
+ <tr class="TableHeadingCellStyles">
+ #foreach( $levelName in $levelNames )
+ #if( $count1 == $curOrgUnitLevel )
+ <td>$chiildorgUnit.name #if( $orgunitCount !=-1 ) ( $orgunitCount ) #end</td>
+ #else
+ <td> </td>
+ #end
+ #set($count1 = $count1 + 1)
+ #end
+
+ #set( $dsSummaryResults = $ouMapSummaryStatusResult.get( $chiildorgUnit ) )
+ #set( $dsStatusResults = $ouMapStatusResult.get( $chiildorgUnit ) )
+ #set( $orgunitColors = $ouDataSetMapColor.get( $chiildorgUnit ) )
+ #set( $count2 = 0 )
+
+ #foreach( $result in $dsSummaryResults )
+
+ #set( $dsStatusResult = $dsStatusResults.get( $count2 ) )
+ #set( $orgunitColor = $orgunitColors.get( $count2 ) )
+
+ #if($result < 0)
+ <td bgcolor="white"> </td>
+ #elseif( $result == 0 )
+ <td align="center" #if( $orgunitColor == 1 ) bgcolor="#ff0000" #end><font #if( $orgunitColor == 1 ) color="#ffffff" #end>0 #if( $dsStatusResult != -1 ) ( $dsStatusResult % )#end</font></td>
+ #elseif( $result == 1 )
+ <td align="center" #if( $orgunitColor == 1 ) bgcolor="#a0c0a0" #end><font #if( $orgunitColor == 1 ) color="#ffffff" #end>1 #if( $dsStatusResult != -1 ) ( $dsStatusResult % )#end</font></td>
+ #elseif( $result > 1 )
+ <td align="center" #if( $orgunitColor == 1 ) bgcolor="#a0c0a0" #end><font #if( $orgunitColor == 1 ) color="#ffffff" #end>$result #if( $dsStatusResult != -1 ) ( $dsStatusResult % )#end </font></td>
+ #end
+ #set($count2 = $count2 + 1)
+ #end
+ </tr>
+ #end
+ </table>
+ </div>
+ </div>
+ </form>
+ </body>
+</html>
\ No newline at end of file
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js 2011-04-29 13:45:23 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js 2011-05-18 11:12:17 +0000
@@ -361,4 +361,170 @@
document.ChartGenerationForm.ouNameTB.value = orgUnitName;
//document.reportForm.ouLevelTB.value = level;
}
-}
\ No newline at end of file
+}
+
+
+//Data Status for DataSet wise
+
+function getPeriodsForDataSetWise()
+{
+ var periodTypeList = document.getElementById('periodTypeId');
+ var periodTypeId = periodTypeList.options[periodTypeList.selectedIndex].value;
+ if ( periodTypeId != "NA" )
+ {
+ $.post("getPeriodsForDataSetWise.action",
+ {
+ id : periodTypeId
+ },
+ function (data)
+ {
+ getPeriodsForDataSetWiseReceived(data);
+ },'xml');
+ }
+
+}
+
+function getPeriodsForDataSetWiseReceived(xmlObject)
+{
+ var sDateLBObj = document.getElementById("sDateLB");
+ var eDateLBObj = document.getElementById("eDateLB");
+
+ clearList(sDateLBObj);
+ clearList(eDateLBObj);
+
+ var periods = xmlObject.getElementsByTagName("period");
+
+ for ( var i = 0; i < periods.length; i++ )
+ {
+ var id = periods[i].getElementsByTagName("id")[0].firstChild.nodeValue;
+ var periodName = periods[i].getElementsByTagName("periodname")[0].firstChild.nodeValue;
+
+ $("#sDateLB").append("<option value='"+ id +"'>" + periodName + "</option>");
+ $("#eDateLB").append("<option value='"+ id +"'>" + periodName + "</option>");
+ }
+}
+
+//DataStatus Data set wise Form Validations
+function formValidationsDataStatusDataSetWise()
+{
+ var selOUListLength = document.ChartGenerationDataSetWiseForm.orgUnitListCB.options.length;
+ //var selOUListIndex = document.ChartGenerationDataSetWiseForm.orgUnitListCB.selectedIndex;
+ var periodType = document.ChartGenerationDataSetWiseForm.periodTypeId.value;
+ var selOUListIndex = document.ChartGenerationDataSetWiseForm.orgUnitListCB.options.length;
+
+ if( periodType == "NA" )
+ {
+ alert("Please Select Period Type"); return false;
+ }
+ else
+ {
+ var startPeriodObj = document.getElementById('sDateLB');
+ var endPeriodObj = document.getElementById('eDateLB');
+
+ sDateTxt = startPeriodObj.options[startPeriodObj.selectedIndex].text;
+ sDate = formatDate(new Date(getDateFromFormat(sDateTxt,"MMM-y")),"yyyy-MM-dd");
+ eDateTxt = endPeriodObj.options[endPeriodObj.selectedIndex].text;
+ eDate = formatDate(new Date(getDateFromFormat(eDateTxt,"MMM-y")),"yyyy-MM-dd");
+ }
+
+ if(sDateIndex < 0)
+ {
+ alert("Please Select Starting Period"); return false;
+ }
+ else if(eDateIndex < 0)
+ {
+ alert("Please Select Ending Period"); return false;
+ }
+ else if(sDate > eDate)
+ {
+ alert("Starting Date is Greater"); return false;
+ }
+ else if( selOUListIndex <= 0 )
+ {
+ alert("Please Select OrganisationUnit(s)"); return false;
+ }
+
+
+ var k=0;
+
+ for(k=0;k<selOUListIndex;k++)
+ {
+ document.ChartGenerationDataSetWiseForm.orgUnitListCB.options[k].selected = true;
+ }
+
+ var sWidth = 850;
+ var sHeight = 650;
+ var LeftPosition=(screen.width)?(screen.width-sWidth)/2:100;
+ var TopPosition=(screen.height)?(screen.height-sHeight)/2:100;
+
+ window.open('','chartWindow1','width=' + sWidth + ', height=' + sHeight + ', ' + 'left=' + LeftPosition + ', top=' + TopPosition + ', ' + 'location=no, menubar=no, ' + 'status=no, toolbar=no, scrollbars=yes, resizable=yes');
+
+ return true;
+
+}
+//DataStatus Data set wise Form Validations
+//Facility ListBox Change Function
+function facilityChangeDataSetWiseFunction(evt)
+{
+ selFacility = $("select#facilityLB").val();
+ if(selFacility == "children" || selFacility == "immChildren")
+ {
+ var index = document.ChartGenerationDataSetWiseForm.orgUnitListCB.options.length;
+ for(i=0;i<index;i++)
+ {
+ document.ChartGenerationDataSetWiseForm.orgUnitListCB.options[0] = null;
+ }
+ }
+}
+
+// facilityChangeDataSetWiseFunction end
+
+
+
+
+// Removes slected orgunits from the Organisation List
+ function remOUDataSetWiseFunction()
+ {
+ var index = document.ChartGenerationDataSetWiseForm.orgUnitListCB.options.length;
+ var i=0;
+ for(i=index-1;i>=0;i--)
+ {
+ if(document.ChartGenerationDataSetWiseForm.orgUnitListCB.options[i].selected)
+ document.ChartGenerationDataSetWiseForm.orgUnitListCB.options[i] = null;
+ }
+ }
+ // remOUFunction end
+
+function getOUDeatilsForDataStatusDataSetWise( orgUnitIds )
+{
+ jQuery.postJSON("getOrgUnitName.action",{
+ id : orgUnitIds[0]
+ }, function( json ){
+
+ var orgUnitId = json.organisationUnit.id;
+ var orgUnitName = json.organisationUnit.name;
+ var faciltyLB = document.getElementById("facilityLB");
+ var facilityIndex = faciltyLB.selectedIndex;
+ var orgUnitListCB = document.getElementById("orgUnitListCB");
+
+ if( faciltyLB.options[facilityIndex].value == "children" )
+ {
+ for( i = 0; i< orgUnitListCB.options.length; i++ )
+ {
+ orgUnitListCB.options[0] = null;
+ }
+ orgUnitListCB.options[0] = new Option( orgUnitName, orgUnitId, false, false );
+ }
+ else
+ {
+ for( i = 0; i < orgUnitListCB.options.length; i++ )
+ {
+ if( orgUnitId == orgUnitListCB.options[i].value) return;
+ }
+ orgUnitListCB.options[orgUnitListCB.options.length] = new Option( orgUnitName, orgUnitId, false, false );
+ }
+
+ });
+}
+
+
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/nr.js'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/nr.js 2010-12-08 07:24:10 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/nr.js 2011-05-18 11:12:17 +0000
@@ -162,16 +162,26 @@
function formValidations()
{
- var selDEListSize = document.ChartGenerationForm.selectedDataElements.options.length;
+ //var selDEListSize = document.ChartGenerationForm.selectedDataElements.options.length;
var orgUnitListCB = document.getElementById("orgUnitListCB");
var orgUnitLevelCB = document.getElementById("orgUnitLevelCB");
- var ouSelCB = document.getElementById("ouSelCB");
- sDateIndex = document.ChartGenerationForm.sDateLB.selectedIndex;
- eDateIndex = document.ChartGenerationForm.eDateLB.selectedIndex;
- sDateTxt = document.ChartGenerationForm.sDateLB.options[sDateIndex].text;
- sDate = formatDate(new Date(getDateFromFormat(sDateTxt,"MMM - y")),"yyyy-MM-dd");
- eDateTxt = document.ChartGenerationForm.eDateLB.options[eDateIndex].text;
- eDate = formatDate(new Date(getDateFromFormat(eDateTxt,"MMM - y")),"yyyy-MM-dd");
+ var ouSelCB = document.getElementById("ouSelCB");
+ //sDateIndex = document.ChartGenerationForm.sDateLB.selectedIndex;
+ //eDateIndex = document.ChartGenerationForm.eDateLB.selectedIndex;
+
+
+ var startPeriodObj = document.getElementById('sDateLB');
+ var endPeriodObj = document.getElementById('eDateLB');
+
+ sDateTxt = startPeriodObj.options[startPeriodObj.selectedIndex].text;
+ sDate = formatDate(new Date(getDateFromFormat(sDateTxt,"MMM-y")),"yyyy-MM-dd");
+ eDateTxt = endPeriodObj.options[endPeriodObj.selectedIndex].text;
+ eDate = formatDate(new Date(getDateFromFormat(eDateTxt,"MMM-y")),"yyyy-MM-dd");
+
+ //sDateTxt = document.ChartGenerationForm.sDateLB.options[sDateIndex].text;
+ //sDate = formatDate(new Date(getDateFromFormat(sDateTxt,"MMM - y")),"yyyy-MM-dd");
+ //eDateTxt = document.ChartGenerationForm.eDateLB.options[eDateIndex].text;
+ //eDate = formatDate(new Date(getDateFromFormat(eDateTxt,"MMM - y")),"yyyy-MM-dd");
if( ouSelCB.checked)
{
@@ -183,14 +193,15 @@
if(sDateIndex < 0) {alert("Please Select Starting Period");return false;}
else if(eDateIndex < 0) {alert("Please Select Ending Period");return false;}
else if(sDate > eDate) {alert("Starting Date is Greater");return false;}
- else if(selDEListSize <=0 ) {alert("Please Select Dataelements");return false;}
-
+ //else if(selDEListSize <=0 ) {alert("Please Select Data elements");return false;}
+ /*
for(k=0;k<document.ChartGenerationForm.selectedDataElements.options.length;k++)
{
document.ChartGenerationForm.selectedDataElements.options[k].selected = true;
- } // for l
-
- for(k = 0; k < orgUnitListCB.options.length; k++)
+ }
+ // for l
+ */
+ for(k = 0; k < orgUnitListCB.options.length; k++)
{
orgUnitListCB.options[k].selected = true;
}
@@ -204,3 +215,68 @@
return true;
} // formValidations Function End
+
+//Getting corresponding Period List for Data Sets Null reporter.
+function getdSetPeriods()
+{
+
+ var dataSetList = document.getElementById("selectedDataSet");
+ var dataSetId = dataSetList.options[ dataSetList.selectedIndex].value;
+
+ $.post("getDataSetPeriods.action",
+ {
+ id : dataSetId
+ },
+ function (data)
+ {
+ getdSetPeriodsReceived(data);
+ },'xml');
+
+}
+
+function getdSetPeriodsReceived( xmlObject )
+{
+ var sDateLB = document.getElementById( "sDateLB" );
+ var eDateLB = document.getElementById( "eDateLB" );
+
+ var periods = xmlObject.getElementsByTagName( "period" );
+
+ if ( periods.length <= 0 )
+ {
+ clearList( sDateLB );
+ clearList( eDateLB );
+ }
+
+ for ( var i = 0; i < periods.length; i++ )
+ {
+ var periodType = periods[ i ].getElementsByTagName( "periodtype" )[0].firstChild.nodeValue;
+
+ if(i ==0 )
+ {
+ if( periodType == curPeriodType )
+ {
+ break;
+ }
+ else
+ {
+ curPeriodType = periodType;
+ clearList( sDateLB );
+ clearList( eDateLB );
+ }
+ }
+
+ var id = periods[ i ].getElementsByTagName( "id" )[0].firstChild.nodeValue;
+ var periodName = periods[ i ].getElementsByTagName( "periodname" )[0].firstChild.nodeValue;
+
+ var option1 = document.createElement( "option" );
+ option1.value = id;
+ option1.text = periodName;
+ sDateLB.add( option1, null );
+
+ var option2 = document.createElement( "option" );
+ option2.value = id;
+ option2.text = periodName;
+ eDateLB.add( option2, null);
+ }
+
+}
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm 2011-01-13 09:39:35 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm 2011-05-18 11:12:17 +0000
@@ -17,7 +17,8 @@
<li><a href="dataStatusForm.action">$i18n.getString( "ds_regular" )</a></li>
<li><a href="dataStatusMobileForm.action">$i18n.getString( "ds_mobile" )</a></li>
<li><a href="dataStatusOrgnisationunitGroupSetWiseForm.action">$i18n.getString( "orgunit_group_ds" )</a></li>
- <li><a href="NullReporter.action">$i18n.getString( "nr_null_reporter" )</a></li>
+ <li><a href="NullReporter.action">$i18n.getString( "nr_null_reporter" )</a></li>
+ <li><a href="dataStatusDataSetWiseForm.action">$i18n.getString( "ds_dataset_wise" )</a></li>
<!-- <li><a href="commentsForm.action">Comments</a></li>
<li><a href="dashBoardMatrixForm.action">DashBoard matrix</a></li> -->
</ul>
=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menuWithTreeForDSDataSetWise.vm 2011-05-18 11:12:17 +0000
@@ -0,0 +1,28 @@
+<a href="index.action"><h2>$i18n.getString( "dataanalyser" )</h2></a>
+
+<ul>
+ <li>$i18n.getString( "ds_datastatus" )</li>
+ <ul>
+ <li>$i18n.getString( "ds_dataset_wise" )</li>
+ </ul>
+</ul>
+
+#parse( "/dhis-web-commons/ouwt/orgunittreesearch.vm" )
+
+<script type="text/javascript">
+
+ function orgUnitHasBeenSelected( orgUnitIds )
+ {
+ if( orgUnitIds == null || orgUnitIds == "" )
+ {
+ return;
+ }
+ if( orgUnitIds != null )
+ {
+ getOUDeatilsForDataStatusDataSetWise( orgUnitIds );
+ }
+ }
+
+ selection.setListenerFunction( orgUnitHasBeenSelected );
+
+</script>
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReporterFront.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReporterFront.vm 2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReporterFront.vm 2011-05-18 11:12:17 +0000
@@ -10,6 +10,12 @@
var selCategory = "";
var selFacility = "";
var selOrgUnitId="NONE";
+ var dsName = "";
+ var sDateIndex = 0;
+ var eDateIndex = 0;
+ var sDate = "";
+ var eDate = "";
+ var curPeriodType = "";
</script>
</head>
@@ -30,11 +36,11 @@
</tr>
<tr>
- <td class="NormalB">$i18n.getString( "nr_filter_by_degroup" )<br>
- <select id="dataElementGroupId" name="dataElementGroupId" style="width:325px" onchange="getDataElementsWithOutOptionCombo()" >
- <option value="$ALL">[ Select DataElementGroup / All ]</option>
- #foreach ( $group in $dataElementGroups )
- <option value="$group.id" title="$group.name">$group.name</option>
+ <td class="NormalB">1. $i18n.getString( "ds_dataset_list" ) : <br/>
+ <select id="selectedDataSet" name="selectedDataSet" onchange="getdSetPeriods()" style="width:300px">
+ <!--<option value="$ALL">[ Select DataElementGroup / All ]</option> -->
+ #foreach ( $dataSet in $dataSetList )
+ <option value='$dataSet.id' title='$dataSet.name'>$dataSet.name</option>
#end
</select>
</td>
@@ -42,31 +48,21 @@
<td class="NormalB"><input type="checkbox" name="includeZeros" id="includeZeros" checked> Count Zero as NULL</td>
</tr>
<tr>
- <td class="NormalB"> </td>
+ <td class="NormalB"> </td>
<td class="NormalB"> </td>
<td class="NormalB"> </td>
</tr>
<tr>
- <td class="NormalB">$i18n.getString( "nr_available_delist" )<br>
- <select multiple size="5" id="availableDataElements" name="availableDataElements" style="width:325px; height:160px" ondblclick="moveSelectedById( 'availableDataElements', 'selectedDataElements' )">
- #foreach ( $element in $dataElements )
- <option value="$element.id" title="$element.name">$element.name</option>
- #end
- </select>
- </td>
- <td class="NormalB" align="center"><br />
- <input type="button" value=">" style="width:40px" onclick="moveSelectedById( 'availableDataElements', 'selectedDataElements' )"><br>
- <input type="button" value="<" style="width:40px" onclick="moveSelectedById( 'selectedDataElements', 'availableDataElements' )"><br>
- <input type="button" value=">>" style="width:40px" onclick="moveAllById( 'availableDataElements', 'selectedDataElements' )"><br>
- <input type="button" value="<<" style="width:40px" onclick="moveAllById( 'selectedDataElements', 'availableDataElements' )">
- </td>
- <td class="NormalB">$i18n.getString( "nr_selected_delist" )<br />
- <select multiple id="selectedDataElements" name="selectedDataElements" style="width:325px; height:160px" ondblclick="moveSelectedById( 'selectedDataElements', 'availableDataElements' )">
- </select>
- </td>
- </tr>
+ <td class="NormalB">2. $i18n.getString( "ga_from" )<br />
+ <select id="sDateLB" name="sDateLB" style="width:200px"></select>
+ </td>
+ <td class="NormalB"> </td>
+ <td class="NormalB">3. $i18n.getString( "ga_to" )<br />
+ <select id="eDateLB" name="eDateLB" style="width:200px"></select>
+ </td>
+ </tr>
<tr>
- <td class="NormalB"> <br/></td>
+ <td class="NormalB"> <br/></td>
<td class="NormalB"> <br/></td>
<td class="NormalB"> <br/></td>
</tr>
@@ -74,18 +70,16 @@
<td>
<table>
<tr>
- <td class="NormalB">
-
- <input type="checkbox" id="ouSelCB" name="ouSelCB" onchange="ouSelCBChange()" value="ON" > Selected<br />
-
- </td>
+ <td class="NormalB">
+ ` <input type="checkbox" id="ouSelCB" name="ouSelCB" onchange="ouSelCBChange()" value="ON" > Selected<br />
+ </td>
</tr>
<tr>
- <td class="NormalB">
+ <td class="NormalB">
$i18n.getString( "ga_orgunit" ) <br>
- <select name="orgUnitListCB" id="orgUnitListCB" multiple size="7" style="width: 175px;" ondblclick="remOUFunction()" disabled >
- </select>
- </td>
+ <select name="orgUnitListCB" id="orgUnitListCB" multiple size="7" style="width: 175px;" ondblclick="remOUFunction()" disabled >
+ </select>
+ </td>
<td class="NormalB"> </td>
<td class="NormalB">
OrgUnit Levels:<br>
@@ -99,39 +93,14 @@
<td class="NormalB">
<table>
<tr>
- <td class="NormalB">$i18n.getString( "nr_from" )<br>
- <select id="sDateLB" name="sDateLB">
- #foreach($period in $monthlyPeriods)
- <option value="$period.id">$simpleDateFormat.format($period.startDate)</option>
- #end
- </select>
-
- </td>
- <td align="right" class="NormalB">$i18n.getString( "nr_to" )<br>
- <select id="eDateLB" name="eDateLB">
- #foreach($period in $monthlyPeriods)
- <option value="$period.id">$simpleDateFormat.format($period.endDate)</option>
- #end
- </select>
-
- </td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <tr>
- <td> </td>
- </tr>
- <tr>
- <td colspan="2"><input type="submit" name="View Null Reporter" value="$i18n.getString( 'nr_viewnullreporter' )" style="width: 120; height: 25; font-family:Arial; font-weight:bold; color:#000000"> </td>
- </tr>
- </table>
+ <td class="NormalB"><input type="submit" name="View Null Reporter" value="$i18n.getString( 'nr_viewnullreporter' )" style="width: 120; height: 25; font-family:Arial; font-weight:bold; color:#000000"> </td>
+ </tr>
+
+ </table>
</td>
</tr>
-
<tr>
<td class="NormalB" align="center" colspan="3" >
-
<input type="hidden" name="ouIDTB" id="ouIDTB">
</td>
</tr>
@@ -140,3 +109,6 @@
</body>
</body>
</html>
+<script>
+ getdSetPeriods();
+</script>
=== modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReporterResult.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReporterResult.vm 2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/nullReporterResult.vm 2011-05-18 11:12:17 +0000
@@ -27,7 +27,10 @@
#set( $ouList = $nullReportResult.keySet() )
<table border="1" cellpadding="5" cellspacing="0">
- <tr></tr>
+ <tr align="center">
+ <td class="NormalBHeading"><strong>Data Set Name</strong></td>
+ <td class="NormalBHeading" colspan="$size"><strong>$!dataSetName</strong></td>
+ </tr>
<tr align="center">
#if( $size == 0)
<td cellspacing="1" class="NormalBHeading" >There is no null value.</th>
=== added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePeriodForDataSetWise.vm'
--- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePeriodForDataSetWise.vm 1970-01-01 00:00:00 +0000
+++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/responsePeriodForDataSetWise.vm 2011-05-18 11:12:17 +0000
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<periods>
+#set($count1 = 0)
+#foreach( $periodName in $periodNameList )
+ #set($period = $periods.get($count1))
+ #set($count1 = $count1 + 1)
+ <period>
+ <id>$period.id</id>
+ <periodname>$periodName</periodname>
+ </period>
+#end
+</periods>