mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
- Bug fix: support OQL for implementing History block stored inside a template.
SVN:code[46]
This commit is contained in:
@@ -547,17 +547,13 @@ class HistoryBlock extends DisplayBlock
|
||||
$aFilterCodes = array_keys(MetaModel::GetClassFilterDefs($this->m_oFilter->GetClass()));
|
||||
foreach($aFilterCodes as $sFilterCode)
|
||||
{
|
||||
$sExternalFilterValue = utils::ReadParam($sFilterCode, '');
|
||||
if (isset($aExtraParams[$sFilterCode]))
|
||||
{
|
||||
$this->m_oFilter->AddCondition($sFilterCode, $aExtraParams[$sFilterCode]); // Use the default 'loose' operator
|
||||
}
|
||||
else if ($sExternalFilterValue != "")
|
||||
{
|
||||
$this->m_oFilter->AddCondition($sFilterCode, $sExternalFilterValue); // Use the default 'loose' operator
|
||||
}
|
||||
}
|
||||
$oSet = new CMDBObjectSet($this->m_oFilter, array('date'=>false));
|
||||
$sHtml .= "<!-- filter: ".($this->m_oFilter->ToOQL())."-->\n";
|
||||
switch($this->m_sStyle)
|
||||
{
|
||||
case 'toggle':
|
||||
|
||||
@@ -149,7 +149,7 @@ class DisplayTemplate
|
||||
$oPage->EndCollapsibleSection();
|
||||
break;
|
||||
|
||||
case 'itopblock':
|
||||
case 'itopblock': // TO DO: Use DisplayBlock::FromTemplate here
|
||||
$sBlockClass = $aAttributes['blockclass'];
|
||||
$sBlockType = $aAttributes['type'];
|
||||
$aExtraParams = array();
|
||||
@@ -164,6 +164,10 @@ class DisplayTemplate
|
||||
$oFilter = CMDBSearchFilter::FromSibusQL($sContent);
|
||||
break;
|
||||
|
||||
case 'text/oql':
|
||||
$oFilter = CMDBSearchFilter::FromOQL($sContent);
|
||||
break;
|
||||
|
||||
case 'text/serialize':
|
||||
default:
|
||||
$oFilter = CMDBSearchFilter::unserialize($sContent);
|
||||
@@ -175,7 +179,7 @@ class DisplayTemplate
|
||||
break;
|
||||
|
||||
default:
|
||||
// Unknown tab, just ignore it or now -- output an HTML comment
|
||||
// Unknown tag, just ignore it or now -- output an HTML comment
|
||||
$oPage->add("<!-- unsupported tag: $sTag -->");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user