Gere le cas d'unicite d'un entrepot pour l'utilisateur en cours

This commit is contained in:
Rodolphe Quiedeville 2006-12-04 11:39:18 +00:00
parent 1f3dd4ad1b
commit 760e97f483

View File

@ -1710,9 +1710,21 @@ else
// Ship // Ship
if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer if ($commande->statut > 0 && $commande->statut < 3 && $user->rights->expedition->creer
&& $commande->getNbOfProductsLines() > 0) && $commande->getNbOfProductsLines() > 0)
{
// Chargement des permissions
$error = $user->load_entrepots();
if (sizeof($user->entrepots) === 1)
{
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/fiche.php?id='.$_GET['id'].'&amp;action=create&amp;commande_id='.$_GET["id"].'&entrepot_id='.$user->entrepots[0]['id'].'">';
print $langs->trans('ShipProduct').'</a>';
}
else
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/commande.php?id='.$_GET['id'].'">'.$langs->trans('ShipProduct').'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/commande.php?id='.$_GET['id'].'">'.$langs->trans('ShipProduct').'</a>';
} }
}
if ($commande->statut == 1 || $commande->statut == 2) if ($commande->statut == 1 || $commande->statut == 2)
{ {