← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10648: Fixed bug, update indicator ui and validation ui to use new constant expression format

 

------------------------------------------------------------
revno: 10648
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sun 2013-04-21 22:06:01 +0200
message:
  Fixed bug, update indicator ui and validation ui to use new constant expression format
modified:
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorExpressionBuilderForm.vm
  dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expressionBuilder.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-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorExpressionBuilderForm.vm'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorExpressionBuilderForm.vm	2012-09-23 08:50:59 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-datadictionary/src/main/webapp/dhis-web-maintenance-datadictionary/indicatorExpressionBuilderForm.vm	2013-04-21 20:06:01 +0000
@@ -62,10 +62,10 @@
 		var target = jQuery( "#indicator-expression-container select[id=constantId]" );
 		target.children().remove();
 		
-		jQuery.postJSON( '../dhis-web-commons-ajax-json/getConstants.action', {},
+		jQuery.get( '../api/constants.json?paging=false&links=false', {},
 			function( json ) {
 				jQuery.each( json.constants, function(i, item) {
-					target.append( '<option value="[C'+item.constantId+']">' + item.constantName + '</option>' );
+					target.append( '<option value="C{'+item.id+'}">' + item.name + '</option>' );
 				});
 			});
 	}

=== modified file 'dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expressionBuilder.js'
--- dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expressionBuilder.js	2012-07-26 11:14:41 +0000
+++ dhis-2/dhis-web/dhis-web-validationrule/src/main/webapp/dhis-web-validationrule/javascript/expressionBuilder.js	2013-04-21 20:06:01 +0000
@@ -50,7 +50,7 @@
 	var target = jQuery( "#expression-container select[id=constantId]" );
 	target.children().remove();
 	
-	jQuery.postJSON( '../dhis-web-commons-ajax-json/getConstants.action', {}, function( json ) 
+	jQuery.get( '../api/constants.json?paging=false&links=false', {}, function( json ) 
 	{
 		if ( json.constants.length == 0 )
 		{
@@ -59,7 +59,7 @@
 		}
 		
 		jQuery.each( json.constants, function(i, item) {
-			target.append( '<option value="[C'+item.constantId+']">'+item.constantName+'</option>' );
+			target.append( '<option value="C{' + item.id + '}">' + item.name + '</option>' );
 		});
 	});
 }