mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Support "recusrive placeholders" (i.e. $this->org_id->code$) inside notifications... when using the HTML notation (i.e. -> becomes ->)
SVN:trunk[4100]
This commit is contained in:
@@ -2426,10 +2426,10 @@ abstract class DBObject implements iDisplay
|
||||
public function GetForTemplate($sPlaceholderAttCode)
|
||||
{
|
||||
$ret = null;
|
||||
if (($iPos = strpos($sPlaceholderAttCode, '->')) !== false)
|
||||
if (preg_match('/^([^-]+)-(>|>)(.+)$/', $sPlaceholderAttCode, $aMatches)) // Support both syntaxes: this->xxx or this->xxx for HTML compatibility
|
||||
{
|
||||
$sExtKeyAttCode = substr($sPlaceholderAttCode, 0, $iPos);
|
||||
$sRemoteAttCode = substr($sPlaceholderAttCode, $iPos + 2);
|
||||
$sExtKeyAttCode = $aMatches[1];
|
||||
$sRemoteAttCode = $aMatches[3];
|
||||
if (!MetaModel::IsValidAttCode(get_class($this), $sExtKeyAttCode))
|
||||
{
|
||||
throw new CoreException("Unknown attribute '$sExtKeyAttCode' for the class ".get_class($this));
|
||||
|
||||
Reference in New Issue
Block a user