Scarab commit: svn commit: r10800 - trunk/src: java/org/tigris/scarab/om webapp/scripts

Hussayn Dabbous <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2009-07-16 00:49:52-0700
New Revision: 10800

Modified:
   trunk/src/java/org/tigris/scarab/om/Condition.java
   trunk/src/webapp/scripts/sstree.js

Log:
SCB2984: 

-fixed: During generation of the ConditionCheckerScript i used AttributeOption.getName() instead of RModuleOption.getDisplayValue(), thus i always got the values of the global defined options and not the value from the module/issueType settings

Modified: trunk/src/java/org/tigris/scarab/om/Condition.java
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/java/org/tigris/scarab/om/Condition.java?view=diff&pathrev=10800&r1=10799&r2=10800
==============================================================================
--- trunk/src/java/org/tigris/scarab/om/Condition.java	(original)
+++ trunk/src/java/org/tigris/scarab/om/Condition.java	2009-07-16 00:49:52-0700
@@ -136,11 +136,16 @@
         String indents = ""; for(int i=0; i< indent; i++) indents +=" ";
         String result = "";
         try {
-            if (this.getAttributeOption() != null) {
+            AttributeOption ao = this.getAttributeOption();
+            if (ao != null) {
                 // Old-style condition (tied to any of the attribute-options
                 // being selected)
-                Attribute requiredAttribute = this.getAttributeOption().getAttribute();
+                Attribute requiredAttribute = ao.getAttribute();
+                Module module = rma.getModule();
+                IssueType issueType = rma.getIssueType();
                 Integer optionId = this.getOptionId();
+                RModuleOption rmo = module.getRModuleOption(ao, issueType);
+                
                 result = indents+"if(attributeName == \""
                        + requiredAttribute.getName()
                        + "\")"
@@ -148,7 +153,7 @@
                        + "(\""
                        + rma.getDisplayValue()
                        + "\","
-                       + "displayValue==\"" + this.getAttributeOption().getName()
+                       + "displayValue==\"" + rmo.getDisplayValue()
                        + "\");\n";
             } else 
             {

Modified: trunk/src/webapp/scripts/sstree.js
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/scripts/sstree.js?view=diff&pathrev=10800&r1=10799&r2=10800
==============================================================================
--- trunk/src/webapp/scripts/sstree.js	(original)
+++ trunk/src/webapp/scripts/sstree.js	2009-07-16 00:49:52-0700
@@ -75,7 +75,7 @@
 function renderJSONTreePopup(key, value, root, imgpath) {
 	document.writeln('<div id="' + key + ':Popup" class="tree_popup"><ol class="treeview root">');		
 	for (var i = 0; i < root._children.length; i++) {			
-		renderJSONTree(root.name, key, value, root._children[i], imgpath);						
+		renderJSONTree(root.name, key, value, root._children[i], imgpath);
 	}
 	document.writeln('</ol></div>');	
 }
@@ -83,7 +83,9 @@
 
 function renderJSONTree(attributeId, key, value, root, imgpath) {
 	if (root.optionId == value) {
-		document.getElementById(key + ':Display').value = root.displayValue;	
+		document.getElementById(key + ':Display').value = root.displayValue;
+		var data = ["treeview",attributeId, null, null, root.displayValue];
+		observer.fire(data);
 	}	
 	
 	if (root._children.length > 0) {

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=2371688
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.