I included the boolean in the $params and resolved the margin issue.

This commit is contained in:
Quatadah Nasdami 2022-07-25 20:13:54 +02:00
parent 0da4360b9f
commit 873745a178
2 changed files with 15 additions and 15 deletions

View File

@ -10343,7 +10343,6 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
* @param string $actionType default, delete, danger
* @param string $url the url for link
* @param string $id attribute id of button
* @param bboolean $isDropdown is dropdown button
* @param int $userRight user action right
* // phpcs:disable
* @param array $params = [ // Various params for future : recommended rather than adding more function arguments
@ -10359,17 +10358,18 @@ 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
* @return string html button
*/
function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = '', $id = '', $isDropdown = false, $userRight = 1, $params = array())
function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array())
{
global $hookmanager, $action, $object, $langs;
//var_dump($isDropdown);
if ($isDropdown)
//var_dump($params);
if ($params['isDropdown'])
$class = "dropdown-item";
else {
$class = 'butAction';

View File

@ -1319,48 +1319,48 @@ if ($action == 'create' && $user->rights->projet->creer) {
if (!empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) {
print'<div class="dropdown inline-block">';
print'<a class="dropdown-toggle butAction" data-toggle="dropdown">'.$langs->trans("Create").'</a>';
print'<a style="margin-right: auto;"class="dropdown-toggle butAction" data-toggle="dropdown">'.$langs->trans("Create").'</a>';
print '<div class="dropdown-menu">';
print '<div class="dropdown-global-search-button-list" >';
if (!empty($conf->propal->enabled) && $user->rights->propal->creer) {
$langs->load("propal");
print dolGetButtonAction('', $langs->trans('AddProp'), 'default', DOL_URL_ROOT.'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('AddProp'), 'default', DOL_URL_ROOT.'/comm/propal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (!empty($conf->commande->enabled) && $user->rights->commande->creer) {
$langs->load("orders");
print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (isModEnabled('facture') && $user->rights->facture->creer) {
$langs->load("bills");
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) {
$langs->load("supplier_proposal");
print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (!empty($conf->supplier_order->enabled) && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) {
$langs->load("suppliers");
print dolGetButtonAction('', $langs->trans('AddSupplierOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('AddSupplierOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (!empty($conf->supplier_invoice->enabled) && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
$langs->load("suppliers");
print dolGetButtonAction('', $langs->trans('AddSupplierInvoice'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('AddSupplierInvoice'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) {
$langs->load("interventions");
print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (!empty($conf->contrat->enabled) && $user->rights->contrat->creer) {
$langs->load("contracts");
print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) {
$langs->load("trips");
print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
if (!empty($conf->don->enabled) && $user->rights->don->creer) {
$langs->load("donations");
print dolGetButtonAction('', $langs->trans('AddDonation'), 'default', DOL_URL_ROOT.'/don/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', true);
print dolGetButtonAction('', $langs->trans('AddDonation'), 'default', DOL_URL_ROOT.'/don/card.php?action=create&amp;projectid='.$object->id.'&amp;socid='.$object->socid, '', 1, array('isDropDown' => true));
}
print "</div>";
print "</div>";