NEW - Add user right order generete doc
This commit is contained in:
parent
4cd85f3029
commit
d8ae2361a9
@ -108,14 +108,15 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Load object
|
// Load object
|
||||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||||
|
|
||||||
$usercanread = $user->rights->commande->lire;
|
$usercanread = $user->hasRight('commande', 'lire');
|
||||||
$usercancreate = $user->rights->commande->creer;
|
$usercancreate = $user->hasRight('commande', 'creer');
|
||||||
$usercandelete = $user->rights->commande->supprimer;
|
$usercandelete = $user->hasRight('commande', 'supprimer');
|
||||||
// Advanced permissions
|
// Advanced permissions
|
||||||
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->close)));
|
$usercanclose = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->close)));
|
||||||
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->validate)));
|
$usercanvalidate = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->validate)));
|
||||||
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
|
$usercancancel = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $usercancreate) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->commande->order_advance->annuler)));
|
||||||
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
|
$usercansend = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send);
|
||||||
|
$usercangeneretedoc = (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->hasRight('commande', 'order_advance', 'generetedoc'));
|
||||||
|
|
||||||
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
$usercancreatepurchaseorder = ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer);
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ if (!empty($permissioncreate) && empty($permissiontoadd)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build doc
|
// Build doc
|
||||||
if ($action == 'builddoc' && $permissiontoadd) {
|
if ($action == 'builddoc' && ($permissiontoadd || !empty($usercangeneretedoc))) {
|
||||||
if (is_numeric(GETPOST('model', 'alpha'))) {
|
if (is_numeric(GETPOST('model', 'alpha'))) {
|
||||||
$error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Model"));
|
$error = $langs->trans("ErrorFieldRequired", $langs->transnoentities("Model"));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -139,9 +139,17 @@ class modCommande extends DolibarrModules
|
|||||||
$this->rights[$r][4] = 'order_advance';
|
$this->rights[$r][4] = 'order_advance';
|
||||||
$this->rights[$r][5] = 'validate';
|
$this->rights[$r][5] = 'validate';
|
||||||
|
|
||||||
|
$r++;
|
||||||
|
$this->rights[$r][0] = 85;
|
||||||
|
$this->rights[$r][1] = 'Generate the documents sales orders';
|
||||||
|
$this->rights[$r][2] = 'd';
|
||||||
|
$this->rights[$r][3] = 0;
|
||||||
|
$this->rights[$r][4] = 'order_advance';
|
||||||
|
$this->rights[$r][5] = 'generetedoc';
|
||||||
|
|
||||||
$r++;
|
$r++;
|
||||||
$this->rights[$r][0] = 86;
|
$this->rights[$r][0] = 86;
|
||||||
$this->rights[$r][1] = 'Send sale orders by email';
|
$this->rights[$r][1] = 'Send sales orders by email';
|
||||||
$this->rights[$r][2] = 'd';
|
$this->rights[$r][2] = 'd';
|
||||||
$this->rights[$r][3] = 0;
|
$this->rights[$r][3] = 0;
|
||||||
$this->rights[$r][4] = 'order_advance';
|
$this->rights[$r][4] = 'order_advance';
|
||||||
|
|||||||
@ -739,6 +739,7 @@ Permission79=Create/modify subscriptions
|
|||||||
Permission81=Read customers orders
|
Permission81=Read customers orders
|
||||||
Permission82=Create/modify customers orders
|
Permission82=Create/modify customers orders
|
||||||
Permission84=Validate customers orders
|
Permission84=Validate customers orders
|
||||||
|
Permission85=Generate the documents sales orders
|
||||||
Permission86=Send customers orders
|
Permission86=Send customers orders
|
||||||
Permission87=Close customers orders
|
Permission87=Close customers orders
|
||||||
Permission88=Cancel customers orders
|
Permission88=Cancel customers orders
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user