mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-22 18:18:46 +02:00
(Retrofit from trunk) N°1123.2 AttributeImage: default_image is no longer mandatory.
SVN:2.4[5041]
This commit is contained in:
@@ -5522,8 +5522,8 @@ class AttributeImage extends AttributeBlob
|
||||
{
|
||||
$iMaxWidthPx = $this->Get('display_max_width');
|
||||
$iMaxHeightPx = $this->Get('display_max_height');
|
||||
$sUrl = $this->GetOptional('default_image', '');
|
||||
$sRet = '<img src="'.$sUrl.'" style="max-width: '.$iMaxWidthPx.'px; max-height: '.$iMaxHeightPx.'px">';
|
||||
$sUrl = $this->Get('default_image');
|
||||
$sRet = ($sUrl !== null) ? '<img src="'.$sUrl.'" style="max-width: '.$iMaxWidthPx.'px; max-height: '.$iMaxHeightPx.'px">' : '';
|
||||
if (is_object($value) && !$value->IsEmpty())
|
||||
{
|
||||
if ($oHostObject->IsNew() || ($oHostObject->IsModified() && (array_key_exists($this->GetCode(), $oHostObject->ListChanges()))))
|
||||
|
||||
@@ -226,9 +226,9 @@ EOF
|
||||
$iNewWidth = $iWidth * $fScale;
|
||||
$iNewHeight = $iHeight * $fScale;
|
||||
|
||||
$sUrl = 'data:' . $value->GetMimeType() . ';base64,' . base64_encode($value->GetData());
|
||||
$sUrl = 'data:'.$value->GetMimeType().';base64,'.base64_encode($value->GetData());
|
||||
}
|
||||
$sRet = '<img src="' . $sUrl . '" style="width: ' . $iNewWidth . 'px; height: ' . $iNewHeight . 'px">';
|
||||
$sRet = ($sUrl !== null) ? '<img src="'.$sUrl.'" style="width: '.$iNewWidth.'px; height: '.$iNewHeight.'px">' : '';
|
||||
$sRet = '<div class="view-image">'.$sRet.'</div>';
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1252,6 +1252,10 @@ EOF
|
||||
{
|
||||
$aParameters['default_image'] = "utils::GetAbsoluteUrlModulesRoot().'$sModuleRelativeDir/$sDefault'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$aParameters['default_image'] = 'null';
|
||||
}
|
||||
}
|
||||
elseif ($sAttType == 'AttributeStopWatch')
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user