diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index c52c72ff509..b4b82be7726 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -1736,72 +1736,80 @@ else if ($id || $ref)
{
print '
';
- if ($object->statut == 0 && $num_prod > 0)
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
+ // modified by hook
+ if (empty($reshook))
{
- if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
- || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
- {
- print '
id.'&action=valid">'.$langs->trans("Validate").'';
- }
- else
- {
- print '
'.$langs->trans("Validate").'';
- }
- }
- // TODO add alternative status
- // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
- if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
- {
- print '
id.'&action=reopen">'.$langs->trans("ReOpen").'';
+ if ($object->statut == 0 && $num_prod > 0)
+ {
+ if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->creer))
+ || (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! empty($user->rights->expedition->shipping_advance->validate)))
+ {
+ print '
id.'&action=valid">'.$langs->trans("Validate").'';
+ }
+ else
+ {
+ print '
'.$langs->trans("Validate").'';
+ }
+ }
+
+ // TODO add alternative status
+ // 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
+ if ($object->statut == 2 && $object->billed && $user->rights->expedition->creer)
+ {
+ print '
id.'&action=reopen">'.$langs->trans("ReOpen").'';
+ }
+
+ // Send
+ if ($object->statut > 0)
+ {
+ if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send)
+ {
+ print '
id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'';
+ }
+ else print '
'.$langs->trans('SendByMail').'';
+ }
+
+ // Create bill and Close shipment
+ if (! empty($conf->facture->enabled) && $object->statut > 0)
+ {
+ if ($user->rights->facture->creer)
+ {
+ print '
'.$langs->trans("CreateBill").'';
+ }
+ }
+
+ // This is just to generate a delivery receipt
+ //var_dump($object->linkedObjectsIds['delivery']);
+ if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
+ {
+ print '
id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'';
+ }
+ // Close
+ if (! empty($conf->facture->enabled) && $object->statut > 0)
+ {
+ if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
+ {
+ $label="Close"; $paramaction='classifyclosed'; // = Transferred/Received
+ // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
+ if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // TODO Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close.
+ {
+ $label="ClassifyBilled";
+ $paramaction='classifybilled';
+ }
+ print '
id.'&action='.$paramaction.'">'.$langs->trans($label).'';
+ }
+ }
+
+ if ($user->rights->expedition->supprimer)
+ {
+ print '
id.'&action=delete">'.$langs->trans("Delete").'';
+ }
+
}
- // Send
- if ($object->statut > 0)
- {
- if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send)
- {
- print '
id.'&action=presend&mode=init">'.$langs->trans('SendByMail').'';
- }
- else print '
'.$langs->trans('SendByMail').'';
- }
-
- // Create bill and Close shipment
- if (! empty($conf->facture->enabled) && $object->statut > 0)
- {
- if ($user->rights->facture->creer)
- {
- print '
'.$langs->trans("CreateBill").'';
- }
- }
-
- // This is just to generate a delivery receipt
- //var_dump($object->linkedObjectsIds['delivery']);
- if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0)
- {
- print '
id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'';
- }
- // Close
- if (! empty($conf->facture->enabled) && $object->statut > 0)
- {
- if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed)
- {
- $label="Close"; $paramaction='classifyclosed'; // = Transferred/Received
- // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders
- if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // TODO Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close.
- {
- $label="ClassifyBilled";
- $paramaction='classifybilled';
- }
- print '
id.'&action='.$paramaction.'">'.$langs->trans($label).'';
- }
- }
-
- if ($user->rights->expedition->supprimer)
- {
- print '
id.'&action=delete">'.$langs->trans("Delete").'';
- }
-
print '
';
}