Gestion de l'unicite d'un entrepot personnel
This commit is contained in:
parent
291ebde9d7
commit
609dfab978
@ -48,7 +48,6 @@ $user->getrights('expedition');
|
|||||||
if (!$user->rights->commande->lire)
|
if (!$user->rights->commande->lire)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|
||||||
|
|
||||||
// Sécurité accés client
|
// Sécurité accés client
|
||||||
if ($user->societe_id > 0)
|
if ($user->societe_id > 0)
|
||||||
{
|
{
|
||||||
@ -56,6 +55,8 @@ if ($user->societe_id > 0)
|
|||||||
$socid = $user->societe_id;
|
$socid = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Chargement des permissions
|
||||||
|
$error = $user->load_entrepots();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
@ -67,10 +68,8 @@ if ($_POST["action"] == 'confirm_cloture' && $_POST["confirm"] == 'yes')
|
|||||||
$result = $commande->cloture($user);
|
$result = $commande->cloture($user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$html = new Form($db);
|
$html = new Form($db);
|
||||||
|
|
||||||
|
|
||||||
/* *************************************************************************** */
|
/* *************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
/* Mode vue et edition */
|
/* Mode vue et edition */
|
||||||
@ -79,7 +78,6 @@ $html = new Form($db);
|
|||||||
|
|
||||||
llxHeader('',$langs->trans("OrderCard"));
|
llxHeader('',$langs->trans("OrderCard"));
|
||||||
|
|
||||||
|
|
||||||
if ($_GET["id"] > 0)
|
if ($_GET["id"] > 0)
|
||||||
{
|
{
|
||||||
$commande = New Commande($db);
|
$commande = New Commande($db);
|
||||||
@ -412,8 +410,6 @@ if ($_GET["id"] > 0)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<table width="100%"><tr><td width="50%" valign="top">';
|
print '<table width="100%"><tr><td width="50%" valign="top">';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -448,10 +444,23 @@ if ($_GET["id"] > 0)
|
|||||||
$entrepot = new Entrepot($db);
|
$entrepot = new Entrepot($db);
|
||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td>'.$langs->trans("Warehouse").'</td>';
|
print '<td>'.$langs->trans("Warehouse").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|
||||||
|
if (sizeof($user->entrepots) === 1)
|
||||||
|
{
|
||||||
|
$uentrepot = array();
|
||||||
|
$uentrepot[$user->entrepots[0]['id']] = $user->entrepots[0]['label'];
|
||||||
|
$html->select_array("entrepot_id",$uentrepot);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$html->select_array("entrepot_id",$entrepot->list_array());
|
$html->select_array("entrepot_id",$entrepot->list_array());
|
||||||
|
}
|
||||||
|
|
||||||
if (sizeof($entrepot->list_array()) <= 0)
|
if (sizeof($entrepot->list_array()) <= 0)
|
||||||
{
|
{
|
||||||
print ' Aucun entrepôt définit, <a href="'.DOL_URL_ROOT.'/product/stock/fiche.php?action=create">definissez en un</a>';
|
print ' Aucun entrepôt définit, <a href="'.DOL_URL_ROOT.'/product/stock/fiche.php?action=create">definissez en un</a>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user