← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16679: Data entry, replacing variables in global ns

 

------------------------------------------------------------
revno: 16679
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-09-09 23:27:53 -0400
message:
  Data entry, replacing variables in global ns
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.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/webapp/dhis-web-dataentry/javascript/form.js'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-09-10 02:39:02 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry/javascript/form.js	2014-09-10 03:27:53 +0000
@@ -1,6 +1,7 @@
 
 dhis2.util.namespace( 'dhis2.de' );
 dhis2.util.namespace( 'dhis2.de.event' );
+dhis2.util.namespace( 'dhis2.de.cst' );
 
 // whether current user has any organisation units
 dhis2.de.emptyOrganisationUnits = false;
@@ -86,15 +87,15 @@
 var COLOR_BORDER_ACTIVE = '#73ad72';
 var COLOR_BORDER = '#aaa';
 
-var DEFAULT_TYPE = 'int';
-var DEFAULT_NAME = '[unknown]';
+dhis2.de.cst.defaultType = 'int';
+dhis2.de.cst.defaultName = '[unknown]';
 
 // Form types
 
-var FORMTYPE_CUSTOM = 'custom';
-var FORMTYPE_SECTION = 'section';
-var FORMTYPE_MULTIORG_SECTION = 'multiorg_section';
-var FORMTYPE_DEFAULT = 'default';
+dhis2.de.cst.formTypeCustom = 'custom';
+dhis2.de.cst.formTypeSection = 'section';
+dhis2.de.cst.formTypeMultiOrgSection = 'multiorg_section';
+dhis2.de.cst.formTypeDefault = 'default';
 
 // Events
 
@@ -743,7 +744,7 @@
 	}
 
 	console.log( 'Data element not present in data set, falling back to default type: ' + dataElementId );
-	return DEFAULT_TYPE;
+	return dhis2.de.cst.defaultType;
 }
 
 function getDataElementName( dataElementId )
@@ -756,7 +757,7 @@
 	}
 
     console.log( 'Data element not present in form, falling back to default name: ' + dataElementId );
-	return DEFAULT_NAME;
+	return dhis2.de.cst.defaultName;
 }
 
 function getOptionComboName( optionComboId )
@@ -769,7 +770,7 @@
 	}
 
     console.log( 'Category option combo not present in form, falling back to default name: ' + optionComboId );
-	return DEFAULT_NAME;
+	return dhis2.de.cst.defaultName;
 }
 
 // ----------------------------------------------------------------------------
@@ -917,7 +918,7 @@
             }
         } );
 
-        if ( !found && ( formType == FORMTYPE_SECTION || formType == FORMTYPE_DEFAULT ) )
+        if ( !found && ( formType == dhis2.de.cst.formTypeSection || formType == dhis2.de.cst.formTypeDefault ) )
         {
             filteredDataSetList.push(item);
         }