N°3423 - Allow AttributeImage / AttributeDocument content to be cached by the browser (portal)

This commit is contained in:
Eric
2021-01-21 15:15:45 +01:00
parent 8f1d9fba57
commit 154156f4a1
8 changed files with 61 additions and 18 deletions

View File

@@ -373,8 +373,14 @@ class UserProfileBrickController extends BrickController
$aFormData['error'] = $e->GetMessage();
}
// TODO: This should be changed when refactoring the ormDocument GetDisplayUrl() and GetDownloadUrl() in iTop 3.0
$aFormData['picture_url'] = $oUrlGenerator->generate('p_object_document_display', array('sObjectClass' => get_class($oCurContact), 'sObjectId' => $oCurContact->GetKey(), 'sObjectField' => $sPictureAttCode, 'cache' => 86400, 't' => time()));
$oOrmDoc = $oCurContact->Get($sPictureAttCode);
$aFormData['picture_url'] = $oUrlGenerator->generate('p_object_document_display', [
'sObjectClass' => get_class($oCurContact),
'sObjectId' => $oCurContact->GetKey(),
'sObjectField' => $sPictureAttCode,
'cache' => 86400,
's' => $oOrmDoc->GetSignature(),
]);
$aFormData['validation'] = array(
'valid' => true,
'messages' => array(),