=== modified file 'local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/LineListGroup.java' --- local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/LineListGroup.java 2011-04-27 17:15:13 +0000 +++ local/in/dhis-in-api/src/main/java/org/hisp/dhis/linelisting/LineListGroup.java 2011-10-07 12:25:01 +0000 @@ -166,6 +166,36 @@ } // ------------------------------------------------------------------------- + // Logic + // ------------------------------------------------------------------------- + + public void addOrganisationUnit( OrganisationUnit unit ) + { + sources.add( unit ); + } + + public void removeOrganisationUnit( OrganisationUnit unit ) + { + sources.remove( unit ); + } + + public void updateOrganisationUnits( Set updates ) + { + for ( OrganisationUnit unit : new HashSet( sources ) ) + { + if ( !updates.contains( unit ) ) + { + removeOrganisationUnit( unit ); + } + } + + for ( OrganisationUnit unit : updates ) + { + addOrganisationUnit( unit ); + } + } + + // ------------------------------------------------------------------------- // Getters and setters // ------------------------------------------------------------------------- === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java' --- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java 2011-04-27 17:15:13 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/FormAction.java 2011-10-07 12:25:01 +0000 @@ -27,6 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -37,12 +38,16 @@ import java.util.Set; import org.hisp.dhis.dataelement.DataElement; +import org.hisp.dhis.dataelement.DataElementCategory; import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo; import org.hisp.dhis.dataelement.DataElementCategoryService; import org.hisp.dhis.dataelement.DataElementService; import org.hisp.dhis.dataentryform.DataEntryForm; import org.hisp.dhis.datalock.DataSetLockService; import org.hisp.dhis.dataset.DataSet; +import org.hisp.dhis.dataset.DataSetService; +import org.hisp.dhis.dataset.Section; +import org.hisp.dhis.dataset.comparator.DataSetNameComparator; import org.hisp.dhis.datavalue.DataValue; import org.hisp.dhis.den.api.LLDataSets; import org.hisp.dhis.den.api.LLDataValue; @@ -53,6 +58,7 @@ import org.hisp.dhis.minmax.MinMaxDataElement; import org.hisp.dhis.minmax.MinMaxDataElementService; import org.hisp.dhis.organisationunit.OrganisationUnit; +import org.hisp.dhis.period.CalendarPeriodType; import org.hisp.dhis.period.Period; import com.opensymphony.xwork2.Action; @@ -84,7 +90,7 @@ } @SuppressWarnings("unused") - private DataElementCategoryService dataElementCategoryService; + private DataElementCategoryService dataElementCategoryService; public void setDataElementCategoryService( DataElementCategoryService dataElementCategoryService ) { @@ -125,7 +131,17 @@ { this.i18n = i18n; } + + //SelectAction Source Code + private DataSetService dataSetService; + public void setDataSetService( DataSetService dataSetService ) + { + this.dataSetService = dataSetService; + } + + + // ------------------------------------------------------------------------- // Output // ------------------------------------------------------------------------- @@ -134,8 +150,8 @@ public List getRecordNos() { - return recordNos; - } + return recordNos; + } private List orgUnitChildList; @@ -267,47 +283,47 @@ private String lldeath; - public String getLldeath() - { - return lldeath; - } - - private String llmdeath; - - public String getLlmdeath() - { - return llmdeath; - } - - private String lluuidspe; - - public String getLluuidspe() - { - return lluuidspe; - } - - private String lluuidspep; - - public String getLluuidspep() - { - return lluuidspep; - } - - private String lldidsp; - - public String getLldidsp() - { - return lldidsp; - } - - private String llidspl; - - public String getLlidspl() - { - return llidspl; - } + public String getLldeath() + { + return lldeath; + } + + private String llmdeath; + + public String getLlmdeath() + { + return llmdeath; + } + + private String lluuidspe; + + public String getLluuidspe() + { + return lluuidspe; + } + + private String lluuidspep; + + public String getLluuidspep() + { + return lluuidspep; + } + + private String lldidsp; + + public String getLldidsp() + { + return lldidsp; + } + + private String llidspl; + + public String getLlidspl() + { + return llidspl; + } - private int maxRecordNo; + private int maxRecordNo; public int getMaxRecordNo() { @@ -320,7 +336,79 @@ { return locked; } - + + //SelectAction Source Code + + private OrganisationUnit organisationUnit; + + public OrganisationUnit getOrganisationUnit() + { + return organisationUnit; + } + + private List dataSets = new ArrayList(); + + public Collection getDataSets() + { + return dataSets; + } + + private Boolean haveSection; + + public Boolean getHaveSection() + { + return haveSection; + } + + + private List periods = new ArrayList(); + + public Collection getPeriods() + { + return periods; + } + + private String selStartDate; + + public String getSelStartDate() + { + return selStartDate; + } + + private String selEndDate; + + public String getSelEndDate() + { + return selEndDate; + } + + private Boolean customDataEntryFormExists; + + public Boolean getCustomDataEntryFormExists() + { + return this.customDataEntryFormExists; + } + + + private String useSectionForm; + + public String getUseSectionForm() + { + return useSectionForm; + } + + public void setUseSectionForm( String useSectionForm ) + { + this.useSectionForm = useSectionForm; + } +/* + private static final String DEFAULT_FORM = "defaultform"; + + private static final String MULTI_DIMENSIONAL_FORM = "multidimensionalform"; + + private static final String SECTION_FORM = "sectionform"; + */ + // ------------------------------------------------------------------------- // Action implementation // ------------------------------------------------------------------------- @@ -328,6 +416,183 @@ public String execute() throws Exception { + + //SelectAction Source Code + + // --------------------------------------------------------------------- + // Validate selected OrganisationUnit + // --------------------------------------------------------------------- + + organisationUnit = selectedStateManager.getSelectedOrganisationUnit(); + + if ( organisationUnit == null ) + { + selectedDataSetId = null; + selectedPeriodIndex = null; + + selectedStateManager.clearSelectedDataSet(); + selectedStateManager.clearSelectedPeriod(); + + return SUCCESS; + } + + // --------------------------------------------------------------------- + // Load DataSets + // --------------------------------------------------------------------- + + dataSets = new ArrayList( organisationUnit.getDataSets() ); + //dataSets = new ArrayList( dataSetService.getDataSetsBySource( organisationUnit ) ); + + // --------------------------------------------------------------------- + // Remove DataSets which don't have a CalendarPeriodType or are locked + // --------------------------------------------------------------------- + + Iterator it = dataSets.iterator(); + + while ( it.hasNext() ) + { + DataSet temp = it.next(); + + if(temp.getName().equalsIgnoreCase( LLDataSets.LL_IDSP_LAB ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS_IDSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTSP ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_BIRTHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_DEATHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_MATERNAL_DEATHS ) || temp.getName().equalsIgnoreCase( LLDataSets.LL_UU_IDSP_EVENTS )) + { + if ( !( temp.getPeriodType() instanceof CalendarPeriodType ) ) + { + it.remove(); + } + } + else + { + it.remove(); + } + } + + Collections.sort( dataSets, new DataSetNameComparator() ); + + // --------------------------------------------------------------------- + // Validate selected DataSet + // --------------------------------------------------------------------- + + DataSet selectedDataSet; + + if ( selectedDataSetId != null ) + { + selectedDataSet = dataSetService.getDataSet( selectedDataSetId ); + } + else + { + selectedDataSet = selectedStateManager.getSelectedDataSet(); + } + + if ( selectedDataSet != null && dataSets.contains( selectedDataSet ) ) + { + selectedDataSetId = selectedDataSet.getId(); + selectedStateManager.setSelectedDataSet( selectedDataSet ); + } + else + { + selectedDataSetId = null; + selectedPeriodIndex = null; + + selectedStateManager.clearSelectedDataSet(); + selectedStateManager.clearSelectedPeriod(); + + return SUCCESS; + } + + // --------------------------------------------------------------------- + // Prepare for multidimensional dataentry + // --------------------------------------------------------------------- + + //List
sections = (List
) sectionService.getSectionByDataSet( selectedDataSet ); + + List
sections = new ArrayList
(); + + haveSection = sections.size() != 0; + + int numberOfTotalColumns = 1; + + if ( selectedDataSet.getDataElements().size() > 0 ) + { + for( DataElement de : selectedDataSet.getDataElements() ) + { + for ( DataElementCategory category : de.getCategoryCombo().getCategories() ) + { + numberOfTotalColumns = numberOfTotalColumns * category.getCategoryOptions().size(); + } + + if( numberOfTotalColumns > 1 ) + { + break; + } + } + + } + + // --------------------------------------------------------------------- + // Generate Periods + // --------------------------------------------------------------------- + + periods = selectedStateManager.getPeriodList(); + + // --------------------------------------------------------------------- + // Validate selected Period + // --------------------------------------------------------------------- + + if ( selectedPeriodIndex == null ) + { + selectedPeriodIndex = selectedStateManager.getSelectedPeriodIndex(); + System.out.println("Period is null"); + } + + if ( selectedPeriodIndex != null && selectedPeriodIndex >= 0 && selectedPeriodIndex < periods.size() ) + { + Period selPeriod = periods.get( selectedPeriodIndex ); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); + selStartDate = simpleDateFormat.format( selPeriod.getStartDate() ); + selEndDate = simpleDateFormat.format( selPeriod.getEndDate() ); + + selectedStateManager.setSelectedPeriodIndex( selectedPeriodIndex ); + } + else + { + selectedPeriodIndex = null; + selectedStateManager.clearSelectedPeriod(); + + return SUCCESS; + } + + // --------------------------------------------------------------------- + // Get the custom data entry form (if any) + // --------------------------------------------------------------------- + + // Locate custom data entry form belonging to dataset, if any. + + //DataEntryForm dataEntryForm = selectedDataSet.getDataEntryForm(); + + //dataEntryFormService.getDataEntryFormByDataSet( selectedDataSet ); + + + /* + customDataEntryFormExists = ( dataEntryForm != null); + + if ( useSectionForm != null ) + { + return SECTION_FORM; + } + + if ( numberOfTotalColumns > 1 ) + { + return MULTI_DIMENSIONAL_FORM; + } + else + { + return DEFAULT_FORM; + } + */ + // } + + // FormAction Source Code + //Intialization llbirth = LLDataSets.LL_BIRTHS; lldeath = LLDataSets.LL_DEATHS; === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java' --- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java 2011-04-27 17:15:13 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/action/SelectAction.java 2011-10-07 12:25:01 +0000 @@ -224,6 +224,11 @@ public String execute() throws Exception { + + + + + // --------------------------------------------------------------------- // Validate selected OrganisationUnit // --------------------------------------------------------------------- === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/impl/HibernateLLDataValueStore.java' --- local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/impl/HibernateLLDataValueStore.java 2011-04-27 17:15:13 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/java/org/hisp/dhis/den/impl/HibernateLLDataValueStore.java 2011-10-07 12:25:01 +0000 @@ -2375,7 +2375,7 @@ return deValueMap; } - + /* public void removeLLRecord( int recordNo ) { //Connection con = sessionFactory.getCurrentSession().connection(); @@ -2413,4 +2413,18 @@ } } } + */ + public void removeLLRecord( int recordNo ) + { + String query = "DELETE from lldatavalue WHERE recordno = " + recordNo; + + try + { + jdbcTemplate.update( query ); + } + catch ( Exception e ) + { + System.out.println( "SQL Exception while deleting : " + e.getMessage() ); + } + } } === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml' --- local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml 2011-04-27 17:15:13 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/resources/META-INF/dhis/beans.xml 2011-10-07 12:25:01 +0000 @@ -101,7 +101,9 @@ + ref="org.hisp.dhis.datalock.DataSetLockService"/> + select.action - - - defaultform - sectionform - multidimensionalform - /main.vm - /dhis-web-dataentry-national/select.vm - /dhis-web-dataentry-national/menu.vm - ../dhis-web-commons/ouwt/ouwt.js,javascript/calendar.js,javascript/calendar-lang.js,javascript/calendar-setup.js,javascript/general.js,javascript/form.js - - style/dhis-web-dataentry-national.css,style/custom_data_entry_form_styles.css - - select.action @@ -32,8 +19,8 @@ select.action - - + + /main.vm /dhis-web-dataentry-national/form.vm @@ -42,25 +29,7 @@ style/dhis-web-dataentry-national.css,style/custom_data_entry_form_styles.css - - - - /main.vm - /dhis-web-dataentry-national/setionform.vm - /dhis-web-dataentry-national/menu.vm - ../dhis-web-commons/ouwt/ouwt.js,javascript/general.js,javascript/form.js - style/dhis-web-dataentry-national.css - - - - - /main.vm - /dhis-web-dataentry-national/multidimensional/form.vm - /dhis-web-dataentry-national/menu.vm - ../dhis-web-commons/ouwt/ouwt.js,javascript/multidimensional.js,javascript/form.js - style/dhis-web-dataentry-national.css,style/custom_data_entry_form_styles.css - - + status.vm === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/form.vm' --- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/form.vm 2010-06-04 11:50:05 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/form.vm 2011-10-07 12:25:01 +0000 @@ -1,26 +1,9 @@ - + #parse( "/dhis-web-dataentry-national/select.vm" ) -#if ( $customDataEntryFormExists && !$useDefaultForm ) - - ##foreach( $optionCombo in $optionCombos ) - #foreach( $optionCombo in $orderdCategoryOptionCombos ) - - - - - - #end - - $customDataEntryFormCode - -#elseif($selDSName.equals($llbirth)) + +#if($selDSName.equals($llbirth)) #parse( "/dhis-web-dataentry-national/llbirthForm.vm" ) #elseif($selDSName.equals($lldeath)) #parse( "/dhis-web-dataentry-national/lldeathForm.vm" ) @@ -36,147 +19,5 @@ #parse( "/dhis-web-dataentry-national/llidspl.vm" ) #else - - - - - - - - - - - - - - - - - - - - -#set( $count = 0 ) -#set( $mark = 0 ) -#set( $tabIndex = 1 ) -#foreach( $dataElement in $orderedDataElements ) - #set( $count = $count + 1 ) - #if( $mark == 1 ) - #set( $mark = 0 ) - #else - #set( $mark = 1 ) - #end - #set( $dataValue = false ) - #set( $dataValue = $dataValueMap.get( $dataElement.id ) ) - #set( $calculatedValue = false ) - #set( $calculatedValue = $calculatedValueMap.get( $dataElement ) ) - #set( $minMax = false ) - #set( $minMax = $minMaxMap.get( $dataElement.id ) ) - #set( $calculated = false ) - #set( $calculated = ($calculatedDataElementIds.contains($dataElement.id)) ) - - ##count - - - ##data element name - - - ##type - - - ##min value - - - ##entry - - - ##max value - - - ##comment - - - - - #set( $tabIndex = $tabIndex + 1 ) -#end -
$i18n.getString( "nr" )$i18n.getString( "data_element" )$i18n.getString( "type" )$i18n.getString( "min" )$i18n.getString( "entry" )$i18n.getString( "max" )$i18n.getString( "comment" )
$count - - #if( $dataElement.type == "int" && $auth.hasAccess( "dhis-web-dataentry", "viewHistory" ) ) - - #end - #if( $useShortName ) - $encoder.htmlEncode( $dataElement.shortName ) - #else - $encoder.htmlEncode( $dataElement.name ) - #end - #if( $dataElement.type == "int" && $auth.hasAccess( "dhis-web-dataentry", "viewHistory" ) ) - - #end - - $dataElementTypeMap.get( $dataElement.type ) - #if( $dataElement.type == "int" ) -
$!minMax.min
- #end -
- #if( $dataElement.type == "bool" ) - - #else - #set( $minMaxError = false ) - #if( $dataElement.type == "int" && $dataValue && $minMax && !$calculated ) - #if( $integer.parseInt( $dataValue.value ) < $minMax.min || $integer.parseInt( $dataValue.value ) > $minMax.max ) - #set( $minMaxError = true ) - #end - #end - #if ( $calculated ) - - #else - - #end - #end - - #if( $dataElement.type == "int" ) -
$!minMax.max
- #end -
- - -
-#end - - \ No newline at end of file +

