← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 859: implemented DATE dataelement type

 

------------------------------------------------------------
revno: 859
committer: abyot <abyota@xxxxxxxxx>
branch nick: trunk
timestamp: Wed 2009-10-14 10:15:42 +0200
message:
  implemented DATE dataelement type
removed:
  dhis-2/dhis-web/dhis-web-openhealth-integration/
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/StatementInterceptor.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/CalculateCDEsAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/general.js
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm
  dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/RunValidationAction.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-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java	2009-10-13 20:08:57 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/service/DefaultImportObjectManager.java	2009-10-14 08:15:42 +0000
@@ -29,10 +29,8 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 
 import org.amplecode.quick.BatchHandler;
 import org.amplecode.quick.BatchHandlerFactory;

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/StatementInterceptor.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/StatementInterceptor.java	2009-10-10 15:35:01 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/StatementInterceptor.java	2009-10-14 08:15:42 +0000
@@ -30,7 +30,6 @@
 import org.amplecode.quick.StatementManager;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.hisp.dhis.system.deletion.DeletionManager;
 import org.aspectj.lang.ProceedingJoinPoint;
 
 /**

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/CalculateCDEsAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/CalculateCDEsAction.java	2009-10-13 14:08:04 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/CalculateCDEsAction.java	2009-10-14 08:15:42 +0000
@@ -34,8 +34,6 @@
 
 import org.hisp.dhis.dataelement.CalculatedDataElement;
 import org.hisp.dhis.dataelement.DataElement;
-import org.hisp.dhis.dataelement.DataElementCategoryCombo;
-import org.hisp.dhis.dataelement.DataElementCategoryComboService;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionComboService;
 import org.hisp.dhis.dataelement.DataElementService;

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java	2009-10-13 20:08:57 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java	2009-10-14 08:15:42 +0000
@@ -603,6 +603,8 @@
 
                 DataElement dataElement = dataElementMap.get( dataElementId ); //dataElementService.getDataElement( dataElementId );
                 
+                System.out.println("The dataset is:  " + dataSet.getId() + "  and the data element:  " + dataElementId );
+                
                 // -------------------------------------------------------------
                 // Find type of data element
                 // -------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2009-05-22 22:55:18 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/resources/org/hisp/dhis/de/i18n_module.properties	2009-10-14 08:15:42 +0000
@@ -1,3 +1,4 @@
+value_date 							= Value Date
 dataelement_comment					= Comment
 please_design_a_custom_form			= Please design a custom FORM for this dataSet !!
 import_export						= Import/Export
@@ -64,6 +65,7 @@
 yes_no								= Yes/no
 number								= Number
 text								= Text
+date								= Date
 min_limit							= Min limit
 max_limit							= Max limit
 dataelement_history					= Data element history

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm	2009-09-27 20:13:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/form.vm	2009-10-14 08:15:42 +0000
@@ -90,13 +90,23 @@
 		<td>				
 				
 		#if( $dataElement.type == "bool" )
-			<select name="entryselect" id="value[$dataElement.id].value" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" )) onchange="saveBoolean( $dataElement.id, $optionComboId, this )" #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>				
+			<select name="entryselect" id="value[$dataElement.id].boolean" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue" )) onchange="saveBoolean( $dataElement.id, $optionComboId, this )" #else disabled="disabled" #end style="width:100%" tabindex="$tabIndex" #if( $locked ) disabled="disabled"#end>				
 				<option value="">[$i18n.getString( "no_value" )]</option>
 				<option value="true" #if( $dataValue.value == "true" ) selected="selected" #end>$i18n.getString( "yes" )</option>
 				<option value="false" #if( $dataValue.value == "false" ) selected="selected" #end>$i18n.getString( "no" )</option>
 			</select>				
-		#else
-           
+		
+		#elseif( $dataElement.type == "date" )
+			<input name="entryfield" id="value[$dataElement.id].date" type="text" value="$!encoder.htmlEncode( $dataValue.value )" #if( $auth.hasAccess( "dhis-web-dataentry", "saveValue") ) onchange="saveDate( $dataElement.id, '$encoder.jsEncode( $dataElement.name )' )" #else disabled="disabled" #end>
+            <img src="../images/calendar_icon.gif" width="16" height="16" id="getValueDate" style="cursor: pointer;" title="$i18n.getString("date_selector")" onmouseover="this.style.background='orange';" onmouseout="this.style.background=''" alt="$i18n.getString( "value_date" )">
+            <script type="text/javascript">
+            	Calendar.setup({
+                	inputField     :    "value[$dataElement.id].date",      // id of the input field
+                    ifFormat       :    "$i18n.getString("format.date.label")",       // format of the input field
+                    button         :    "getValueDate"   // trigger for the calendar (button ID)
+                });
+            </script>                    
+        #else           
             #if( $dataElement.type == "string" )
                 #set( $coun = 0 ) 
                 #foreach($customValue in $customValues)

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/general.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/general.js	2009-03-12 11:40:58 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/general.js	2009-10-14 08:15:42 +0000
@@ -152,6 +152,18 @@
     valueSaver.save();
 }
 
+function saveDate( dataElementId, dataElementName )
+{
+	
+	var field = document.getElementById( 'value[' + dataElementId + '].date' );
+    var type = document.getElementById( 'value[' + dataElementId + '].type' ).innerHTML;
+    
+    field.style.backgroundColor = '#ffffcc';
+    
+    var valueSaver = new ValueSaver( dataElementId, '', field.value, '#ccffcc', '' );
+    valueSaver.save();
+}
+
 function saveComment( dataElementId, optionComboId, commentValue )
 {
     var field = document.getElementById( 'value[' + dataElementId + ':' + optionComboId + '].comment' );                
@@ -225,7 +237,7 @@
     
     function markValue( color )
     {
-        var type = document.getElementById( 'value[' + dataElementId + '].type' ).innerText;       
+        var type = document.getElementById( 'value[' + dataElementId + '].type' ).innerHTML;       
         
         var element;
         
@@ -233,6 +245,10 @@
         {
             element = document.getElementById( 'value[' + dataElementId + '].boolean' );
         }
+        else if( type == 'date' )
+        {
+        	element = document.getElementById( 'value[' + dataElementId + '].date' );
+        }
         else if( selectedOption )
         {
         	element = selectedOption;    

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm	2009-05-28 11:18:43 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/addDataElementForm.vm	2009-10-14 08:15:42 +0000
@@ -34,6 +34,7 @@
 				<option value="int" selected="selected">$i18n.getString( "number" )</option>
 				<option value="string">$i18n.getString( "text" )</option>
 				<option value="bool">$i18n.getString( "yes_no" )</option>
+				<option value="date">$i18n.getString( "date" )</option>
 			</select>
 		</td>
 	</tr>

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm	2009-05-28 11:18:43 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/updateDataElementForm.vm	2009-10-14 08:15:42 +0000
@@ -47,6 +47,7 @@
 				<option value="int" #if( $dataElement.type == 'int' ) selected="selected" #end>$i18n.getString( "number" )</option>
 				<option value="string" #if( $dataElement.type == 'string' ) selected="selected" #end>$i18n.getString( "text" )</option>
 				<option value="bool" #if( $dataElement.type == 'bool' ) selected="selected" #end>$i18n.getString( "yes_no" )</option>
+				<option value="date" #if( $dataElement.type == 'date' ) selected="selected" #end>$i18n.getString( "date" )</option>
 			</select>
 		</td>
 	</tr>

=== removed directory 'dhis-2/dhis-web/dhis-web-openhealth-integration'
=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/RunValidationAction.java'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/RunValidationAction.java	2009-10-10 15:35:01 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/java/org/hisp/dhis/validationrule/action/RunValidationAction.java	2009-10-14 08:15:42 +0000
@@ -33,7 +33,6 @@
 import java.util.HashSet;
 import java.util.List;
 
-import org.amplecode.quick.StatementManager;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.hisp.dhis.i18n.I18nFormat;