diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index cca54e865ad..8c928751d46 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -6751,12 +6751,6 @@ if ($action == 'create') { } } - // Clone - if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $usercancreate) { - unset($params['attr']['title']); - print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=clone&object=invoice&token='.newToken(), '', true, $params); - } - // Clone as predefined / Create template if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $object->status == 0 && $usercancreate) { if (!$objectidnext && count($object->lines) > 0) { @@ -6765,6 +6759,12 @@ if ($action == 'create') { } } + // Clone + if (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_DEPOSIT || $object->type == Facture::TYPE_PROFORMA) && $usercancreate) { + unset($params['attr']['title']); + print dolGetButtonAction($langs->trans('ToClone'), '', 'clone', $_SERVER['PHP_SELF'].'?facid='.$object->id.'&action=clone&object=invoice&token='.newToken(), '', true, $params); + } + // Remove situation from cycle if (in_array($object->status, array(Facture::STATUS_CLOSED, Facture::STATUS_VALIDATED)) && $object->isSituationInvoice() diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8517ff8fad3..12c6aa82cf9 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -14072,7 +14072,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * * @param string $label Label or tooltip of button if $text is provided. Also used as tooltip in title attribute. Can be escaped HTML content or full simple text. * @param string $text Optional : short label on button. Can be escaped HTML content or full simple text. - * @param string $actionType 'default', 'danger', 'email', 'clone', 'cancel', 'delete', ... + * @param string $actionType 'default', 'edit', 'danger', 'email', 'clone', 'cancel', 'delete', ... * @param string|array}> $url Url for link or array of subbutton description * Example when an array is used: * $arrayforbutaction = array( @@ -14188,8 +14188,9 @@ function dolGetButtonAction($label, $text = '', $actionType = 'default', $url = $class = 'butAction'; if ($actionType == 'email') { $class = 'butAction butActionEmail'; - } - if ($actionType == 'danger' || $actionType == 'delete') { + } elseif ($actionType == 'clone') { + $class = 'butAction butActionClone'; + } elseif ($actionType == 'danger' || $actionType == 'delete') { $class = 'butActionDelete'; if (!empty($url) && strpos($url, 'token=') === false) { $url .= '&token=' . newToken();