dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #13696
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4465: Fixed bug, certain css should not be applied to custom forms
------------------------------------------------------------
revno: 4465
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2011-08-27 13:14:30 +0200
message:
Fixed bug, certain css should not be applied to custom forms
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/customForm.vm
dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm
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-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2011-08-25 12:32:42 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataentryform/DefaultDataEntryFormService.java 2011-08-27 11:14:30 +0000
@@ -232,8 +232,8 @@
int i = 1;
- final String jsCodeForInputFields = " name=\"entryfield\" ";
- final String jsCodeForSelectLists = " name=\"entryselect\" ";
+ final String codeForInputFields = " name=\"entryfield\" ";
+ final String codeForSelectLists = " name=\"entryselect\" ";
StringBuffer sb = new StringBuffer();
@@ -289,7 +289,7 @@
if ( dataElement.getType().equals( VALUE_TYPE_BOOL ) )
{
- appendCode += jsCodeForSelectLists + "tabindex=\"" + i++ + "\">";
+ appendCode += codeForSelectLists + "tabindex=\"" + i++ + "\">";
appendCode += "<option value=\"\">" + i18n.getString( "no_value" ) + "</option>";
appendCode += "<option value=\"true\">" + i18n.getString( "yes" ) + "</option>";
@@ -298,7 +298,7 @@
}
else
{
- appendCode += jsCodeForInputFields + "tabindex=\"" + i++ + "\"" + TAG_CLOSE;
+ appendCode += codeForInputFields + "tabindex=\"" + i++ + "\"" + TAG_CLOSE;
}
inputHtml = inputHtml.replace( TAG_CLOSE, appendCode );
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/customForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/customForm.vm 2011-08-13 17:39:25 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/customForm.vm 2011-08-27 11:14:30 +0000
@@ -1,1 +1,2 @@
+<input type="hidden" id="dataEntryFormType" value="custom"/>
$customDataEntryFormCode
=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2011-08-19 23:11:39 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/defaultForm.vm 2011-08-27 11:14:30 +0000
@@ -1,3 +1,4 @@
+<input type="hidden" id="dataEntryFormType" value="default"/>
#set( $tabIndex = 1 )
#set( $hasAccess = $auth.hasAccess( "dhis-web-dataentry", "saveValue" ) )
=== 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 2011-08-26 07:59:03 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js 2011-08-27 11:14:30 +0000
@@ -51,6 +51,10 @@
var DEFAULT_TYPE = 'int';
var DEFAULT_NAME = '[unknown]';
+var FORMTYPE_CUSTOM = 'custom';
+var FORMTYPE_SECTION = 'section';
+var FORMTYPE_DEFAULT = 'default';
+
/**
* Page init. The order of events is:
*
@@ -268,6 +272,8 @@
function addEventListeners()
{
+ var formType = $( '#dataEntryFormType' ) ? $( '#dataEntryFormType' ).val() : FORMTYPE_DEFAULT;
+
$( '[name="entryfield"]' ).each( function( i )
{
var id = $( this ).attr( 'id' );
@@ -300,8 +306,11 @@
keyPress( event, this );
} );
- $( this ).css( 'width', '100%' );
- $( this ).css( 'text-align', 'center' );
+ if ( formType != FORMTYPE_CUSTOM )
+ {
+ $( this ).css( 'width', '100%' );
+ $( this ).css( 'text-align', 'center' );
+ }
if ( type == 'date' )
{
=== 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 2011-08-19 23:11:39 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/sectionForm.vm 2011-08-27 11:14:30 +0000
@@ -1,3 +1,4 @@
+<input type="hidden" id="dataEntryFormType" value="section"/>
#set( $marker = 0 )
#set( $tabIndex = 1 )
#set( $hasAccess = $auth.hasAccess( "dhis-web-dataentry", "saveValue" ) )