← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 2073: Merged javascripts in dataentry

 

------------------------------------------------------------
revno: 2073
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2010-11-16 14:19:36 +0100
message:
  Merged javascripts in dataentry
removed:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/section.js
renamed:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/multidimensional.js => dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.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 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml	2010-11-15 19:13:42 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/struts.xml	2010-11-16 13:19:36 +0000
@@ -24,7 +24,7 @@
 			<param name="menuTreeHeight">420</param>
 			<param name="javascripts">
 				../dhis-web-commons/ouwt/ouwt.js,
-				javascript/multidimensional.js,
+				javascript/entry.js,
 				javascript/form.js
 			</param>
 			<param name="stylesheets">style/dhis-web-dataentry.css</param>
@@ -49,8 +49,7 @@
 			<param name="javascripts">
 				../dhis-web-commons/ouwt/ouwt.js,				
 				javascript/form.js,
-				javascript/section.js,
-				javascript/multidimensional.js,
+				javascript/entry.js,
 				../dhis-web-commons/calendar/calendar.js,
 				../dhis-web-commons/calendar/calendar-lang.js,
 				../dhis-web-commons/calendar/calendar-setup.js
@@ -68,7 +67,7 @@
 			<param name="javascripts">
 				../dhis-web-commons/ouwt/ouwt.js,
 				javascript/form.js,
-				javascript/multidimensional.js,
+				javascript/entry.js,
 				../dhis-web-commons/calendar/calendar.js,
 				../dhis-web-commons/calendar/calendar-lang.js,
 				../dhis-web-commons/calendar/calendar-setup.js

=== renamed file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/multidimensional.js' => 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/multidimensional.js	2010-11-15 19:13:42 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/entry.js	2010-11-16 13:19:36 +0000
@@ -106,7 +106,6 @@
     {
     	calculateCDE(dataElementId);
     }
-
 }
 
 function saveBoolean( dataElementId, optionComboId, selectedOption  )
@@ -219,56 +218,25 @@
     }
 }
 
-function CommentSaver( dataElementId_, optionComboId_, organisationUnitId_,  value_ )
+// -----------------------------------------------------------------------------
+// Section
+// -----------------------------------------------------------------------------
+
+function openCloseSection( sectionId )
 {
-    var SUCCESS = '#ccffcc';
-    var ERROR = '#ccccff';
-
-    var dataElementId = dataElementId_;
-    var optionComboId = optionComboId_;
-    var organisationUnitId = organisationUnitId_;
-    var value = value_;
-    
-    this.save = function()
-    {
-        var request = new Request();
-        request.setCallbackSuccess( handleResponse );
-        request.setCallbackError( handleHttpError );
-        request.setResponseTypeXML( 'status' );
-        request.send( 'saveComment.action?organisationUnitId=' + organisationUnitId + '&dataElementId=' +
-                dataElementId + '&optionComboId=' + optionComboId + '&comment=' + value );
-    };
-    
-    function handleResponse( rootElement )
-    {
-        var codeElement = rootElement.getElementsByTagName( 'code' )[0];
-        var code = parseInt( codeElement.firstChild.nodeValue );
-        
-        if ( code == 0 )
-        {
-            markComment( SUCCESS );           
-        }
-        else
-        {
-            markComment( ERROR );
-            window.alert( i18n_saving_comment_failed_status_code + '\n\n' + code );
-        }
-    }
-    
-    function handleHttpError( errorCode )
-    {
-        markComment( ERROR );
-        window.alert( i18n_saving_comment_failed_error_code + '\n\n' + errorCode );
-    }
-    
-    function markComment( color )
-    {
-        var field = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comment' );                
-        var select = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comments' );        
-
-        field.style.backgroundColor = color;
-        select.style.backgroundColor = color;
-    }
+	var divSection = document.getElementById( sectionId );
+	var sectionLabel = document.getElementById( sectionId + ":name" );	
+	
+	if( divSection.style.display == 'none' )
+	{			
+		divSection.style.display = ('block');
+		sectionLabel.style.textAlign = 'center';
+	}
+	else
+	{			
+		divSection.style.display = ('none');
+		sectionLabel.style.textAlign = 'left';
+	}
 }
 
 // -----------------------------------------------------------------------------

=== removed file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/section.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/section.js	2010-09-01 16:55:23 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/section.js	1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
-function openCloseSection( sectionId )
-{
-	var divSection = document.getElementById( sectionId );
-	var sectionLabel = document.getElementById( sectionId + ":name" );	
-	
-	if( divSection.style.display == 'none' )
-	{			
-		divSection.style.display = ('block');
-		sectionLabel.style.textAlign = 'center';
-	}
-	else
-	{			
-		divSection.style.display = ('none');
-		sectionLabel.style.textAlign = 'left';
-	}
-}
\ No newline at end of file