=== modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateDataStatusFormAction.java' --- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateDataStatusFormAction.java 2010-06-04 11:50:05 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateDataStatusFormAction.java 2010-11-24 09:27:00 +0000 @@ -63,12 +63,15 @@ dataSetList = new ArrayList( dataSetService.getAllDataSets() ); - Iterator dataSetListIterator = dataSetList.iterator(); + //dataSetList = new ArrayList( dataSetService.getDataSetsForMobile( )); + + Iterator dataSetListIterator = dataSetList.iterator(); while(dataSetListIterator.hasNext()) { DataSet d = (DataSet) dataSetListIterator.next(); + if ( d.getSources().size() <= 0 ) { dataSetListIterator.remove(); === modified file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateValidationStatusResultAction.java' --- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateValidationStatusResultAction.java 2010-11-23 09:59:00 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/action/GenerateValidationStatusResultAction.java 2010-11-24 09:27:00 +0000 @@ -494,6 +494,7 @@ { dsValidationPassResults.add( new Integer(0) ); //System.out.println(o.getName()+ " : 0"); + } } === added directory 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile' === added directory 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action' === added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateDataStatusMobileFormAction.java' --- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateDataStatusMobileFormAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateDataStatusMobileFormAction.java 2010-11-24 09:27:00 +0000 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2004-2010, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.hisp.dhis.dashboard.ds.mobile.action; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; + +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.dataset.comparator.DataSetNameComparator; +import org.hisp.dhis.period.Period; + +import com.opensymphony.xwork2.Action; + +/** + * @author Mithilesh Kumar Thakur + * + * @version GenerateDataStatusMobileFormAction.java Nov 24, 2010 2:34:42 PM + */ +public class GenerateDataStatusMobileFormAction +implements Action +{ + + /* Dependencies */ +/* + @SuppressWarnings("unused") + private PeriodService periodService; + + public void setPeriodService( PeriodService periodService ) + { + this.periodService = periodService; + } +*/ + private DataSetService dataSetService; + + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + /* Output Parameters */ + private List dataSetList; + + public List getDataSetList() + { + return dataSetList; + } + + private List monthlyPeriods; + + public List getMonthlyPeriods() + { + return monthlyPeriods; + } + + private SimpleDateFormat simpleDateFormat; + + public SimpleDateFormat getSimpleDateFormat() + { + return simpleDateFormat; + } + + public String execute() + throws Exception + { + /* DataSet List */ + + dataSetList = new ArrayList( dataSetService.getAllDataSets() ); + + //dataSetList = new ArrayList( dataSetService.getDataSetsForMobile( )); + + Iterator dataSetListIterator = dataSetList.iterator(); + + while(dataSetListIterator.hasNext()) + { + 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(); + } + + // Remove datasets which are nor mobile datasets + else if ( d.getMobile() == null || !d.getMobile()) + { + dataSetListIterator.remove(); + } + } + } + + Collections.sort( dataSetList, new DataSetNameComparator() ); + System.out.println("Size of DataSet List is : " + dataSetList.size()); + + /* Monthly Periods */ + //monthlyPeriods = new ArrayList( periodService.getPeriodsByPeriodType( new MonthlyPeriodType() ) ); + //Collections.sort( monthlyPeriods, new PeriodStartDateComparator() ); + //simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd" ); + + return SUCCESS; + } + + +}// class end + === added file 'local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateValidationMobileStatusResultAction.java' --- local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateValidationMobileStatusResultAction.java 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-dashboard/src/main/java/org/hisp/dhis/dashboard/ds/mobile/action/GenerateValidationMobileStatusResultAction.java 2010-11-24 09:27:00 +0000 @@ -0,0 +1,670 @@ +/* + * Copyright (c) 2004-2010, University of Oslo + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * * Neither the name of the HISP project nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.hisp.dhis.dashboard.ds.mobile.action; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.hisp.dhis.dashboard.util.DashBoardService; +import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataset.CompleteDataSetRegistration; +import org.hisp.dhis.dataset.CompleteDataSetRegistrationService; +import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +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.hisp.dhis.source.Source; +import org.hisp.dhis.user.User; +import org.hisp.dhis.user.UserStore; + +import com.opensymphony.xwork2.Action; + +/** + * @author Mithilesh Kumar Thakur + * + * @version GenerateValidationMobileStatusResultAction.java Nov 24, 2010 2:32:53 PM + */ +public class GenerateValidationMobileStatusResultAction +implements Action +{ + // --------------------------------------------------------------- + // Dependencies + // --------------------------------------------------------------- + + 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; + } + + public DataSetService getDataSetService() + { + return dataSetService; + } + + private DashBoardService dashBoardService; + + public void setDashBoardService( DashBoardService dashBoardService ) + { + this.dashBoardService = dashBoardService; + } + + private CompleteDataSetRegistrationService registrationService; + + public void setRegistrationService( CompleteDataSetRegistrationService registrationService ) + { + this.registrationService = registrationService; + } + + private UserStore userStore; + + public void setUserStore( UserStore userStore ) + { + this.userStore = userStore; + } + + // --------------------------------------------------------------- + // Output Parameters + // --------------------------------------------------------------- + + private Map> ouMapValidationPassStatusResult; + + public Map> getOuMapValidationPassStatusResult() + { + return ouMapValidationPassStatusResult; + } + + private Map ouMapUserPhoneNo; + + public Map getOuMapUserPhoneNo() + { + return ouMapUserPhoneNo; + } + + // private Map> ouMapUserPhoneNo; + + private Collection periodList; + + public Collection getPeriodList() + { + return periodList; + } + + private List orgUnitList; + + public List getOrgUnitList() + { + return orgUnitList; + } + + private List dataSetList; + + public List getDataSetList() + { + return dataSetList; + } + + private List results; + + public List getResults() + { + return results; + } + + List selectedPeriodList; + + public List getSelectedPeriodList() + { + return selectedPeriodList; + } + + List levelNames; + + public List getLevelNames() + { + return levelNames; + } + + private int maxOULevel; + + public int getMaxOULevel() + { + return maxOULevel; + } + + private String userPhoneNo; + + public String getUserPhoneNo() + { + return userPhoneNo; + } + // --------------------------------------------------------------- + // Input Parameters + // --------------------------------------------------------------- + + private String dsId; + + public void setDsId( String dsId ) + { + this.dsId = dsId; + } + + private String includeZeros; + + public void setIncludeZeros( String includeZeros ) + { + this.includeZeros = includeZeros; + } + + public String getIncludeZeros() + { + return includeZeros; + } + + private String ouId; + + public void setOuId( String ouId ) + { + this.ouId = ouId; + } + + private String immChildOption; + + public void setImmChildOption( String immChildOption ) + { + this.immChildOption = immChildOption; + } + + private int sDateLB; + + public void setSDateLB( int dateLB ) + { + sDateLB = dateLB; + } + + public int getSDateLB() + { + return sDateLB; + } + + private int eDateLB; + + public void setEDateLB( int dateLB ) + { + eDateLB = dateLB; + } + + public int getEDateLB() + { + return eDateLB; + } + + private String facilityLB; + + public void setFacilityLB( String facilityLB ) + { + this.facilityLB = facilityLB; + } + + private List orgUnitListCB; + + public void setOrgUnitListCB( List orgUnitListCB ) + { + this.orgUnitListCB = orgUnitListCB; + } + + private List selectedDataSets; + + public void setSelectedDataSets( List selectedDataSets ) + { + this.selectedDataSets = selectedDataSets; + } + + public List getSelectedDataSets() + { + return selectedDataSets; + } + + private int minOULevel; + + public int getMinOULevel() + { + return minOULevel; + } + + private int number; + + public int getNumber() + { + return number; + } + + private DataSet selDataSet; + + public DataSet getSelDataSet() + { + return selDataSet; + } + + private List periodNameList; + + public List getPeriodNameList() + { + return periodNameList; + } + + String orgUnitInfo; + + String periodInfo; + + String deInfo; + + int orgUnitCount; + + @SuppressWarnings( { "unchecked" } ) + public String execute() + throws Exception + { + orgUnitCount = 0; + + // Intialization + periodNameList = new ArrayList(); + ouMapValidationPassStatusResult = new HashMap>(); + ouMapUserPhoneNo = new HashMap(); + + results = new ArrayList(); + maxOULevel = 1; + minOULevel = organisationUnitService.getNumberOfOrganisationalLevels(); + + if ( immChildOption != null && immChildOption.equalsIgnoreCase( "yes" ) ) + { + orgUnitListCB = new ArrayList(); + orgUnitListCB.add( ouId ); + facilityLB = "immChildren"; + selectedDataSets = new ArrayList(); + selectedDataSets.add( dsId ); + } + + // DataSet Related Info + dataSetList = new ArrayList(); + + deInfo = "-1"; + if ( selectedDataSets == null ) + { + System.out.println( "slectedDataSets is empty" ); + } + else + { + } + for ( String ds : selectedDataSets ) + { + DataSet dSet = dataSetService.getDataSet( Integer.parseInt( ds ) ); + selDataSet = dSet; + for ( DataElement de : dSet.getDataElements() ) + deInfo += "," + de.getId(); + } + + // OrgUnit Related Info + OrganisationUnit selectedOrgUnit = new OrganisationUnit(); + orgUnitList = new ArrayList(); + 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(); + Iterator orgUnitIterator = orgUnitListCB.iterator(); + while ( orgUnitIterator.hasNext() ) + { + OrganisationUnit o = organisationUnitService.getOrganisationUnit( Integer + .parseInt( (String) orgUnitIterator.next() ) ); + List organisationUnits = new ArrayList( o.getChildren() ); + Collections.sort( organisationUnits, new OrganisationUnitShortNameComparator() ); + orgUnitList.addAll( organisationUnits ); + orgUnitList.add( 0, o ); + } + //System.out.println( "Selected is immediate children" ); + } + else + { + Iterator orgUnitIterator = orgUnitListCB.iterator(); + OrganisationUnit o; + while ( orgUnitIterator.hasNext() ) + { + o = organisationUnitService.getOrganisationUnit( Integer.parseInt( orgUnitIterator.next() ) ); + orgUnitList.add( o ); + } + } + + Set dSetSource = selDataSet.getSources(); + orgUnitInfo = "-1"; + Iterator ouIt = orgUnitList.iterator(); + while ( ouIt.hasNext() ) + { + OrganisationUnit ou = ouIt.next(); + orgUnitCount = 0; + if ( !dSetSource.contains( ou ) ) + { + getDataSetAssignedOrgUnitCount( ou, dSetSource ); + if ( orgUnitCount > 0 ) + { + orgUnitInfo += "," + ou.getId(); + getOrgUnitInfo( ou ); + } + else + { + ouIt.remove(); + } + } + else + { + orgUnitInfo += "," + ou.getId(); + } + } + + // Period Related Info + Period startPeriod = periodService.getPeriod( sDateLB ); + Period endPeriod = periodService.getPeriod( eDateLB ); + + PeriodType dataSetPeriodType = selDataSet.getPeriodType(); + periodList = new ArrayList( periodService.getIntersectingPeriodsByPeriodType( dataSetPeriodType, + startPeriod.getStartDate(), endPeriod.getEndDate() ) ); + + periodInfo = "-1"; + for ( Period p : periodList ) + periodInfo += "," + p.getId(); + + Iterator orgUnitListIterator = orgUnitList.iterator(); + OrganisationUnit o; + Set dso = new HashSet(); + Iterator periodIterator; + dso = selDataSet.getSources(); + String orgUnitId = ""; + + while ( orgUnitListIterator.hasNext() ) + { + //System.out.println( "Getting into first orgunit loop" ); + o = (OrganisationUnit) orgUnitListIterator.next(); + + // user phone no + userPhoneNo = ""; + + List users = new ArrayList( userStore.getUsersByOrganisationUnit( o ) ); + + for ( User user : users ) + { + if ( user != null && user.getPhoneNumber() != null && !user.getPhoneNumber().trim().equalsIgnoreCase( "" ) ) + { + userPhoneNo += user.getPhoneNumber() + ", "; + } + } + + ouMapUserPhoneNo.put( o, userPhoneNo ); + + orgUnitInfo = "" + o.getId(); + + if ( maxOULevel < organisationUnitService.getLevelOfOrganisationUnit( o ) ) + maxOULevel = organisationUnitService.getLevelOfOrganisationUnit( o ); + + if ( minOULevel > organisationUnitService.getLevelOfOrganisationUnit( o ) ) + minOULevel = organisationUnitService.getLevelOfOrganisationUnit( o ); + + periodIterator = periodList.iterator(); + Period p; + //List dsResults = new ArrayList(); + List dsValidationPassResults = new ArrayList(); + + while ( periodIterator.hasNext() ) + { + p = (Period) periodIterator.next(); + periodInfo = "" + p.getId(); + //System.out.println( "Getting into period loop periodInfo = "+periodInfo ); + + if ( dso == null ) + { + //dsResults.add( -1 ); + dsValidationPassResults.add( -1 ); + continue; + } + else if ( !dso.contains( o ) ) + { + List childOrgUnits = new ArrayList(); + childOrgUnits = filterChildOrgUnitsByDataSet( dataSetService.getDataSet( Integer + .valueOf( selectedDataSets.get( 0 ) ) ), o ); + Iterator assignedChildrenIterator = childOrgUnits.iterator(); + Integer dataStatusCount = 0; + + while ( assignedChildrenIterator.hasNext() ) + { + OrganisationUnit cUnit = (OrganisationUnit) assignedChildrenIterator.next(); + orgUnitInfo = "-1"; + orgUnitId = "-1,"; + orgUnitId += String.valueOf( cUnit.getId() ); + orgUnitCount = 0; + getOrgUnitInfo( o, dso ); + + CompleteDataSetRegistration completeDataSetRegistration = registrationService.getCompleteDataSetRegistration( selDataSet, p, cUnit ); + + if ( completeDataSetRegistration != null ) + { + dataStatusCount += 1; + } + + + + } + //System.out.println("\ndataStatusCount : " + dataStatusCount); + // System.out.println(o.getName()+ " , " + o.getComment() + " : " +dataStatusCount); + // System.out.println( "user phone No is : " + userPhoneNo ); + dsValidationPassResults.add( dataStatusCount ); + + continue; + } + + // System.out.println("\no = "+o.getName() + " dsValidationPassResults size = "+dsValidationPassResults.size()); + + orgUnitInfo = "" + o.getId(); + + CompleteDataSetRegistration completeDataSetRegistration = registrationService.getCompleteDataSetRegistration( selDataSet, p, o ); + + if ( completeDataSetRegistration != null ) + { + dsValidationPassResults.add( new Integer(1) ); + // System.out.println(o.getName()+ " : 1"); + } + else + { + dsValidationPassResults.add( new Integer(0) ); + //System.out.println(o.getName()+ " : 0"); + + } + + } + //System.out.println("o = "+o.getName() + " dsValidationPassResults size = "+dsValidationPassResults.size()); + ouMapValidationPassStatusResult.put( o, dsValidationPassResults ); + + } +/* + + for( OrganisationUnit orgUnit : ouMapUserPhoneNo.keySet() ) + { + System.out.print( orgUnit.getName()+ " : " + orgUnit.getComment() ); + for( String phoneNo : ouMapUserPhoneNo.values() ) + { + System.out.print( " - "+ phoneNo ); + } + System.out.println(""); + } +*/ + // For Level Names + String ouLevelNames[] = new String[organisationUnitService.getNumberOfOrganisationalLevels() + 1]; + + for ( int i = 0; i < ouLevelNames.length; i++ ) + { + ouLevelNames[i] = "Level" + i; + } + + List ouLevels = new ArrayList( organisationUnitService.getFilledOrganisationUnitLevels() ); + + for ( OrganisationUnitLevel ouL : ouLevels ) + { + ouLevelNames[ouL.getLevel()] = ouL.getName(); + } + + levelNames = new ArrayList(); + int count1 = minOULevel; + + while ( count1 <= maxOULevel ) + { + levelNames.add( ouLevelNames[count1] ); + count1++; + } + + periodNameList = dashBoardService.getPeriodNamesByPeriodType( dataSetPeriodType, periodList ); + return SUCCESS; + } + + public void getDataSetAssignedOrgUnitCount( OrganisationUnit organisationUnit, Set dso ) + { + Collection children = organisationUnit.getChildren(); + Iterator childIterator = children.iterator(); + OrganisationUnit child; + + while ( childIterator.hasNext() ) + { + child = childIterator.next(); + if ( dso.contains( child ) ) + { + orgUnitCount++; + } + getDataSetAssignedOrgUnitCount( child, dso ); + } + } + + // Returns the OrgUnitTree for which Root is the orgUnit + @SuppressWarnings( "unchecked" ) + public List getChildOrgUnitTree( OrganisationUnit orgUnit ) + { + List orgUnitTree = new ArrayList(); + orgUnitTree.add( orgUnit ); + List children = new ArrayList( 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 void getOrgUnitInfo( OrganisationUnit organisationUnit ) + { + Collection children = organisationUnit.getChildren(); + Iterator childIterator = children.iterator(); + OrganisationUnit child; + while ( childIterator.hasNext() ) + { + child = childIterator.next(); + orgUnitInfo += "," + child.getId(); + getOrgUnitInfo( child ); + } + } + + private void getOrgUnitInfo( OrganisationUnit organisationUnit, Set dso ) + { + Collection children = organisationUnit.getChildren(); + Iterator childIterator = children.iterator(); + OrganisationUnit child; + + while ( childIterator.hasNext() ) + { + child = childIterator.next(); + if ( dso.contains( child ) ) + { + orgUnitInfo += "," + child.getId(); + orgUnitCount++; + } + getOrgUnitInfo( child, dso ); + } + } + + private List filterChildOrgUnitsByDataSet( DataSet selectedDataSet, + OrganisationUnit selectedOrganisationUnit ) + { + List filteredOrganisationUnits = getChildOrgUnitTree( selectedOrganisationUnit ); + + @SuppressWarnings( "unused" ) + List assignedOrganisationUnits = new ArrayList(); + Set assignedSources = selectedDataSet.getSources(); + filteredOrganisationUnits.retainAll( assignedSources ); + return filteredOrganisationUnits; + } + +}// class end + === 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 2010-11-22 13:02:23 +0000 +++ local/in/dhis-web-dashboard/src/main/resources/META-INF/dhis/beans.xml 2010-11-24 09:27:00 +0000 @@ -424,6 +424,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + css/StylesForTags.css + + + + /main.vm + /dhis-web-dashboard/dataStatusMobileFront.vm + /dhis-web-dashboard/menuWithTreeForDSMobile.vm + ../dhis-web-commons/ouwt/ouwt.js,../dhis-web-commons/lists/lists.js,javascript/ds.js,javascript/db.js,javascript/date.js,javascript/hashtable.js + css/StylesForTags.css + + + + + /dhis-web-dashboard/validationMobileSatusResult.vm + javascript/ds.js,javascript/hashtable.js + css/StylesForTags.css + + + + @@ -275,12 +296,10 @@ css/StylesForTags.css - - - /dhis-web-dashboard/validationSatusResult.vm - - javascript/ds.js,javascript/hashtable.js + /dhis-web-dashboard/validationSatusResult.vm + javascript/ds.js,javascript/hashtable.js css/StylesForTags.css === added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusMobileFront.vm' --- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusMobileFront.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/dataStatusMobileFront.vm 2010-11-24 09:27:00 +0000 @@ -0,0 +1,122 @@ + + + + +

$i18n.getString( "ds_form_mobile" )

+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ $i18n.getString( "mobile_ds_dataset_list" ) :
+ +
 
+ $i18n.getString( "ga_facilityby" )
+ +
+
+ +
 
+ $i18n.getString( "ga_from" )
+ +
+ $i18n.getString( "ga_to" )
+ +
+
  + + + + + + + +
+ Include Zero +
+ $i18n.getString( "ga_orgunit" )
+ +
+
+ + + + +




+ +
+ + + +
+ +
+ + \ 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 2010-09-08 08:13:41 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/javascript/ds.js 2010-11-24 09:27:00 +0000 @@ -71,7 +71,7 @@ { document.getElementById("selectedButton").value = summary; - + // alert(summary); if(formValidationsForDataStatus()) { if(summary == "SummaryStatus") @@ -88,7 +88,13 @@ } else if(summary == "ValidationStatus") { - document.ChartGenerationForm.action = "validationStatusResult.action"; + document.ChartGenerationForm.action = "validationStatusResult.action"; + //alert("inside validation status reult"); + document.ChartGenerationForm.submit(); + } + else if(summary == "ValidationMobileStatus") + { + document.ChartGenerationForm.action = "validationMobileStatusResult.action"; document.ChartGenerationForm.submit(); } else if(summary == "LastUpdatedStatus") === 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 2010-11-03 09:50:21 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/menu.vm 2010-11-24 09:27:00 +0000 @@ -14,6 +14,7 @@
  • Data Status
    • Data Status
    • +
    • $i18n.getString( "ds_mobile" )
    • OrgUnitGroupwise Data Status
    • Null Reporter
    • + + + + + === added file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationMobileSatusResult.vm' --- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationMobileSatusResult.vm 1970-01-01 00:00:00 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationMobileSatusResult.vm 2010-11-24 09:27:00 +0000 @@ -0,0 +1,96 @@ + + + + + +
      + +
      + +
      + +
      +
      $i18n.getString( "ds_validation_status_mobile" )
      + +
      + + + + + + + + + +
       Validation Check Performed On Data Entry Screen
       Validation Check Not Performed On Data Entry Screen
      +
      + + #set($count2 = 0) + +
      + +
      $i18n.getString( "ds_mobile" ) : $selDataSet.name
      + + + #foreach($levelName in $levelNames) + + #end + + + #foreach( $periodname in $periodNameList ) + + #end + + + #foreach( $chiildorgUnit in $orgUnitList ) + #set( $count1 = $minOULevel ) + #set( $curOrgUnitLevel = $organisationUnitService.getLevelOfOrganisationUnit($chiildorgUnit) ) + + #foreach($levelName in $levelNames) + #if($count1 == $curOrgUnitLevel) + + #else + + #end + #set($count1 = $count1 + 1) + #end + #set( $dsValidationPhoneNo = $ouMapUserPhoneNo.get($chiildorgUnit) ) + + + + + + #set( $dsValidationPassResults = $ouMapValidationPassStatusResult.get($chiildorgUnit) ) + + #foreach( $result in $dsValidationPassResults ) + #if($result < 0) + + #elseif($result == 0) + + #elseif($result == 1) + + #elseif($result > 1) + + #end + #end + + #end +
      $!levelName$i18n.getString( "ds_mobile_anm_name" )$i18n.getString( "ds_mobile_anm_phone" )$periodname
      $chiildorgUnit.name $!chiildorgUnit.comment$dsValidationPhoneNo 01$result
      +
      +
      === modified file 'local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationSatusResult.vm' --- local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationSatusResult.vm 2010-11-23 09:59:00 +0000 +++ local/in/dhis-web-dashboard/src/main/webapp/dhis-web-dashboard/validationSatusResult.vm 2010-11-24 09:27:00 +0000 @@ -31,12 +31,12 @@
      - - + + - - + +
       Validation Check Performed On Data Entry Screen Validation Check Performed On Data Entry Screen
       Validation Check Not Performed On Data Entry Screen Validation Check Not Performed On Data Entry Screen
      @@ -46,7 +46,7 @@
      DataSet : $selDataSet.name
      - +
      #foreach($levelName in $levelNames)
      $!levelName