mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°4346 - Restore HTML metadata (data-xxx) on lists in the backoffice
This commit is contained in:
@@ -77,9 +77,11 @@ try
|
||||
|
||||
switch ($operation) {
|
||||
case 'search_and_refresh':
|
||||
$oPage->SetContentType('application/json');
|
||||
$oPage = new JsonPage();
|
||||
// Feeds dataTables directly
|
||||
$oPage->SetOutputDataOnly(true);
|
||||
$aResult = AjaxRenderController::SearchAndRefresh($sFilter);
|
||||
$oPage->add(json_encode($aResult));
|
||||
$oPage->SetData($aResult);
|
||||
break;
|
||||
|
||||
case 'search':
|
||||
|
||||
@@ -14,6 +14,7 @@ use AttributeOneWayPassword;
|
||||
use BinaryExpression;
|
||||
use BulkExport;
|
||||
use BulkExportException;
|
||||
use cmdbAbstractObject;
|
||||
use CMDBObjectSet;
|
||||
use CMDBSource;
|
||||
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableSettings;
|
||||
@@ -77,8 +78,20 @@ class AjaxRenderController
|
||||
$aObj[$sAlias."/hyperlink"] = $aObject[$sAlias]->GetHyperlink();
|
||||
foreach ($aColumnsLoad[$sAlias] as $sAttCode) {
|
||||
$aObj[$sAlias."/".$sAttCode] = $aObject[$sAlias]->GetAsHTML($sAttCode);
|
||||
$oRawValue = $aObject[$sAlias]->Get($sAttCode);
|
||||
if (is_scalar($oRawValue)) {
|
||||
$bExcludeRawValue = false;
|
||||
// Only retrieve raw (stored) value for simple fields
|
||||
foreach (cmdbAbstractObject::GetAttDefClassesToExcludeFromMarkupMetadataRawValue() as $sAttDefClassToExclude)
|
||||
{
|
||||
$oAttDef = MetaModel::GetAttributeDef($sClass, $sAttCode);
|
||||
if (is_a($oAttDef, $sAttDefClassToExclude, true))
|
||||
{
|
||||
$bExcludeRawValue = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$bExcludeRawValue) {
|
||||
$oRawValue = $aObject[$sAlias]->Get($sAttCode);
|
||||
$aObj[$sAlias."/".$sAttCode."/raw"] = $oRawValue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user