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)

SVN:code[164]
This commit is contained in:
Romain Quetiez
2009-09-16 08:03:42 +00:00
parent 199a4865a4
commit 27965cc922
2 changed files with 7 additions and 4 deletions

View File

@@ -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);

View File

@@ -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':