Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
Laurent Destailleur 2023-04-04 23:08:25 +02:00
parent 6c0d1e7a54
commit 79099bd090
6 changed files with 12 additions and 7 deletions

View File

@ -92,7 +92,7 @@ if ($id > 0 || !empty($ref)) {
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
restrictedArea($user, 'bom', $object->id, $object->table_element, '', '', 'rowid', $isdraft);
/*

View File

@ -84,7 +84,7 @@ if ($object->id > 0) {
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
$result = restrictedArea($user, 'bom', $object->id, $object->table_element, '', '', 'rowid', $isdraft);
// Permissions
$permissionnote = $user->hasRight('bom', 'write'); // Used by the include of actions_setnotes.inc.php

View File

@ -83,7 +83,7 @@ if ($id > 0 || !empty($ref)) {
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
restrictedArea($user, 'bom', $object->id, $object->table_element, '', '', 'rowid', $isdraft);
$permissiontoadd = $user->hasRight('bom', 'write'); // Used by the include of actions_addupdatedelete.inc.php and actions_linkedfiles.inc.php

View File

@ -81,7 +81,7 @@ if ($object->id > 0) {
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
$result = restrictedArea($user, 'bom', $object->id, $object->table_element, '', '', 'rowid', $isdraft);
// Permissions
$permissionnote = $user->hasRight('bom', 'write'); // Used by the include of actions_setnotes.inc.php

View File

@ -67,7 +67,7 @@ $permissionnote = $user->hasRight('bom', 'write'); // Used by the include of act
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
restrictedArea($user, 'bom', $object->id, $object->table_element, '', '', 'rowid', $isdraft);
/*

View File

@ -46,6 +46,13 @@ require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
$idbom = GETPOST('idbom', 'alpha');
//$action = GETPOST('action', 'aZ09');
$object = new BOM($db);
$result = $object->fetch($idbom);
// Security check
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
$result = restrictedArea($user, 'bom', $object, $object->table_element, '', '', 'rowid', $isdraft);
/*
* View
@ -53,8 +60,6 @@ $idbom = GETPOST('idbom', 'alpha');
top_httphead('application/json');
$object = new BOM($db);
$result = $object->fetch($idbom);
if ($result > 0) {
// We remove properties we don't need in answer
unset($object->fields);