:mod livraison rename user acces right #14697

This commit is contained in:
Aurélien 2020-10-06 16:10:48 +02:00
parent c8cd55e158
commit f954e8b173
No known key found for this signature in database
GPG Key ID: 296611B615F8FDF3
10 changed files with 25 additions and 25 deletions

View File

@ -2555,7 +2555,7 @@ if ($action == 'create' && $usercancreate)
$numshipping = $object->nb_expedition();
if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) {
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->livraison->creer)) {
if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) {
if ($user->rights->expedition->creer) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id.'">'.$langs->trans('CreateShipment').'</a>';
} else {

View File

@ -417,7 +417,7 @@ class FormFile
$titletoshow = $langs->trans("Documents");
if (!empty($title)) $titletoshow = ($title == 'none' ? '' : $title);
print($modulepart);
// Show table
if ($genallowed)
{

View File

@ -59,7 +59,7 @@ function commande_prepare_head(Commande $object)
}
if (($conf->expedition_bon->enabled && $user->rights->expedition->lire)
|| ($conf->delivery_note->enabled && $user->rights->expedition->livraison->lire))
|| ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire))
{
$nbShipments = $object->getNbOfShipments(); $nbReceiption = 0;
$head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id;

View File

@ -43,7 +43,7 @@ function propal_prepare_head($object)
$h++;
if ((empty($conf->commande->enabled) && ((!empty($conf->expedition->enabled) && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire)
|| (!empty($conf->expedition->enabled) && !empty($conf->delivery_note->enabled) && $user->rights->expedition->livraison->lire))))
|| (!empty($conf->expedition->enabled) && !empty($conf->delivery_note->enabled) && $user->rights->expedition->delivery->lire))))
{
$langs->load("sendings");
$text = '';

View File

@ -47,7 +47,7 @@ function shipping_prepare_head($object)
$head[$h][2] = 'shipping';
$h++;
if ($conf->delivery_note->enabled && $user->rights->expedition->livraison->lire)
if ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire)
{
// delivery link
$object->fetchObjectLinked($object->id, $object->element);

View File

@ -191,7 +191,7 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Read delivery receipts';
$this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'livraison';
$this->rights[$r][4] = 'delivery';
$this->rights[$r][5] = 'lire';
$r++;
@ -199,7 +199,7 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Create/modify delivery receipts';
$this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'livraison';
$this->rights[$r][4] = 'delivery';
$this->rights[$r][5] = 'creer';
$r++;
@ -207,7 +207,7 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Validate delivery receipts';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'livraison_advance';
$this->rights[$r][4] = 'delivery_advance';
$this->rights[$r][5] = 'validate';
$r++;
@ -215,7 +215,7 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Delete delivery receipts';
$this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0;
$this->rights[$r][4] = 'livraison';
$this->rights[$r][4] = 'delivery';
$this->rights[$r][5] = 'supprimer';

View File

@ -141,7 +141,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element]
if ($object->element == 'order_supplier') $permok = $user->rights->fournisseur->commande->creer;
if ($object->element == 'invoice_supplier') $permok = $user->rights->fournisseur->facture->creer;
if ($object->element == 'shipping') $permok = $user->rights->expedition->creer;
if ($object->element == 'delivery') $permok = $user->rights->expedition->livraison->creer;
if ($object->element == 'delivery') $permok = $user->rights->expedition->delivery->creer;
if ($object->element == 'productlot') $permok = $user->rights->stock->creer;
if ($object->element == 'facturerec') $permok = $user->rights->facture->creer;
if ($object->element == 'mo') $permok = $user->rights->mrp->write;

View File

@ -126,8 +126,8 @@ if ($action == 'add')
$action = 'create';
}
} elseif ($action == 'confirm_valid' && $confirm == 'yes' &&
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate)))
((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate)))
)
{
$result = $object->valid($user);
@ -151,7 +151,7 @@ if ($action == 'add')
}
}
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->livraison->supprimer)
if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->delivery->supprimer)
{
$db->begin();
$result = $object->delete();
@ -167,7 +167,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio
}
}
if ($action == 'setdate_livraison' && $user->rights->expedition->livraison->creer)
if ($action == 'setdate_livraison' && $user->rights->expedition->delivery->creer)
{
$datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$result = $object->set_delivery_date($user, $datedelivery);
@ -458,7 +458,7 @@ if ($action == 'create') // Create. Seems to no be used
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel');
print '<td><td class="right">';
if ($user->rights->expedition->livraison->creer) print '<a class="editfielda" href="'.DOL_URL_ROOT.'/delivery/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
if ($user->rights->expedition->delivery->creer) print '<a class="editfielda" href="'.DOL_URL_ROOT.'/delivery/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
else print '&nbsp;';
print '</td></tr></table>';
print '</td>';
@ -647,14 +647,14 @@ if ($action == 'create') // Create. Seems to no be used
if ($object->statut == 0 && $num_prod > 0)
{
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate)))
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate)))
{
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=valid">'.$langs->trans("Validate").'</a>';
}
}
if ($user->rights->expedition->livraison->supprimer)
if ($user->rights->expedition->delivery->supprimer)
{
if ($conf->expedition_bon->enabled)
{
@ -678,8 +678,8 @@ if ($action == 'create') // Create. Seems to no be used
$filedir = $conf->expedition->dir_output."/receipt/".$objectref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = $user->rights->expedition->livraison->lire;
$delallowed = $user->rights->expedition->livraison->creer;
$genallowed = $user->rights->expedition->delivery->lire;
$delallowed = $user->rights->expedition->delivery->creer;
print $formfile->showdocuments('delivery', $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang);

View File

@ -373,8 +373,8 @@ class Delivery extends CommonObject
$error = 0;
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate)))
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer))
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate)))
{
if (!empty($conf->global->DELIVERY_ADDON_NUMBER))
{

View File

@ -102,7 +102,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('expeditioncard', 'globalcard'));
$permissiondellink = $user->rights->expedition->livraison->creer; // Used by the include of actions_dellink.inc.php
$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php
//var_dump($object->lines[0]->detail_batch);
@ -399,7 +399,7 @@ if (empty($reshook))
/*
* Build a receiving receipt
*/
elseif ($action == 'create_delivery' && $conf->delivery_note->enabled && $user->rights->expedition->livraison->creer)
elseif ($action == 'create_delivery' && $conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)
{
$result = $object->create_delivery($user);
if ($result > 0)
@ -2467,7 +2467,7 @@ if ($action == 'create')
// This is just to generate a delivery receipt
//var_dump($object->linkedObjectsIds['delivery']);
if ($conf->delivery_note->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery']))
if ($conf->delivery_note->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->delivery->creer && empty($object->linkedObjectsIds['delivery']))
{
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
}