diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 8e59e688e2c..61a603f48bd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10411,6 +10411,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st * 'cancel-btn-label' => '', // Overide label of cancel button, if empty default label use "CloseDialog" lang key * 'content' => '', // Overide text of content, if empty default content use "ConfirmBtnCommonContent" lang key * 'modal' => true, // true|false to display dialog as a modal (with dark background) + * 'isDropDrown' => false, // true|false to display dialog as a dropdown (with dark background) * ], * ] * // phpcs:enable @@ -10420,12 +10421,16 @@ function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = { global $hookmanager, $action, $object, $langs; - $class = 'butAction'; - if ($actionType == 'danger' || $actionType == 'delete') { - $class = 'butActionDelete'; - if (!empty($url) && strpos($url, 'token=') === false) $url .= '&token='.newToken(); + //var_dump($params); + if ($params['isDropdown']) + $class = "dropdown-item"; + else { + $class = 'butAction'; + if ($actionType == 'danger' || $actionType == 'delete') { + $class = 'butActionDelete'; + if (!empty($url) && strpos($url, 'token=') === false) $url .= '&token='.newToken(); + } } - $attr = array( 'class' => $class, 'href' => empty($url) ? '' : $url, diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index c246b73e816..081057f5f06 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1331,50 +1331,56 @@ if ($action == 'create' && $user->rights->projet->creer) { } } - // Add button to create objects from project + if (!empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) { + print'