Debug v23

This commit is contained in:
Laurent Destailleur 2025-11-26 13:47:14 +01:00
parent f0f2afd7a3
commit 4b5c4f13ca
2 changed files with 10 additions and 9 deletions

View file

@ -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()

View file

@ -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<int,array{lang:string,enabled:bool,perm:bool|int,label:string,url:string,urlroot?:string,isDropDown?:int<0,1>}> $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();