瀏覽代碼

Fixed a regression on the management of the allowed values and attribute dependencies (symptom: Browse button not working, error when creating a ticket with no CI attached to it)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@164 a333f486-631f-4898-b8df-5754b55c2be0
romainq 15 年之前
父節點
當前提交
2bd17c4689
共有 2 個文件被更改,包括 7 次插入4 次删除
  1. 6 3
      js/wizardhelper.js
  2. 1 1
      pages/ajax.render.php

+ 6 - 3
js/wizardhelper.js

@@ -64,7 +64,8 @@ function WizardHelper(sClass)
 	
 	this.UpdateFields = function ()
 	{
-		//console.log('** UpdateFields **')
+		//console.log('** UpdateFields **');
+		//console.log(this.m_oData);
 		for(i=0; i< this.m_oData.m_aAllowedValuesRequested.length; i++)
 		{
 			sAttCode = this.m_oData.m_aAllowedValuesRequested[i];
@@ -79,6 +80,7 @@ function WizardHelper(sClass)
 			//console.log('Setting field:'+sFieldId+' ('+sAttCode+') to: '+defaultValue);
 			var oElement = document.getElementById('att_'+sFieldId);
 			oElement.value = defaultValue;
+			//console.log('att_'+sFieldId+', set to '+defaultValue);
 		}
 	}
 	
@@ -102,8 +104,9 @@ function WizardHelper(sClass)
 		//console.log('oWizard:', this);
 		$.get('ajax.render.php?json_obj=' + this.ToJSON(),
 		   { operation: 'wizard_helper' },
-			function(json_data){
-				//console.log('data received:', json_data);
+			function(html){
+				$('body').append(html);
+				console.log('data received:', oWizardHelper);
 				//oWizardHelper.FromJSON(json_data);
 				oWizardHelper.UpdateFields();
 				//console.log(oWizardHelper);

+ 1 - 1
pages/ajax.render.php

@@ -94,7 +94,7 @@ switch($operation)
 
 		$oWizardHelper->SetAllowedValuesHtml($sAttCode, $sHTMLValue);
 	}
-	$oPage->add("<script>oWizardHelper.FromJSON(".$oWizardHelper->ToJSON().")</script>\n");
+	$oPage->add("<script type=\"text/javascript\">\noWizardHelper.m_oData=".$oWizardHelper->ToJSON().";\n</script>\n");
 	break;
 		
 	case 'ajax':