';
-
- // Validate
- if ($object->statut == 0 && $num > 0)
+ if ($user->societe_id == 0 && $action != 'edit_line' && $action != 'delete')
{
- if ($user->rights->fournisseur->commande->valider)
+ print '
';
+
+ // Validate
+ if ($object->statut == 0 && $num > 0)
{
- print '
id.'&action=valid"';
- print '>'.$langs->trans('Validate').'';
+ if ($user->rights->fournisseur->commande->valider)
+ {
+ print '
id.'&action=valid"';
+ print '>'.$langs->trans('Validate').'';
+ }
}
- }
-
- // Modify
- if ($object->statut == 1)
- {
- if ($user->rights->fournisseur->commande->commander)
+
+ // Modify
+ if ($object->statut == 1)
{
- print '
id.'&action=reopen">'.$langs->trans("Modify").'';
+ if ($user->rights->fournisseur->commande->commander)
+ {
+ print '
id.'&action=reopen">'.$langs->trans("Modify").'';
+ }
}
- }
-
- // Approve
- if ($object->statut == 1)
- {
- if ($user->rights->fournisseur->commande->approuver)
+
+ // Approve
+ if ($object->statut == 1)
{
- print '
id.'&action=approve">'.$langs->trans("ApproveOrder").'';
- print '
id.'&action=refuse">'.$langs->trans("RefuseOrder").'';
+ if ($user->rights->fournisseur->commande->approuver)
+ {
+ print '
id.'&action=approve">'.$langs->trans("ApproveOrder").'';
+ print '
id.'&action=refuse">'.$langs->trans("RefuseOrder").'';
+ }
+ else
+ {
+ print '
'.$langs->trans("ApproveOrder").'';
+ print '
'.$langs->trans("RefuseOrder").'';
+ }
}
- else
+
+ // Send
+ if (in_array($object->statut, array(2, 3, 4, 5)))
{
- print '
'.$langs->trans("ApproveOrder").'';
- print '
'.$langs->trans("RefuseOrder").'';
+ if ($user->rights->fournisseur->commande->commander)
+ {
+ print '
id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'';
+ }
}
- }
-
- // Send
- if (in_array($object->statut, array(2, 3, 4, 5)))
- {
- if ($user->rights->fournisseur->commande->commander)
+
+ // Reopen
+ if (in_array($object->statut, array(2, 5, 6, 7, 9)))
{
- print '
id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'';
+ if ($user->rights->fournisseur->commande->commander)
+ {
+ print '
id.'&action=reopen">'.$langs->trans("ReOpen").'';
+ }
}
- }
-
- // Reopen
- if (in_array($object->statut, array(2, 5, 6, 7, 9)))
- {
- if ($user->rights->fournisseur->commande->commander)
+
+ // Create bill
+ if (! empty($conf->fournisseur->enabled) && $object->statut >= 2) // 2 means accepted
{
- print '
id.'&action=reopen">'.$langs->trans("ReOpen").'';
+ if ($user->rights->fournisseur->facture->creer)
+ {
+ print '
'.$langs->trans("CreateBill").'';
+ }
+
+ //if ($user->rights->fournisseur->commande->creer && $object->statut > 2)
+ //{
+ // print '
id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'';
+ //}
}
- }
-
- // Create bill
- if (! empty($conf->fournisseur->enabled) && $object->statut >= 2) // 2 means accepted
- {
- if ($user->rights->fournisseur->facture->creer)
+
+ // Cancel
+ if ($object->statut == 2)
{
- print '
'.$langs->trans("CreateBill").'';
+ if ($user->rights->fournisseur->commande->commander)
+ {
+ print '
id.'&action=cancel">'.$langs->trans("CancelOrder").'';
+ }
}
-
- //if ($user->rights->fournisseur->commande->creer && $object->statut > 2)
- //{
- // print '
id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").'';
- //}
- }
-
- // Cancel
- if ($object->statut == 2)
- {
- if ($user->rights->fournisseur->commande->commander)
+
+ // Clone
+ if ($user->rights->fournisseur->commande->creer)
{
- print '
id.'&action=cancel">'.$langs->trans("CancelOrder").'';
+ print '
'.$langs->trans("ToClone").'';
}
+
+ // Delete
+ if ($user->rights->fournisseur->commande->supprimer)
+ {
+ print '
id.'&action=delete">'.$langs->trans("Delete").'';
+ }
+
+ print "
";
}
-
- // Clone
- if ($user->rights->fournisseur->commande->creer)
- {
- print '
';
- }
-
- // Delete
- if ($user->rights->fournisseur->commande->supprimer)
- {
- print '