diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 0137e63406f..2b154d3639a 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -5,6 +5,7 @@ * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Christophe Battarel * Copyright (C) 2013-2022 Open-DSI + * Copyright (C) 2013-2023 Alexandre Spangaro * Copyright (C) 2013-2014 Florian Henry * Copyright (C) 2013-2014 Olivier Geffroy * Copyright (C) 2017-2021 Frédéric France @@ -805,12 +806,6 @@ if (!$error && $action == 'writebookkeeping') { require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; $lettering_static = new Lettering($db); $nb_lettering = $lettering_static->bookkeepingLetteringAll(array($bookkeeping->id)); - - if ($nb_lettering < 0) { - $error++; - $errorforline++; - setEventMessages($lettering_static->error, $lettering_static->errors, 'errors'); - } } } } diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 12303089dca..20af121e706 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -3,7 +3,7 @@ * Copyright (C) 2007-2010 Jean Heimburger * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin - * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2023 Alexandre Spangaro * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2018 Frédéric France @@ -380,13 +380,8 @@ if ($action == 'writebookkeeping') { if (getDolGlobalInt('ACCOUNTING_ENABLE_LETTERING') && getDolGlobalInt('ACCOUNTING_ENABLE_AUTOLETTERING')) { require_once DOL_DOCUMENT_ROOT . '/accountancy/class/lettering.class.php'; $lettering_static = new Lettering($db); - $nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id)); - if ($nb_lettering < 0) { - $error++; - $errorforline++; - setEventMessages($lettering_static->error, $lettering_static->errors, 'errors'); - } + $nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id)); } } } diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index d2fa04be0eb..2d557ca3aa2 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -4,7 +4,7 @@ * Copyright (C) 2011 Juanjo Menent * Copyright (C) 2012 Regis Houssin * Copyright (C) 2013 Christophe Battarel - * Copyright (C) 2013-2021 Alexandre Spangaro + * Copyright (C) 2013-2023 Alexandre Spangaro * Copyright (C) 2013-2016 Florian Henry * Copyright (C) 2013-2016 Olivier Geffroy * Copyright (C) 2014 Raphaël Doursenaud @@ -405,13 +405,6 @@ if ($action == 'writebookkeeping') { $lettering_static = new Lettering($db); $nb_lettering = $lettering_static->bookkeepingLettering(array($bookkeeping->id)); - - if ($nb_lettering < 0) { - $error++; - $errorforline++; - $errorforinvoice[$key] = 'other'; - setEventMessages($lettering_static->error, $lettering_static->errors, 'errors'); - } } } } diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index f4c515c1f24..08d3d2a6cc0 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -762,14 +762,22 @@ class InterfaceActionsAuto extends DolibarrTriggers // Load translation files required by the page $langs->loadLangs(array("agenda", "other", "members")); - if (empty($object->actionmsg2)) { - $object->actionmsg2 = $langs->transnoentities("MemberSubscriptionDeletedInDolibarr", $object->ref, $object->getFullName($langs)); + $member = $this->context['member']; + if (!is_object($member)) { // This should not happen but it happen when deleting a subscription from adherents/subscription/card.php + dol_syslog("Execute a trigger MEMBER_SUBSCRIPTION_CREATE with context key 'member' not an object"); + include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; + $member = new Adherent($this->db); + $member->fetch($object->fk_adherent); } - $object->actionmsg = $langs->transnoentities("MemberSubscriptionDeletedInDolibarr", $object->ref, $object->getFullName($langs)); - $object->actionmsg .= "\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); + + $object->actionmsg = $langs->transnoentities("MemberSubscriptionDeletedInDolibarr", $object->ref, $member->getFullName($langs)); + $object->actionmsg .= "\n".$langs->transnoentities("Member").': '.$member->getFullName($langs); $object->actionmsg .= "\n".$langs->transnoentities("Type").': '.$object->fk_type; $object->actionmsg .= "\n".$langs->transnoentities("Amount").': '.$object->amount; $object->actionmsg .= "\n".$langs->transnoentities("Period").': '.dol_print_date($object->dateh, 'day').' - '.dol_print_date($object->datef, 'day'); + if (empty($object->actionmsg2)) { + $object->actionmsg2 = $langs->transnoentities("MemberSubscriptionDeletedInDolibarr", $object->ref, $member->getFullName($langs)); + } $object->sendtoid = 0; if (isset($object->fk_soc) && $object->fk_soc > 0) { diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index b7f412cc765..484be30b5ce 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -734,6 +734,7 @@ if (empty($reshook)) { // Actions on extra fields $result = $object->insertExtraFields('INTERVENTION_MODIFY'); if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); $error++; } } diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index 1a5b2ce2efb..eb5f84ee82e 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -132,6 +132,8 @@ if ($user->socid) { } $result = restrictedArea($user, 'produit|service', 0, 'product&product'); +$hookmanager->initHooks(array('reassortlotlist')); + /* * Actions diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index dfa26202a2d..6861a8d7926 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -706,8 +706,7 @@ if ($id > 0 || !empty($ref)) { // List of actions on element include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $defaultthirdpartyid = $socid > 0 ? $socid : $object->project->socid; - $formactions->showactions($object, 'task', $defaultthirdpartyid, 1, '', 10, 'withproject='.$withproject); + $formactions->showactions($object, 'project_task', 0, 1, '', 10, 'withproject='.$withproject); print ''; } diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 3887060d8a9..f6e9671ff38 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -630,7 +630,7 @@ if (empty($reshook)) { $error++; } - if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && GETPOST('price_ht') === '' && GETPOST('price_ttc') === '' && $price_ht_devise === '') { // Unit price can be 0 but not ''. Also price can be negative for proposal. + if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && GETPOST('price_ht') === '' && GETPOST('price_ttc') === '' && GETPOST('multicurrency_price_ht') === '') { // Unit price can be 0 but not ''. Also price can be negative for proposal. setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPrice")), null, 'errors'); $error++; }