diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 896291fddef..ea2f58299ef 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -150,10 +150,6 @@ function restrictedArea($user, $features, $objectid=0, $dbtablename='', $feature
{
if (! $user->rights->prelevement->bons->lire) $readok=0;
}
- else if ($feature == 'commande_fournisseur')
- {
- if (! $user->rights->fournisseur->commande->lire) $readok=0;
- }
else if ($feature == 'cheque')
{
if (! $user->rights->banque->cheque) $readok=0;
diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php
index 3d183a2392d..7840ae22042 100644
--- a/htdocs/fourn/commande/contact.php
+++ b/htdocs/fourn/commande/contact.php
@@ -40,7 +40,7 @@ $action = GETPOST('action', 'alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'commande_fournisseur', $id,'');
+$result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
$object = new CommandeFournisseur($db);
@@ -166,10 +166,10 @@ if ($id > 0 || ! empty($ref))
print '';
print '
';
-
+
// Contacts lines
include DOL_DOCUMENT_ROOT.'/core/tpl/contacts.tpl.php';
-
+
}
else
{
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 911e6b7fd90..1a41324479c 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -44,7 +44,7 @@ $langs->load('stocks');
// Security check
$id = isset($_GET["id"])?$_GET["id"]:'';
if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'commande_fournisseur', $id,'');
+$result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
if (empty($conf->stock->enabled))
{
@@ -84,7 +84,7 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
}
}
}
-
+
if (! $notrigger)
{
global $conf, $langs, $user;
@@ -94,7 +94,7 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
$result_trigger=$interface->run_triggers('ORDER_SUPPLIER_DISPATCH',$this,$user,$langs,$conf);
if ($result_trigger < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
-
+
$this->db->commit();
}
@@ -282,7 +282,7 @@ if ($id > 0 || ! empty($ref))
print ''.img_object($langs->trans("ShowProduct"),'product').' '.$objp->ref.'';
print ' - '.$objp->label;
// To show detail cref and description value, we must make calculation by cref
- //print ($objp->cref?' ('.$objp->cref.')':'');
+ //print ($objp->cref?' ('.$objp->cref.')':'');
//if ($objp->description) print '
'.nl2br($objp->description);
print '';
print '';
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index 394d234e47b..d1fdaeb113e 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -49,7 +49,7 @@ $confirm = GETPOST('confirm','alpha');
// Security check
if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'commande_fournisseur', $id,'');
+$result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
// Get parameters
$sortfield = GETPOST("sortfield",'alpha');
diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php
index 6a369873755..856c92c88bf 100644
--- a/htdocs/fourn/commande/fiche.php
+++ b/htdocs/fourn/commande/fiche.php
@@ -67,7 +67,7 @@ $hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($co
// Security check
if ($user->societe_id) $socid=$user->societe_id;
-$result = restrictedArea($user, 'commande_fournisseur', $id,'');
+$result = restrictedArea($user, 'fournisseur', $id, '', 'commande');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('ordersuppliercard'));
@@ -683,7 +683,7 @@ else if ($action == 'add' && $user->rights->fournisseur->commande->creer)
{
$error++;
}
-
+
if ($error)
{
$langs->load("errors");
@@ -840,7 +840,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
else
{
// Redirect here
- // This avoid sending mail twice if going out and then back to page
+ // This avoid sending mail twice if going out and then back to page
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
@@ -959,28 +959,28 @@ $now=dol_now();
if ($action=="create")
{
print_fiche_titre($langs->trans('NewOrder'));
-
+
dol_htmloutput_mesg($mesg);
-
+
$societe='';
if ($socid>0)
{
$societe=new Societe($db);
$societe->fetch($socid);
}
-
+
print '