=== modified file 'local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/llgroup/UpdateLineListGroupAction.java' --- local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/llgroup/UpdateLineListGroupAction.java 2010-11-03 13:40:15 +0000 +++ local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/llgroup/UpdateLineListGroupAction.java 2010-11-22 07:28:23 +0000 @@ -131,13 +131,6 @@ // ------------------------------------------------------------------------- public String execute() { - - // --------------------------------------------------------------------- - // Prepare values - // --------------------------------------------------------------------- - - // System.out.println("Line List Group ID : "+id); - if ( description != null && description.trim().length() == 0 ) { description = null; @@ -151,31 +144,26 @@ LineListGroup lineListGroup = lineListService.getLineListGroup( id ); - - List newElements = new ArrayList(); List oldElements = new ArrayList( lineListGroup.getLineListElements() ); List removeElementList = new ArrayList(); Collection updatedDataElementList = new ArrayList(); - if ( selectedList == null ) + if( selectedList == null ) { System.out.println( "selectedList is null" ); - } else + } + else if( newElements.isEmpty() ) { - if ( newElements.isEmpty() ) + for( String elementId : selectedList ) { - for ( String elementId : selectedList ) + LineListElement element = lineListService.getLineListElement( Integer.parseInt( elementId ) ); + if ( !( oldElements.contains( element ) ) ) { - - LineListElement element = lineListService.getLineListElement( Integer.parseInt( elementId ) ); - if ( !( oldElements.contains( element ) ) ) - { - newElements.add( element ); - System.out.println( "New element that should be added is: " + element ); - } - updatedDataElementList.add( element ); + newElements.add( element ); + System.out.println( "New element that should be added is: " + element ); } + updatedDataElementList.add( element ); } } @@ -183,7 +171,6 @@ { if ( !( updatedDataElementList.contains( oldElements.get( i ) ) ) ) { - boolean doNotDelete = dataBaseManagerInterface.checkDataFromTable( lineListGroup.getShortName(), oldElements.get( i ) ); if ( !doNotDelete ) { @@ -195,9 +182,7 @@ } lineListGroup.getLineListElements().removeAll( updatedDataElementList ); - lineListGroup.getLineListElements().retainAll( updatedDataElementList ); - lineListGroup.getLineListElements().addAll( updatedDataElementList ); lineListGroup.setName( name ); @@ -209,8 +194,9 @@ lineListGroup.setPeriodType( periodService.getPeriodTypeByClass( periodType.getClass() ) ); lineListService.updateLineListGroup( lineListGroup ); - + dataBaseManagerInterface.updateTable( lineListGroup.getName(), removeElementList, newElements ); + return SUCCESS; } } === added file 'local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/reports/EmployeePostDetailsReportAction.java' --- local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/reports/EmployeePostDetailsReportAction.java 1970-01-01 00:00:00 +0000 +++ local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/reports/EmployeePostDetailsReportAction.java 2010-11-22 07:28:23 +0000 @@ -0,0 +1,103 @@ +package org.hisp.dhis.ll.action.reports; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.hisp.dhis.dbmanager.DataBaseManagerInterface; +import org.hisp.dhis.linelisting.LineListDataValue; +import org.hisp.dhis.linelisting.LineListElement; +import org.hisp.dhis.linelisting.LineListGroup; +import org.hisp.dhis.linelisting.LineListOption; +import org.hisp.dhis.linelisting.LineListService; +import org.hisp.dhis.ll.action.lldataentry.SelectedStateManager; +import org.hisp.dhis.organisationunit.OrganisationUnit; + +import com.opensymphony.xwork2.Action; + +public class EmployeePostDetailsReportAction implements Action +{ + + // ------------------------------------------------------------------------- + // Dependencies + // ------------------------------------------------------------------------- + + private SelectedStateManager selectedStateManager; + + public void setSelectedStateManager( SelectedStateManager selectedStateManager ) + { + this.selectedStateManager = selectedStateManager; + } + + private DataBaseManagerInterface dataBaseManagerInterface; + + public void setDataBaseManagerInterface( DataBaseManagerInterface dataBaseManagerInterface ) + { + this.dataBaseManagerInterface = dataBaseManagerInterface; + } + + private LineListService lineListService; + + public void setLineListService( LineListService lineListService ) + { + this.lineListService = lineListService; + } + + // ------------------------------------------------------------------------- + // Output + // ------------------------------------------------------------------------- + + private List llDataValuesList; + + public List getLlDataValuesList() + { + return llDataValuesList; + } + + private List lineListElements; + + public List getLineListElements() + { + return lineListElements; + } + + private String deptAndPostIds; + + public void setDeptAndPostIds( String deptAndPostIds ) + { + this.deptAndPostIds = deptAndPostIds; + } + + // ------------------------------------------------------------------------- + // Action Implementation + // ------------------------------------------------------------------------- + + public String execute() + { + OrganisationUnit selOrgUnit = selectedStateManager.getSelectedOrganisationUnit(); + + System.out.println("deptAndPostNames: "+ deptAndPostIds ); + String[] partsOfDeptAndPostNames = deptAndPostIds.split( ":" ); + + LineListGroup department = lineListService.getLineListGroup( Integer.parseInt( partsOfDeptAndPostNames[0] ) ); + LineListOption lineListOption = lineListService.getLineListOption( Integer.parseInt( partsOfDeptAndPostNames[1] ) ); + + lineListElements = new ArrayList( department.getLineListElements() ); + + llDataValuesList = new ArrayList(); + + //HardCoding to get lastworkingdate linelist element + String postLineListElementName = lineListElements.iterator().next().getShortName(); + String lastWorkingDateLLElementName = "lastworkingdate"; + + //preparing map to filter records from linelist table + Map llElementValueMap = new HashMap(); + llElementValueMap.put( postLineListElementName, lineListOption.getName() ); + llElementValueMap.put( lastWorkingDateLLElementName, "null" ); + + llDataValuesList = dataBaseManagerInterface.getLLValuesFilterByLLElements( department.getShortName(), llElementValueMap, selOrgUnit ); + + return SUCCESS; + } +} === modified file 'local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/reports/SummaryReportAction.java' --- local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/reports/SummaryReportAction.java 2010-11-19 09:33:44 +0000 +++ local/bd/dhis-web-linelisting-manpower/src/main/java/org/hisp/dhis/ll/action/reports/SummaryReportAction.java 2010-11-22 07:28:23 +0000 @@ -74,6 +74,13 @@ return resultMap; } + private Map resultIdMap; + + public Map getResultIdMap() + { + return resultIdMap; + } + List resultKeys; public List getResultKeys() @@ -95,6 +102,7 @@ public String execute() { resultMap = new HashMap(); + resultIdMap = new HashMap(); resultKeys = new ArrayList(); Period dataValuePeriod = periodService.getPeriod( 0 ); OrganisationUnit selOrgUnit = selectedStateManager.getSelectedOrganisationUnit(); @@ -124,7 +132,7 @@ List lineListDataElementMaps = lineListService.getLinelistDataelementMappings( postElement, postOption ); - if( lineListDataElementMaps != null ) + if( lineListDataElementMaps != null && !lineListDataElementMaps.isEmpty() ) { LineListDataElementMap lineListDataElementMap = lineListDataElementMaps.iterator().next(); DataValue dataValue = dataValueService.getDataValue( selOrgUnit, lineListDataElementMap.getDataElement(), dataValuePeriod, lineListDataElementMap.getDataElementOptionCombo() ); @@ -137,7 +145,8 @@ int filledPostsCount = dataBaseManagerInterface.getLLValueCountByLLElements( lineListGroup.getName(), llElementValueMap, selOrgUnit ); int vacantPostsCount = sanctionedPostsCount - filledPostsCount; - resultMap.put( lineListGroup.getName()+" - "+postElement.getName(), sanctionedPostsCount + " - " + filledPostsCount + " - " + vacantPostsCount); + resultMap.put( lineListGroup.getName()+" - "+postOption.getName(), sanctionedPostsCount + " - " + filledPostsCount + " - " + vacantPostsCount ); + resultIdMap.put( lineListGroup.getName()+" - "+postOption.getName(), lineListGroup.getId()+":"+postOption.getId() ); } } === modified file 'local/bd/dhis-web-linelisting-manpower/src/main/resources/META-INF/dhis/beans.xml' --- local/bd/dhis-web-linelisting-manpower/src/main/resources/META-INF/dhis/beans.xml 2010-11-20 12:16:50 +0000 +++ local/bd/dhis-web-linelisting-manpower/src/main/resources/META-INF/dhis/beans.xml 2010-11-22 07:28:23 +0000 @@ -794,5 +794,12 @@ + + + + + + === modified file 'local/bd/dhis-web-linelisting-manpower/src/main/resources/struts.xml' --- local/bd/dhis-web-linelisting-manpower/src/main/resources/struts.xml 2010-11-19 12:52:40 +0000 +++ local/bd/dhis-web-linelisting-manpower/src/main/resources/struts.xml 2010-11-22 07:28:23 +0000 @@ -578,6 +578,9 @@ ../dhis-web-commons/ouwt/ouwt.js + + /dhis-web-linelisting-mp/employeePostDetailsResult.vm + \ No newline at end of file === added file 'local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/employeePostDetailsResult.vm' --- local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/employeePostDetailsResult.vm 1970-01-01 00:00:00 +0000 +++ local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/employeePostDetailsResult.vm 2010-11-22 07:28:23 +0000 @@ -0,0 +1,16 @@ + + + + #foreach( $lineListElement in $lineListElements) + + #end + + #foreach( $llDataValue in $llDataValuesList ) + #set( $llValueMap = $llDataValue.lineListValues ) + + #foreach( $lineListElement in $lineListElements ) + + #end + + #end +
$lineListElement.name
$llValueMap.get( $lineListElement.shortName )
\ No newline at end of file === modified file 'local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/menu.vm' --- local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/menu.vm 2010-11-19 09:33:44 +0000 +++ local/bd/dhis-web-linelisting-manpower/src/main/webapp/dhis-web-linelisting-mp/menu.vm 2010-11-22 07:28:23 +0000 @@ -12,7 +12,6 @@

Linelisting Reports