From 1b90446cc5d4c3d1150a754b3c75d37fc04da204 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 29 Aug 2022 18:22:10 +0200 Subject: [PATCH] Update note.php --- htdocs/societe/note.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index b932fb11595..dabc5d7e39e 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -26,20 +26,28 @@ * \ingroup societe */ + +// Load Dolibarr environment require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; -$action = GETPOST('action', 'aZ09'); +// Load translation files required by the page $langs->load("companies"); -$id = GETPOST('id') ?GETPOST('id', 'int') : GETPOST('socid', 'int'); +// Get parameters +$id = GETPOST('id') ?GETPOST('id', 'int') : GETPOST('socid', 'int'); +$action = GETPOST('action', 'aZ09'); + + +// Initialize objects $object = new Societe($db); if ($id > 0) { $object->fetch($id); } +// Permissions $permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context @@ -50,6 +58,7 @@ if ($user->socid > 0) { unset($action); $socid = $user->socid; } + $result = restrictedArea($user, 'societe', $object->id, '&societe');