Update note.php

This commit is contained in:
UT from dolibit 2022-08-29 18:22:10 +02:00 committed by GitHub
parent 49f869352c
commit 1b90446cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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');