mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 22:39:03 +02:00
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:
@@ -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())
|
||||
{
|
||||
|
||||
@@ -4,8 +4,14 @@
|
||||
|
||||
{# This layout is exactly the same as the mode_create.html.twig, we duplicated it in case we need to have some subtle differences #}
|
||||
|
||||
|
||||
{% block pFormButtons %}
|
||||
{% if form.buttons is defined and form.buttons.links is defined %}
|
||||
<div class="form_btn_transitions">
|
||||
{% for aLink in form.buttons.links %}
|
||||
<a class="btn btn-default" href="{{ aLink.url }}">{{ aLink.label }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if tIsModal is defined and tIsModal == true %}
|
||||
<div class="form_btn_regular">
|
||||
<input class="btn btn-primary form_btn_cancel" type="button" value="{{ 'Portal:Button:Close'|dict_s }}" data-dismiss="modal">
|
||||
|
||||
Reference in New Issue
Block a user