mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-21 08:51:24 +01:00
almost done
This commit is contained in:
@@ -10343,6 +10343,7 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||||||
* @param string $actionType default, delete, danger
|
* @param string $actionType default, delete, danger
|
||||||
* @param string $url the url for link
|
* @param string $url the url for link
|
||||||
* @param string $id attribute id of button
|
* @param string $id attribute id of button
|
||||||
|
* @param bboolean $isDropdown is dropdown button
|
||||||
* @param int $userRight user action right
|
* @param int $userRight user action right
|
||||||
* // phpcs:disable
|
* // phpcs:disable
|
||||||
* @param array $params = [ // Various params for future : recommended rather than adding more function arguments
|
* @param array $params = [ // Various params for future : recommended rather than adding more function arguments
|
||||||
@@ -10363,16 +10364,20 @@ function dolGetStatus($statusLabel = '', $statusLabelShort = '', $html = '', $st
|
|||||||
* // phpcs:enable
|
* // phpcs:enable
|
||||||
* @return string html button
|
* @return string html button
|
||||||
*/
|
*/
|
||||||
function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = '', $id = '', $userRight = 1, $params = array())
|
function dolGetButtonAction($label, $html = '', $actionType = 'default', $url = '', $id = '', $isDropdown = false, $userRight = 1, $params = array())
|
||||||
{
|
{
|
||||||
global $hookmanager, $action, $object, $langs;
|
global $hookmanager, $action, $object, $langs;
|
||||||
|
|
||||||
|
//var_dump($isDropdown);
|
||||||
|
if ($isDropdown)
|
||||||
|
$class = "dropdown-item";
|
||||||
|
else {
|
||||||
$class = 'butAction';
|
$class = 'butAction';
|
||||||
if ($actionType == 'danger' || $actionType == 'delete') {
|
if ($actionType == 'danger' || $actionType == 'delete') {
|
||||||
$class = 'butActionDelete';
|
$class = 'butActionDelete';
|
||||||
if (!empty($url) && strpos($url, 'token=') === false) $url .= '&token='.newToken();
|
if (!empty($url) && strpos($url, 'token=') === false) $url .= '&token='.newToken();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$attr = array(
|
$attr = array(
|
||||||
'class' => $class,
|
'class' => $class,
|
||||||
'href' => empty($url) ? '' : $url,
|
'href' => empty($url) ? '' : $url,
|
||||||
|
|||||||
@@ -1316,56 +1316,56 @@ if ($action == 'create' && $user->rights->projet->creer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add button to create objects from project
|
|
||||||
if (!empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) {
|
if (!empty($conf->global->PROJECT_SHOW_CREATE_OBJECT_BUTTON)) {
|
||||||
print'<div class="dropdown-holder">';
|
print'<div class="dropdown inline-block">';
|
||||||
print'<a class="dropdown-toggle butAction">'.$langs->trans("Create").'</a>';
|
print'<a class="dropdown-toggle butAction" data-toggle="dropdown">'.$langs->trans("Create").'</a>';
|
||||||
print'<div class="dropdown-content">';
|
print '<div class="dropdown-menu">';
|
||||||
|
print '<div class="dropdown-global-search-button-list" >';
|
||||||
if (!empty($conf->propal->enabled) && $user->rights->propal->creer) {
|
if (!empty($conf->propal->enabled) && $user->rights->propal->creer) {
|
||||||
$langs->load("propal");
|
$langs->load("propal");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid . '">' . $langs->trans('AddProp') . '</a>';
|
print dolGetButtonAction('', $langs->trans('AddProp'), 'default', DOL_URL_ROOT.'/comm/propal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (!empty($conf->commande->enabled) && $user->rights->commande->creer) {
|
if (!empty($conf->commande->enabled) && $user->rights->commande->creer) {
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid . '">' . $langs->trans('createOrder') . '</a>';
|
print dolGetButtonAction('', $langs->trans('CreateOrder'), 'default', DOL_URL_ROOT.'/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (isModEnabled('facture') && $user->rights->facture->creer) {
|
if (isModEnabled('facture') && $user->rights->facture->creer) {
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid . '">' . $langs->trans('createBill') . '</a>';
|
print dolGetButtonAction('', $langs->trans('CreateBill'), 'default', DOL_URL_ROOT.'/compta/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) {
|
if (!empty($conf->supplier_proposal->enabled) && $user->rights->supplier_proposal->creer) {
|
||||||
$langs->load("supplier_proposal");
|
$langs->load("supplier_proposal");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid. '">' . $langs->trans('AddSupplierProposal') . '</a>';
|
print dolGetButtonAction('', $langs->trans('AddSupplierProposal'), 'default', DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (!empty($conf->supplier_order->enabled) && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) {
|
if (!empty($conf->supplier_order->enabled) && ($user->rights->fournisseur->commande->creer || $user->rights->supplier_order->creer)) {
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid . '">' . $langs->trans('AddSupplierOrder') . '</a>';
|
print dolGetButtonAction('', $langs->trans('AddSupplierOrder'), 'default', DOL_URL_ROOT.'/fourn/commande/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (!empty($conf->supplier_invoice->enabled) && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
if (!empty($conf->supplier_invoice->enabled) && ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer)) {
|
||||||
$langs->load("suppliers");
|
$langs->load("suppliers");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid . '">' . $langs->trans('AddSupplierInvoice') . '</a>';
|
print dolGetButtonAction('', $langs->trans('AddSupplierInvoice'), 'default', DOL_URL_ROOT.'/fourn/facture/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) {
|
if (!empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer) {
|
||||||
$langs->load("interventions");
|
$langs->load("interventions");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->s . '">' . $langs->trans('AddIntervention') . '</a>';
|
print dolGetButtonAction('', $langs->trans('AddIntervention'), 'default', DOL_URL_ROOT.'/fichinter/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (!empty($conf->contrat->enabled) && $user->rights->contrat->creer) {
|
if (!empty($conf->contrat->enabled) && $user->rights->contrat->creer) {
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid . '">' . $langs->trans('AddContract') . '</a>';
|
print dolGetButtonAction('', $langs->trans('AddContract'), 'default', DOL_URL_ROOT.'/contrat/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) {
|
if (!empty($conf->expensereport->enabled) && $user->rights->expensereport->creer) {
|
||||||
$langs->load("trips");
|
$langs->load("trips");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid . '">' . $langs->trans('AddTrip') . '</a>';
|
print dolGetButtonAction('', $langs->trans('AddTrip'), 'default', DOL_URL_ROOT.'/expensereport/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
if (!empty($conf->don->enabled) && $user->rights->don->creer) {
|
if (!empty($conf->don->enabled) && $user->rights->don->creer) {
|
||||||
$langs->load("donations");
|
$langs->load("donations");
|
||||||
print '<a class="dropdown-item" href="' . DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid . '">' . $langs->trans('AddDonation') . '</a>';
|
print dolGetButtonAction('', $langs->trans('AddDonation'), 'default', DOL_URL_ROOT.'/don/card.php?action=create&projectid='.$object->id.'&socid='.$object->socid, '', true);
|
||||||
}
|
}
|
||||||
print'</div>';
|
print "</div>";
|
||||||
print'</div>';
|
print "</div>";
|
||||||
//print'</div>';
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone
|
// Clone
|
||||||
if ($user->rights->projet->creer) {
|
if ($user->rights->projet->creer) {
|
||||||
if ($userWrite > 0) {
|
if ($userWrite > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user