Customer portal : Viewing an object now displays an edit button if the user is allowed to edit the viewed object.

SVN:trunk[4176]
This commit is contained in:
Guillaume Lajarige
2016-06-02 12:36:50 +00:00
parent 3edf777aa6
commit f86c4bb8fa
2 changed files with 16 additions and 1 deletions

View File

@@ -91,6 +91,15 @@ class ObjectController extends AbstractController
$aData['form'] = $this->HandleForm($oRequest, $oApp, $aData['sMode'], $sObjectClass, $sObjectId);
$aData['form']['title'] = Dict::Format('Brick:Portal:Object:Form:View:Title', MetaModel::GetName($sObjectClass), $oObject->GetName());
// Add an edit button if user is allowed
if (SecurityHelper::IsActionAllowed($oApp, UR_ACTION_MODIFY, $sObjectClass, $sObjectId))
{
$aData['form']['buttons']['links'][] = array(
'label' => Dict::S('UI:Menu:Modify'),
'url' => $oApp['url_generator']->generate('p_object_edit', array('sObjectClass' => $sObjectClass, 'sObjectId' => $sObjectId))
);
}
// Preparing response
if ($oRequest->isXmlHttpRequest())
{