diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index 0b67327b11c..3c2e8763fe1 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -237,7 +237,7 @@ if ($action != 'export_csv') { print ''; $parameters = array(); - $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook + $reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $button = 'global->ACCOUNTING_EXPORT_FORMAT.')" />'; diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index 8b2ba49d1bc..a90400cfd7a 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -766,7 +766,7 @@ if (count($filter)) { } $parameters = array(); -$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { // Button re-export if (!empty($conf->global->ACCOUNTING_REEXPORT)) { diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index d73f4228f97..837a372a32d 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -473,7 +473,7 @@ print ''; print ''; $parameters = array(); -$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param); $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly btnTitleSelected')); diff --git a/htdocs/accountancy/bookkeeping/listbysubaccount.php b/htdocs/accountancy/bookkeeping/listbysubaccount.php index e529126d8ce..c6fb95d5ab7 100644 --- a/htdocs/accountancy/bookkeeping/listbysubaccount.php +++ b/htdocs/accountancy/bookkeeping/listbysubaccount.php @@ -473,7 +473,7 @@ print ''; print ''; $parameters = array(); -$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$reshook = $hookmanager->executeHooks('addMoreActionsButtonsList', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { $newcardbutton = dolGetButtonTitle($langs->trans('ViewFlatList'), '', 'fa fa-list paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/list.php?'.$param); $newcardbutton .= dolGetButtonTitle($langs->trans('GroupByAccountAccounting'), '', 'fa fa-stream paddingleft imgforviewmode', DOL_URL_ROOT.'/accountancy/bookkeeping/listbyaccount.php?'.$param, '', 1, array('morecss' => 'marginleftonly')); diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index 8e50380e2ae..1014d40de50 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -41,6 +41,8 @@ $langs->loadLangs(array('admin', 'other', 'agenda', 'users')); $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $param = GETPOST('param', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); diff --git a/htdocs/admin/agenda_reminder.php b/htdocs/admin/agenda_reminder.php index 1d8cd8f723c..79aa081ddef 100644 --- a/htdocs/admin/agenda_reminder.php +++ b/htdocs/admin/agenda_reminder.php @@ -36,6 +36,8 @@ $langs->loadLangs(array("admin", "other", "agenda")); $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $param = GETPOST('param', 'alpha'); $cancel = GETPOST('cancel', 'alpha'); $scandir = GETPOST('scandir', 'alpha'); diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index 2fbfed35536..ee0fcd5d130 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -36,6 +36,7 @@ if (!$user->admin) { } $action = GETPOST('action', 'aZ09'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php /* diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php index a36c3698306..e3adb206d7e 100644 --- a/htdocs/admin/bom.php +++ b/htdocs/admin/bom.php @@ -36,6 +36,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'bom'; diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php index 24a45bb413a..5c8eb88126c 100644 --- a/htdocs/admin/commande.php +++ b/htdocs/admin/commande.php @@ -46,6 +46,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'order'; diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php index 1c6a0ec0458..0c8aba5ae2d 100644 --- a/htdocs/admin/contract.php +++ b/htdocs/admin/contract.php @@ -37,6 +37,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'contract'; diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php index 8e60b02a5bf..6f0f4c1b415 100644 --- a/htdocs/admin/delivery.php +++ b/htdocs/admin/delivery.php @@ -43,6 +43,8 @@ if (!$user->admin) { $action = GETPOST('action', 'alpha'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'delivery'; diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 8edc61bf255..904d10bff67 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -41,6 +41,8 @@ $backtopage = GETPOST('backtopage', 'alpha'); $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $scandir = GETPOST('scan_dir', 'alpha'); $type = 'myobject'; diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php index 2d4736cc49d..12e0d0a6d01 100644 --- a/htdocs/admin/expedition.php +++ b/htdocs/admin/expedition.php @@ -43,6 +43,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'shipping'; diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php index 5b73d995b5c..fc63940f0b8 100644 --- a/htdocs/admin/expensereport.php +++ b/htdocs/admin/expensereport.php @@ -43,6 +43,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'expensereport'; diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index ae269492ddf..9eec54b03a7 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -42,6 +42,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'invoice'; diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index 789faacacad..609a6605d1a 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -51,6 +51,8 @@ $backtopage = GETPOST('backtopage', 'alpha'); $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $scandir = GETPOST('scan_dir', 'alpha'); $type = 'invoice'; diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php index 4369bb9a2a7..c95f354a189 100644 --- a/htdocs/admin/fichinter.php +++ b/htdocs/admin/fichinter.php @@ -43,6 +43,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'ficheinter'; diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php index bfd7e22c461..c1755b17edf 100644 --- a/htdocs/admin/holiday.php +++ b/htdocs/admin/holiday.php @@ -39,6 +39,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'contract'; diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php index 1ad84ce19ac..aea86069f4d 100644 --- a/htdocs/admin/hrm.php +++ b/htdocs/admin/hrm.php @@ -50,6 +50,8 @@ $backtopage = GETPOST('backtopage', 'alpha'); $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $scandir = GETPOST('scan_dir', 'alpha'); $type = 'myobject'; diff --git a/htdocs/admin/import.php b/htdocs/admin/import.php index cd9d7b44074..37168baa3d4 100644 --- a/htdocs/admin/import.php +++ b/htdocs/admin/import.php @@ -41,6 +41,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + /* * Actions diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php index 8d93c16741a..c2440bbb885 100644 --- a/htdocs/admin/knowledgemanagement.php +++ b/htdocs/admin/knowledgemanagement.php @@ -37,8 +37,9 @@ $langs->loadLangs(array("admin", "knowledgemanagement")); // Parameters $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); - $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'knowledgemanagement'; diff --git a/htdocs/admin/mrp.php b/htdocs/admin/mrp.php index 54efdc4df19..fac6a3f3d41 100644 --- a/htdocs/admin/mrp.php +++ b/htdocs/admin/mrp.php @@ -37,6 +37,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'mrp'; diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php index 22ce045a7ab..6384c561967 100644 --- a/htdocs/admin/propal.php +++ b/htdocs/admin/propal.php @@ -43,6 +43,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'propal'; diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php index 218cc1ef853..26300ece329 100644 --- a/htdocs/admin/reception_setup.php +++ b/htdocs/admin/reception_setup.php @@ -36,6 +36,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'reception'; diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php index 808528cdc0a..0da79845d14 100644 --- a/htdocs/admin/supplier_order.php +++ b/htdocs/admin/supplier_order.php @@ -43,6 +43,8 @@ if (!$user->admin) { $type = GETPOST('type', 'alpha'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $action = GETPOST('action', 'aZ09'); $scandir = GETPOST('scan_dir', 'alpha'); diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php index b31e4c9a433..a41f9fdf80c 100644 --- a/htdocs/admin/supplier_payment.php +++ b/htdocs/admin/supplier_payment.php @@ -37,6 +37,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scandir', 'alpha'); $type = 'supplier_payment'; diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php index 6e3f190aeb6..9bd684afb22 100644 --- a/htdocs/admin/supplier_proposal.php +++ b/htdocs/admin/supplier_proposal.php @@ -38,6 +38,8 @@ if (!$user->admin) { $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); $type = 'supplier_proposal'; diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php index 03fd647dd29..f4e5b4f3fad 100644 --- a/htdocs/admin/ticket.php +++ b/htdocs/admin/ticket.php @@ -38,6 +38,8 @@ if (!$user->admin) { // Parameters $value = GETPOST('value', 'alpha'); $action = GETPOST('action', 'aZ09'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scandir', 'alpha'); $type = 'ticket'; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 85ab0f0e9a8..53de8fe2502 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -43,9 +43,11 @@ $extrafields = new ExtraFields($db); $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); + $scandir = GETPOST('scandir', 'alpha'); $type = 'user'; diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php index 3319ab994a6..709b60068f7 100644 --- a/htdocs/admin/usergroup.php +++ b/htdocs/admin/usergroup.php @@ -42,6 +42,8 @@ $extrafields = new ExtraFields($db); $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php + $type = 'group'; /* diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php index e89cbb2fd41..58118827ed4 100644 --- a/htdocs/admin/workstation.php +++ b/htdocs/admin/workstation.php @@ -36,6 +36,7 @@ $langs->loadLangs(array("admin", "workstation")); // Parameters $action = GETPOST('action', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); +$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php $value = GETPOST('value', 'alpha'); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 1345320f08a..c17e07bd17b 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2269,7 +2269,10 @@ abstract class CommonObject */ public function setPaymentMethods($id) { + $error = 0; $notrigger = 0; + dol_syslog(get_class($this).'::setPaymentMethods('.$id.')'); + if ($this->statut >= 0 || $this->element == 'societe') { // TODO uniformize field name $fieldname = 'fk_mode_reglement'; @@ -2296,6 +2299,15 @@ abstract class CommonObject if (get_class($this) == 'Fournisseur') { $this->mode_reglement_supplier_id = $id; } + // Triggers + if (!$error && !$notrigger) { + // Call triggers + $result = $this->call_trigger(strtoupper(get_class($this)).'_MODIFY', $user); + if ($result < 0) { + $error++; + } + // End call triggers + } return 1; } else { dol_syslog(get_class($this).'::setPaymentMethods Error '.$this->db->error()); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2eb1802d303..a59f35a3978 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -783,7 +783,7 @@ function checkVal($out = '', $check = 'alphanohtml', $filter = null, $options = // keep lines feed } break; - case 'alphawithlgt': // No " and no ../ but we keep balanced < > tags with no special chars inside. Can be used for email string like "Name " + case 'alphawithlgt': // No " and no ../ but we keep balanced < > tags with no special chars inside. Can be used for email string like "Name ". Less secured than 'alphanohtml' if (!is_array($out)) { $out = trim($out); do { @@ -1666,7 +1666,11 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $limittitle = 30; $out .= ''; if ($picto) { - $out .= img_picto($title, ($pictoisfullpath ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' '; + $noprefix = $pictoisfullpath; + if (strpos($picto, 'fontawesome_') !== false) { + $noprefix = 1; + } + $out .= img_picto($title, ($noprefix ? '' : 'object_').$picto, '', $pictoisfullpath, 0, 0, '', 'imgTabTitle').' '; } $out .= ''.dol_escape_htmltag(dol_trunc($title, $limittitle)).''; $out .= ''; @@ -2021,10 +2025,14 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi $width = 14; $cssclass = 'photorefcenter'; $picto = $object->picto; + $prefix = 'object_'; if ($object->element == 'project' && !$object->public) { $picto = 'project'; // instead of projectpub } - $nophoto = img_picto('No photo', 'object_'.$picto); + if (strpos($picto, 'fontawesome_') !== false) { + $prefix = ''; + } + $nophoto = img_picto('No photo', $prefix.$picto); } $morehtmlleft .= ''; $morehtmlleft .= '
'; @@ -3609,6 +3617,7 @@ function dol_trunc($string, $size = 40, $trunc = 'right', $stringencoding = 'UTF * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) + * Example: fontawesome_envelope-open-text_fas_red_1em if you want to use fontaweseome icons: fontawesome__