FIX deletion on draft is allowed if we are allwoed to create
This commit is contained in:
parent
0266db7aa8
commit
8fbf5b1f33
@ -115,7 +115,8 @@ $permissiontoedit = $user->rights->facture->creer; // Used by the include of act
|
|||||||
// Security check
|
// Security check
|
||||||
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
|
$fieldid = (! empty($ref) ? 'facnumber' : 'rowid');
|
||||||
if ($user->societe_id) $socid = $user->societe_id;
|
if ($user->societe_id) $socid = $user->societe_id;
|
||||||
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, null, (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0));
|
$isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
$result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, null, $isdraft);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -93,7 +93,8 @@ if ($id > 0 || ! empty($ref))
|
|||||||
// Security check
|
// Security check
|
||||||
$socid='';
|
$socid='';
|
||||||
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
if (! empty($user->societe_id)) $socid=$user->societe_id;
|
||||||
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', null, (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0));
|
$isdraft = (($object->statut == FactureFournisseur::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
$result = restrictedArea($user, 'fournisseur', $id, 'facture_fourn', 'facture', 'fk_soc', 'rowid', null, $isdraft);
|
||||||
|
|
||||||
$permissionnote=$user->rights->fournisseur->facture->creer; // Used by the include of actions_setnotes.inc.php
|
$permissionnote=$user->rights->fournisseur->facture->creer; // Used by the include of actions_setnotes.inc.php
|
||||||
$permissiondellink=$user->rights->fournisseur->facture->creer; // Used by the include of actions_dellink.inc.php
|
$permissiondellink=$user->rights->fournisseur->facture->creer; // Used by the include of actions_dellink.inc.php
|
||||||
|
|||||||
@ -93,14 +93,14 @@ foreach($object->fields as $key => $val)
|
|||||||
|
|
||||||
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
if (empty($action) && empty($id) && empty($ref)) $action='view';
|
||||||
|
|
||||||
// Security check - Protection if external user
|
|
||||||
//if ($user->societe_id > 0) access_forbidden();
|
|
||||||
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
|
||||||
//$result = restrictedArea($user, 'mymodule', $id);
|
|
||||||
|
|
||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once // Must be include, not include_once. Include fetch and fetch_thirdparty but not fetch_optionals
|
||||||
|
|
||||||
|
// Security check - Protection if external user
|
||||||
|
//if ($user->societe_id > 0) access_forbidden();
|
||||||
|
//if ($user->societe_id > 0) $socid = $user->societe_id;
|
||||||
|
//$isdraft = (($object->statut == MyObject::STATUS_DRAFT) ? 1 : 0);
|
||||||
|
//$result = restrictedArea($user, 'mymodule', $id, '', '', 'fk_soc', 'rowid', null, $isdraft);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user