N°1192 - Change default behavior for navigation rules

This commit is contained in:
Molkobain
2019-12-05 15:01:47 +01:00
parent 8911a9a3ed
commit c883d618c3
3 changed files with 42 additions and 9 deletions

View File

@@ -38,6 +38,7 @@ use FalseExpression;
use FieldExpression;
use FileUploadException;
use IssueLog;
use JSButtonItem;
use ListExpression;
use MetaModel;
use ScalarExpression;
@@ -45,7 +46,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
use URLButtonItem;
use UserRights;
use utils;
use VariableExpression;
@@ -129,13 +129,14 @@ class ObjectController extends BrickController
// Add an edit button if user is allowed
if ($oSecurityHelper->IsActionAllowed(UR_ACTION_MODIFY, $sObjectClass, $sObjectId))
{
$oModifyButton = new URLButtonItem(
$sModifyUrl = $oUrlGenerator->generate('p_object_edit', array('sObjectClass' => $sObjectClass, 'sObjectId' => $sObjectId));
$oModifyButton = new JSButtonItem(
'modify_object',
Dict::S('UI:Menu:Modify'),
$oUrlGenerator->generate('p_object_edit', array('sObjectClass' => $sObjectClass, 'sObjectId' => $sObjectId))
'CombodoPortalToolbox.OpenUrlInModal("'.$sModifyUrl.'");'
);
// Putting this one first
$aData['form']['buttons']['links'][] = $oModifyButton->GetMenuItem();
$aData['form']['buttons']['actions'][] = $oModifyButton->GetMenuItem() + array('js_files' => $oModifyButton->GetLinkedScripts());
}
// Preparing response