Fix for a regression introduced by [r3394] while fixing #1000: handling of OPT_ATT_MUSTCHANGE. The fix was not working when the original value contained several lines.

SVN:trunk[3436]
This commit is contained in:
Denis Flaven
2014-11-28 17:03:13 +00:00
parent c8a20d01da
commit 87ed5d4a05

View File

@@ -1854,7 +1854,7 @@ abstract class cmdbAbstractObject extends CMDBObject implements iDisplay
{
$sNullValue = "'$sNullValue'"; // Add quotes to turn this into a JS string if it's not a number
}
$sOriginalValue = ($iFlags & OPT_ATT_MUSTCHANGE) ? "'".addslashes($value)."'" : 'undefined';
$sOriginalValue = ($iFlags & OPT_ATT_MUSTCHANGE) ? json_encode($value) : 'undefined';
$oPage->add_ready_script("$('#$iId').bind('".implode(' ', $aEventsList)."', function(evt, sFormId) { return ValidateField('$iId', '$sPattern', $bMandatory, sFormId, $sNullValue, $sOriginalValue) } );\n"); // Bind to a custom event: validate
}
$aDependencies = MetaModel::GetDependentAttributes($sClass, $sAttCode); // List of attributes that depend on the current one