← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 12503: Data entry, impl rendering of data elements with value type long text as text areas in section forms

 

------------------------------------------------------------
revno: 12503
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-10-08 15:40:12 +0200
message:
  Data entry, impl rendering of data elements with value type long text as text areas in section forms
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm


--
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/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2013-10-08 13:00:44 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2013-10-08 13:40:12 +0000
@@ -53,8 +53,9 @@
 // Is this form a multiOrg form?
 var multiOrganisationUnit = false;
 
-// local cache of organisationUnits (used for name lookup)
-// var organisationUnits = [];
+// "organisationUnits" object inherited from ouwt.js
+
+// TODO remove all usage of name="entryfield" etc and migrate to class="entryfield" etc
 
 var COLOR_GREEN = '#b9ffb9';
 var COLOR_YELLOW = '#fffe8c';
@@ -82,7 +83,8 @@
 
 function getCurrentOrganisationUnit() 
 {
-    if ( $.isArray( currentOrganisationUnitId ) ) {
+    if ( $.isArray( currentOrganisationUnitId ) ) 
+    {
         return currentOrganisationUnitId[0];
     }
 
@@ -392,7 +394,6 @@
 		if ( formType != FORMTYPE_CUSTOM )
 		{
         	$( this ).css( 'width', '100%' );
-        	$( this ).css( 'text-align', 'center' );
 		}
 
         if ( type == 'date' )
@@ -401,6 +402,20 @@
             datePicker( id );
         }
     } );
+    
+    $( '.entryfield' ).not( '.entryarea' ).each( function( i )
+    {
+		if ( formType != FORMTYPE_CUSTOM )
+		{
+        	$( this ).css( 'text-align', 'center' );
+		}
+    } );
+
+    $( '.entryarea' ).each( function( i )
+    {
+    	$( this ).css( 'min-width', '264px' );
+    	$( this ).css( 'min-height', '45px' );
+    } );
 
     $( '.entryselect' ).each( function( i )
     {

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2013-10-08 13:00:44 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm	2013-10-08 13:40:12 +0000
@@ -96,6 +96,8 @@
     </select><img class="commentlink" id="${commentId}"></td>
     #elseif( $dataElement.type == "trueOnly" )
         <td><input name="entrytrueonly" class="entrytrueonly" id="${dataEntryId}" type="checkbox" tabindex="${tabIndex}"#if( $greyedField || !$hasAccess ) disabled="disabled"#end><img class="commentlink" id="${commentId}"></td>
+    #elseif( $dataElement.type == "string" && "longText" == $dataElement.textType )
+        <td><textarea name="entryfield" class="entryfield entryarea" id="${dataEntryId}" tabindex="${tabIndex}" #if( $greyedField || !$hasAccess ) disabled="disabled"#end></textarea></td>
     #else
         #if( $dataElement.optionSet )
           <td><input name="entryoptionset" class="entryoptionset" id="${dataEntryId}" type="text" tabindex="${tabIndex}"#if( $greyedField || !$hasAccess ) disabled="disabled"#end></td>