← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4137: Cleanup

 

------------------------------------------------------------
revno: 4137
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-07-14 08:09:35 +0200
message:
  Cleanup
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java
  dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/GenerateTallySheetAction.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2011-07-13 15:09:37 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2011-07-14 06:09:35 +0000
@@ -162,22 +162,6 @@
         return orderedDataElements;
     }
 
-    private Boolean cdeFormExists;
-
-    public Boolean getCdeFormExists()
-    {
-        return cdeFormExists;
-    }
-
-    private String disabled = " ";
-
-    private DataEntryForm dataEntryForm;
-
-    public DataEntryForm getDataEntryForm()
-    {
-        return this.dataEntryForm;
-    }
-
     private String customDataEntryFormCode;
 
     public String getCustomDataEntryFormCode()
@@ -248,20 +232,6 @@
         return standardComments;
     }
 
-    private Map<String, String> dataElementValueTypeMap;
-
-    public Map<String, String> getDataElementValueTypeMap()
-    {
-        return dataElementValueTypeMap;
-    }
-
-    private Integer integer = 0; // TODO wtf
-
-    public Integer getInteger()
-    {
-        return integer;
-    }
-
     private Integer selectedDataSetId;
 
     public void setSelectedDataSetId( Integer selectedDataSetId )
@@ -526,16 +496,6 @@
         }
 
         // ---------------------------------------------------------------------
-        // Make the DataElement types available
-        // ---------------------------------------------------------------------
-
-        dataElementValueTypeMap = new HashMap<String, String>();
-        dataElementValueTypeMap.put( DataElement.VALUE_TYPE_DATE, i18n.getString( "date" ) );
-        dataElementValueTypeMap.put( DataElement.VALUE_TYPE_BOOL, i18n.getString( "yes_no" ) );
-        dataElementValueTypeMap.put( DataElement.VALUE_TYPE_INT, i18n.getString( "number" ) );
-        dataElementValueTypeMap.put( DataElement.VALUE_TYPE_STRING, i18n.getString( "text" ) );
-
-        // ---------------------------------------------------------------------
         // Get data entry form
         // ---------------------------------------------------------------------
 
@@ -600,27 +560,22 @@
     {
         DataSetLock dataSetLock = dataSetLockService.getDataSetLockByDataSetAndPeriod( dataSet, period );
 
-        if ( dataSetLock != null && dataSetLock.getSources().contains( organisationUnit ) )
-        {
-            disabled = "disabled";
-        }
+        String disabled = dataSetLock != null && dataSetLock.getSources().contains( organisationUnit ) ? "disabled" : "";
 
         // ---------------------------------------------------------------------
         // Get the custom data entry form (if any)
         // ---------------------------------------------------------------------
 
-        dataEntryForm = dataSet.getDataEntryForm();
-
-        cdeFormExists = (dataEntryForm != null);
-
-        if ( cdeFormExists )
+        DataEntryForm dataEntryForm = dataSet.getDataEntryForm();
+
+        if ( dataEntryForm != null )
         {
             customDataEntryFormCode = dataEntryFormService.prepareDataEntryFormForEntry( 
                 dataEntryForm.getHtmlCode(), disabled, i18n, dataSet );
         }
 
         // ---------------------------------------------------------------------
-        // Working on the display of dataelements
+        // Working on the display of data elements
         // ---------------------------------------------------------------------
 
         List<DataElement> des = new ArrayList<DataElement>();

=== modified file 'dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/GenerateTallySheetAction.java'
--- dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/GenerateTallySheetAction.java	2010-10-15 10:47:44 +0000
+++ dhis-2/dhis-web/dhis-web-reporting/src/main/java/org/hisp/dhis/reporting/tallysheet/action/GenerateTallySheetAction.java	2011-07-14 06:09:35 +0000
@@ -108,25 +108,17 @@
     }
 
     // -------------------------------------------------------------------------
-    // Variables
-    // -------------------------------------------------------------------------
-
-    private TallySheet tallySheet;
-
-    private List<TallySheetTuple> tallySheetTuples;
-
-    // -------------------------------------------------------------------------
     // Action implementation
     // -------------------------------------------------------------------------
 
     public String execute()
         throws Exception
     {
-        tallySheet = (TallySheet) ActionContext.getContext().getSession().get( TallySheet.KEY_TALLY_SHEET );
+        TallySheet tallySheet = (TallySheet) ActionContext.getContext().getSession().get( TallySheet.KEY_TALLY_SHEET );
 
         if ( tallySheet != null )
         {
-            tallySheetTuples = tallySheet.getTallySheetTuples();
+            List<TallySheetTuple> tallySheetTuples = tallySheet.getTallySheetTuples();
 
             for ( int i = 0; i < checked.length; i++ )
             {