diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 163761c1f6f..5079f11ac2f 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -2460,9 +2460,9 @@ if ($action == 'create') {
if ($object->statut == Expedition::STATUS_DRAFT && $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").'';
+ print dolGetButtonAction('', $langs->trans('Validate'), 'default', $_SERVER["PHP_SELF"].'?action=valid&token='.newToken().'&id='.$object->id, '');
} else {
- print ''.$langs->trans("Validate").'';
+ print dolGetButtonAction($langs->trans('NotAllowed'), $langs->trans('Validate'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
}
}
@@ -2470,9 +2470,9 @@ if ($action == 'create') {
// 0=draft, 1=validated, 2=billed, we miss a status "delivered" (only available on order)
if ($object->statut == Expedition::STATUS_CLOSED && $user->rights->expedition->creer) {
if (!empty($conf->facture->enabled) && !empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ?
- print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("ClassifyUnbilled").'';
+ print dolGetButtonAction('', $langs->trans('ClassifyUnbilled'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
} else {
- print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("ReOpen").'';
+ print dolGetButtonAction('', $langs->trans('ReOpen'), 'default', $_SERVER["PHP_SELF"].'?action=reopen&token='.newToken().'&id='.$object->id, '');
}
}
@@ -2480,9 +2480,9 @@ if ($action == 'create') {
if (empty($user->socid)) {
if ($object->statut > 0) {
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send) {
- print 'id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'';
+ print dolGetButtonAction('', $langs->trans('SendMail'), 'default', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
} else {
- print ''.$langs->trans('SendMail').'';
+ print dolGetButtonAction('',$langs->trans('SendMail'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
}
}
}
@@ -2492,14 +2492,14 @@ if ($action == 'create') {
if ($user->rights->facture->creer) {
// TODO show button only if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))
// If we do that, we must also make this option official.
- print ''.$langs->trans("CreateBill").'';
+ print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->socid, '');
}
}
// This is just to generate a delivery receipt
//var_dump($object->linkedObjectsIds['delivery']);
if ($conf->delivery_note->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->delivery->creer && empty($object->linkedObjectsIds['delivery'])) {
- print 'id.'&action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'';
+ print dolGetButtonAction('', $langs->trans('CreateDeliveryOrder'), 'default', $_SERVER["PHP_SELF"].'?action=create_delivery&token='.newToken().'&id='.$object->id, '');
}
// Close
if ($object->statut == Expedition::STATUS_VALIDATED) {
@@ -2510,20 +2510,20 @@ if ($action == 'create') {
$label = "ClassifyBilled";
$paramaction = 'classifybilled';
}
- print 'id.'&action='.$paramaction.'&token='.newToken().'">'.$langs->trans($label).'';
+ print dolGetButtonAction('', $langs->trans($label), 'default', $_SERVER["PHP_SELF"].'?action='. $paramaction .'&token='.newToken().'&id='.$object->id, '');
}
}
// Cancel
if ($object->statut == Expedition::STATUS_VALIDATED) {
if ($user->rights->expedition->supprimer) {
- print 'id.'&action=cancel&token='.newToken().'">'.$langs->trans("Cancel").'';
+ print dolGetButtonAction('', $langs->trans('Cancel'), 'danger', $_SERVER["PHP_SELF"].'?action=cancel&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
}
}
// Delete
if ($user->rights->expedition->supprimer) {
- print 'id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete").'';
+ print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
}
}