mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
N°1788 Portal: Fix regression, icons not displayed in service catalog (introduced in ab1715ed)
This commit is contained in:
@@ -24,6 +24,7 @@ use Symfony\Component\HttpFoundation\Request;
|
|||||||
use UserRights;
|
use UserRights;
|
||||||
use Dict;
|
use Dict;
|
||||||
use MetaModel;
|
use MetaModel;
|
||||||
|
use AttributeImage;
|
||||||
use DBSearch;
|
use DBSearch;
|
||||||
use DBObjectSet;
|
use DBObjectSet;
|
||||||
use BinaryExpression;
|
use BinaryExpression;
|
||||||
@@ -633,18 +634,30 @@ class BrowseBrickController extends BrickController
|
|||||||
$sPropertyName = substr($sOptionalAttribute, 0, -4);
|
$sPropertyName = substr($sOptionalAttribute, 0, -4);
|
||||||
$oAttDef = MetaModel::GetAttributeDef(get_class($value), $aLevelsProperties[$key][$sOptionalAttribute]);
|
$oAttDef = MetaModel::GetAttributeDef(get_class($value), $aLevelsProperties[$key][$sOptionalAttribute]);
|
||||||
|
|
||||||
$tmpAttValue = $value->GetAsHTML($aLevelsProperties[$key][$sOptionalAttribute]);
|
if($oAttDef instanceof AttributeImage)
|
||||||
if($sOptionalAttribute === 'image_att')
|
{
|
||||||
{
|
$tmpAttValue = $value->Get($aLevelsProperties[$key][$sOptionalAttribute]);
|
||||||
if (is_object($tmpAttValue) && !$tmpAttValue->IsEmpty())
|
if ($sOptionalAttribute === 'image_att')
|
||||||
{
|
{
|
||||||
$tmpAttValue = $oApp['url_generator']->generate('p_object_document_display', array('sObjectClass' => get_class($value), 'sObjectId' => $value->GetKey(), 'sObjectField' => $aLevelsProperties[$key][$sOptionalAttribute], 'cache' => 86400));
|
if (is_object($tmpAttValue) && !$tmpAttValue->IsEmpty())
|
||||||
}
|
{
|
||||||
else
|
$tmpAttValue = $oApp['url_generator']->generate('p_object_document_display', array(
|
||||||
{
|
'sObjectClass' => get_class($value),
|
||||||
$tmpAttValue = $oAttDef->Get('default_image');
|
'sObjectId' => $value->GetKey(),
|
||||||
}
|
'sObjectField' => $aLevelsProperties[$key][$sOptionalAttribute],
|
||||||
}
|
'cache' => 86400
|
||||||
|
));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tmpAttValue = $oAttDef->Get('default_image');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tmpAttValue = $value->GetAsHTML($aLevelsProperties[$key][$sOptionalAttribute]);
|
||||||
|
}
|
||||||
|
|
||||||
$aRow[$key][$sPropertyName] = $tmpAttValue;
|
$aRow[$key][$sPropertyName] = $tmpAttValue;
|
||||||
}
|
}
|
||||||
@@ -726,17 +739,24 @@ class BrowseBrickController extends BrickController
|
|||||||
$sPropertyName = substr($sOptionalAttribute, 0, -4);
|
$sPropertyName = substr($sOptionalAttribute, 0, -4);
|
||||||
$oAttDef = MetaModel::GetAttributeDef(get_class($aCurrentRowValues[0]), $aLevelsProperties[$aCurrentRowKeys[0]][$sOptionalAttribute]);
|
$oAttDef = MetaModel::GetAttributeDef(get_class($aCurrentRowValues[0]), $aLevelsProperties[$aCurrentRowKeys[0]][$sOptionalAttribute]);
|
||||||
|
|
||||||
$tmpAttValue = $aCurrentRowValues[0]->GetAsHTML($aLevelsProperties[$aCurrentRowKeys[0]][$sOptionalAttribute]);
|
if($oAttDef instanceof AttributeImage)
|
||||||
if($sOptionalAttribute === 'image_att')
|
|
||||||
{
|
{
|
||||||
if (is_object($tmpAttValue) && !$tmpAttValue->IsEmpty())
|
$tmpAttValue = $aCurrentRowValues[0]->Get($aLevelsProperties[$aCurrentRowKeys[0]][$sOptionalAttribute]);
|
||||||
{
|
if($sOptionalAttribute === 'image_att')
|
||||||
$tmpAttValue = $oApp['url_generator']->generate('p_object_document_display', array('sObjectClass' => get_class($aCurrentRowValues[0]), 'sObjectId' => $aCurrentRowValues[0]->GetKey(), 'sObjectField' => $aLevelsProperties[$aCurrentRowKeys[0]][$sOptionalAttribute], 'cache' => 86400));
|
{
|
||||||
}
|
if (is_object($tmpAttValue) && !$tmpAttValue->IsEmpty())
|
||||||
else
|
{
|
||||||
{
|
$tmpAttValue = $oApp['url_generator']->generate('p_object_document_display', array('sObjectClass' => get_class($aCurrentRowValues[0]), 'sObjectId' => $aCurrentRowValues[0]->GetKey(), 'sObjectField' => $aLevelsProperties[$aCurrentRowKeys[0]][$sOptionalAttribute], 'cache' => 86400));
|
||||||
$tmpAttValue = $oAttDef->Get('default_image');
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
|
$tmpAttValue = $oAttDef->Get('default_image');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tmpAttValue = $aCurrentRowValues[0]->GetAsHTML($aLevelsProperties[$aCurrentRowKeys[0]][$sOptionalAttribute]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$aItems[$sCurrentIndex][$sPropertyName] = $tmpAttValue;
|
$aItems[$sCurrentIndex][$sPropertyName] = $tmpAttValue;
|
||||||
|
|||||||
Reference in New Issue
Block a user