From 6814488d86cf2435aaa335a5143f697771289f7d Mon Sep 17 00:00:00 2001 From: Anthony Berton <34568357+bb2a@users.noreply.github.com> Date: Wed, 14 Apr 2021 00:51:19 +0200 Subject: [PATCH 1/5] Update list.php --- htdocs/commande/list.php | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index db6bba130b1..d345bd033be 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -274,7 +274,15 @@ if (empty($reshook)) { $objectclass = 'Commande'; $objectlabel = 'Orders'; $permissiontoread = $user->rights->commande->lire; + $permissiontoadd = $user->rights->commande->creer; $permissiontodelete = $user->rights->commande->supprimer; + if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)){ + $permissiontovalidate = $user->rights->commande->order_advance->validate; + $permissiontoclose = $user->rights->commande->order_advance->close; + }else{ + $permissiontovalidate = $user->rights->commande->creer; + $permissiontoclose = $user->rights->commande->creer; + } $uploaddir = $conf->commande->multidir_output[$conf->entity]; $triggersendname = 'ORDER_SENTBYMAIL'; include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php'; @@ -700,16 +708,21 @@ if ($resql) { // List of mass actions available $arrayofmassactions = array( - 'generate_doc'=>$langs->trans("ReGeneratePDF"), - 'builddoc'=>$langs->trans("PDFMerge"), - 'cancelorders'=>$langs->trans("Cancel"), - 'presend'=>$langs->trans("SendByMail"), + 'generate_doc'=>img_picto('', 'pdf').' '.$langs->trans("ReGeneratePDF"), + 'builddoc'=>img_picto('', 'pdf').' '.$langs->trans("PDFMerge"), + 'cancelorders'=>img_picto('', 'close_title').' '.$langs->trans("Cancel"), + 'presend'=>img_picto('', 'email').' '.$langs->trans("SendByMail"), ); if ($user->rights->facture->creer) { - $arrayofmassactions['createbills'] = $langs->trans("CreateInvoiceForThisCustomer"); + $arrayofmassactions['createbills'] = img_picto('', 'bill').' '.$langs->trans("CreateInvoiceForThisCustomer"); } - if ($user->rights->commande->supprimer) { - $arrayofmassactions['predelete'] = ''.$langs->trans("Delete"); + if ($conf->global->MAIN_FEATURES_LEVEL == '2'){ //BB2A + if ($permissiontoclose) { + $arrayofmassactions['setbilled'] = img_picto('', 'bill').' '.$langs->trans("ClassifyBilled"); + } + } + if ($permissiontodelete) { + $arrayofmassactions['predelete'] = img_picto('', 'delete').' '.$langs->trans("Delete"); } if (in_array($massaction, array('presend', 'predelete', 'createbills'))) { $arrayofmassactions = array(); @@ -720,7 +733,7 @@ if ($resql) { if (!empty($socid)) { $url .= '&socid='.$socid; } - $newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $contextpage == 'orderlist' && $user->rights->commande->creer); + $newcardbutton = dolGetButtonTitle($langs->trans('NewOrder'), '', 'fa fa-plus-circle', $url, '', $contextpage == 'orderlist' && $permissiontoadd); // Lines of title fields print '