← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2946: Merging changes from 2.0.6

 

------------------------------------------------------------
revno: 2946
committer: Bharath <chbharathk@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-03-01 14:10:19 +0530
message:
  Merging changes from 2.0.6
modified:
  local/in/dhis-web-survey/src/main/java/org/hisp/dhis/detarget/action/SavetargetValueAction.java
  local/in/dhis-web-survey/src/main/java/org/hisp/dhis/detarget/action/UpdateDeTargetAction.java
  local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/SaveValueAction.java
  local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/general.js


--
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 'local/in/dhis-web-survey/src/main/java/org/hisp/dhis/detarget/action/SavetargetValueAction.java'
--- local/in/dhis-web-survey/src/main/java/org/hisp/dhis/detarget/action/SavetargetValueAction.java	2011-01-15 11:35:42 +0000
+++ local/in/dhis-web-survey/src/main/java/org/hisp/dhis/detarget/action/SavetargetValueAction.java	2011-03-01 08:40:19 +0000
@@ -106,6 +106,13 @@
         return optionComboId;
     }
 
+    private int statusCode=0;
+
+    public int getStatusCode()
+    {
+        return statusCode;
+    }
+
     private Date timestamp;
 
     public Date getTimestamp()
@@ -177,22 +184,29 @@
                 dataValue = new DeTargetDataValue( deTarget, dataElement, optionCombo, orgUnit, period, value, storedBy, new Date() );
 
                 deTargetdataValueService.addDeTargetDataValue( dataValue );
+            }
+        }
+        else
+        {
+            if( value != null )
+            {
+                LOG.debug( "Updating DataValue, value added/changed" );
+        
+                dataValue.setValue( value );
+                dataValue.setTimestamp( new Date() );
+                dataValue.setStoredBy( storedBy );
+        
+                deTargetdataValueService.updateDeTargetDataValue( dataValue );
+            }
+            else
+            {
+                LOG.debug( "Deleting DataValue, null value deleted" );
                 
+                deTargetdataValueService.deleteDeTargetDataValue( dataValue );                
             }
         }
-        else
-            {       
-                    LOG.debug( "Updating DataValue, value added/changed" );
-            
-                    dataValue.setValue( value );
-                    dataValue.setTimestamp( new Date() );
-                    dataValue.setStoredBy( storedBy );
-            
-                    deTargetdataValueService.updateDeTargetDataValue( dataValue );
-                    
-            }
             
         return SUCCESS;
     }
 
-}
+}
\ No newline at end of file

=== modified file 'local/in/dhis-web-survey/src/main/java/org/hisp/dhis/detarget/action/UpdateDeTargetAction.java'
--- local/in/dhis-web-survey/src/main/java/org/hisp/dhis/detarget/action/UpdateDeTargetAction.java	2011-01-20 13:19:33 +0000
+++ local/in/dhis-web-survey/src/main/java/org/hisp/dhis/detarget/action/UpdateDeTargetAction.java	2011-03-01 08:40:19 +0000
@@ -169,13 +169,11 @@
         System.out.println( " \n+++++++++ deTarget Id:" +  deTargetId );
        
         DeTarget deTarget = deTargetService.getDeTarget( deTargetId );
-        //deTargetService.getDeTarget( deTargetId );
         deTarget.setName( name );
         deTarget.setShortName( shortName );
         deTarget.setUrl( url );
         deTarget.setDescription( description );
         
-        
         if ( deTargetId != 0 )
         {
              deTarget = deTargetService.getDeTarget( deTargetId );
@@ -185,16 +183,9 @@
              {
                  selectedDeTargetMember.add( dataElementTarget.getDataelements().getId()+":" + dataElementTarget.getDecategoryOptionCombo().getId() );
              }
-                //indicators.removeAll( survey.getIndicators() );
         }
         
-        //deTargetMemberList = new ArrayList<DeTargetMember>(deTargetService.getDeTargetMembers( deTarget ));
-        
-        
-        
-      
-        
-        List<DeTargetDataValue> dataValueList = new ArrayList<DeTargetDataValue>( deTargetdataValueService.getDeTargetDataValues( deTarget));
+        List<DeTargetDataValue> dataValueList = new ArrayList<DeTargetDataValue>( deTargetdataValueService.getDeTargetDataValues( deTarget) );
         
         System.out.println( " \n+++++++++ size of datavalueList is " +  dataValueList.size() );
        
@@ -208,18 +199,10 @@
                 DataElement dataElement = dataElementService.getDataElement(  Integer.parseInt( parts[0] ) );
                 DataElementCategoryOptionCombo decoc = dataElementCategoryService.getDataElementCategoryOptionCombo( Integer.parseInt( parts[1] ));
                 
-               // List<DeTargetDataValue> dataValueList = new ArrayList<DeTargetDataValue>(deTargetdataValueService.getDeTargetDataValues( deTarget, dataElement, decoc ));
-                
                 DeTargetMember deTargetMember = new DeTargetMember( deTarget, dataElement, decoc);
                 
                 deTargetService.addDeTargetMember( deTargetMember );
-                
-                //deTargetService.updateDeTargetMember( deTargetMember );
-                //System.out.println( dataElement + ":" +  decoc );
-                
-               
             }
-            
         }
         else
         {

=== modified file 'local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/SaveValueAction.java'
--- local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/SaveValueAction.java	2010-06-04 11:50:05 +0000
+++ local/in/dhis-web-survey/src/main/java/org/hisp/dhis/survey/action/SaveValueAction.java	2011-03-01 08:40:19 +0000
@@ -106,7 +106,7 @@
         this.indicatorId = indicatorId;
     }    
 
-    private int statusCode;
+    private int statusCode=0;
 
     public int getStatusCode()
     {

=== modified file 'local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/general.js'
--- local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/general.js	2011-01-20 13:19:33 +0000
+++ local/in/dhis-web-survey/src/main/webapp/dhis-web-survey/javascript/general.js	2011-03-01 08:40:19 +0000
@@ -216,10 +216,11 @@
     }   
     
     function markTargetValue( color )
-    {        
+    {  
+    	var elementId = 'value[' + dataElementId + ':' + optionComboId +'].value'
        //var element = document.getElementById( 'value[' + deOptionComboId + '].value' );
        // var element = document.getElementById( 'value[' + optionComboId + '].value' );
-        var element = document.getElementById( 'value[' + dataElementId + '].value' );
+        var element = document.getElementById( elementId );
         element.style.backgroundColor = color;
     }
 }