No Dataentry form available for selected DataSet/DataSet not assign to selected Organisation Unit

+#end \ No newline at end of file === modified file 'local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/select.vm' --- local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/select.vm 2011-01-19 13:29:17 +0000 +++ local/in/dhis-web-dataentry-linelisting/src/main/webapp/dhis-web-dataentry-national/select.vm 2011-10-07 12:25:01 +0000 @@ -56,7 +56,7 @@
- + + + + + + + +
+ #organisationUnitSelectionTree( false, true, false ) +
+ + +
- + \ No newline at end of file === modified file 'local/in/dhis-web-reports-national/src/main/resources/struts.xml' --- local/in/dhis-web-reports-national/src/main/resources/struts.xml 2011-07-07 08:22:34 +0000 +++ local/in/dhis-web-reports-national/src/main/resources/struts.xml 2011-10-07 12:25:01 +0000 @@ -66,18 +66,6 @@ plainTextError
- - /main.vm @@ -91,45 +79,6 @@ reportManagement.action - - - - - - - - - - - - === modified file 'local/in/dhis-web-survey/src/main/resources/struts.xml' --- local/in/dhis-web-survey/src/main/resources/struts.xml 2011-06-22 11:47:58 +0000 +++ local/in/dhis-web-survey/src/main/resources/struts.xml 2011-10-07 12:25:01 +0000 @@ -17,31 +17,7 @@ - - - - - - - - - - - - + /main.vm @@ -110,21 +86,6 @@ - - - - - - - - /main.vm @@ -139,33 +100,6 @@ index.action - /dhis-web-survey/responseSurveyObject.vm @@ -178,48 +112,7 @@ class="org.hisp.dhis.survey.action.EmptyAction"> select.action - - - - - - - - + /main.vm @@ -305,21 +198,7 @@ class="org.hisp.dhis.survey.action.EmptyAction"> selectTarget.action - - + /main.vm @@ -407,21 +286,6 @@ - - - - - - - - - @@ -438,23 +302,7 @@ - - - - + /main.vm