From 0f1b63ec9b5f897759fd1cdfe8d0ed92f2121b53 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 27 Oct 2022 14:38:37 +0200 Subject: [PATCH 01/15] fix: cannot edit propal note --- htdocs/core/tpl/notes.tpl.php | 1 + htdocs/modulebuilder/template/class/myobject.class.php | 2 +- htdocs/user/class/user.class.php | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index 0430ec16e0e..f4ae0386807 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -64,6 +64,7 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { $permission = $user->hasRight("propale", "creer"); + var_dump($user->hasRight("propale", "creer")); } elseif ($module == 'supplier_proposal') { $permission = $user->hasRight("supplier_proposal", "creer"); } elseif ($module == 'fichinter') { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index a350fc4a8d6..e9eb2167b13 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -995,7 +995,7 @@ class MyObject extends CommonObject $langs->load("mymodule@mymodule"); if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { - $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard'; + $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_dolipadbaes_standard'; } if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e57fc387bc7..9db6e80e4d6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -686,6 +686,7 @@ class User extends CommonObject 'shipping' => 'expedition', 'task' => 'task@projet', 'fichinter' => 'ficheinter', + 'propale' => 'propal', 'inventory' => 'stock', 'invoice' => 'facture', 'invoice_supplier' => 'fournisseur', @@ -718,8 +719,6 @@ class User extends CommonObject $permlevel1 = $tmp[0]; } - //var_dump($module); - //var_dump($this->rights->$module); if (!in_array($module, $conf->modules)) { return 0; } From 346d6cec5a4155b73087e1b67b5a06705df7962a Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 27 Oct 2022 14:40:16 +0200 Subject: [PATCH 02/15] fix: cannot edit propal note --- htdocs/core/tpl/notes.tpl.php | 1 - htdocs/modulebuilder/template/class/myobject.class.php | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php index f4ae0386807..0430ec16e0e 100644 --- a/htdocs/core/tpl/notes.tpl.php +++ b/htdocs/core/tpl/notes.tpl.php @@ -64,7 +64,6 @@ if (!empty($conf->global->MAIN_AUTO_TIMESTAMP_IN_PRIVATE_NOTES)) { // Special cases if ($module == 'propal') { $permission = $user->hasRight("propale", "creer"); - var_dump($user->hasRight("propale", "creer")); } elseif ($module == 'supplier_proposal') { $permission = $user->hasRight("supplier_proposal", "creer"); } elseif ($module == 'fichinter') { diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e9eb2167b13..a350fc4a8d6 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -995,7 +995,7 @@ class MyObject extends CommonObject $langs->load("mymodule@mymodule"); if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { - $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_dolipadbaes_standard'; + $conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard'; } if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON)) { From 15b19840fb8f224d7fca9b48a7c3a7d41eb99783 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Thu, 27 Oct 2022 14:40:47 +0200 Subject: [PATCH 03/15] fix: cannot edit propal note --- htdocs/user/class/user.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9db6e80e4d6..bad796b966f 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -719,6 +719,8 @@ class User extends CommonObject $permlevel1 = $tmp[0]; } + //var_dump($module); + //var_dump($this->rights->$module); if (!in_array($module, $conf->modules)) { return 0; } From 589df5e63dea803868b3a159c75be4cca8b77cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Thu, 27 Oct 2022 16:13:11 +0200 Subject: [PATCH 04/15] check if contact is active before creating associated ticket --- htdocs/public/ticket/create_ticket.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index f2b72693a13..e81d9802aac 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -145,8 +145,19 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { // Le premier contact trouvé est utilisé pour déterminer le contact suivi $contacts = $object->searchContactByEmail($origin_email); + // Ensure that contact is active and select first active contact + $cid = 0; + foreach ($contacts as $key => $contact) { + if ($contact->statut !== "1") { + $cid = $key + 1; + } else { + break; + } + } + + // Option to require email exists to create ticket - if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[0]->socid) { + if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[$cid]->socid) { $error++; array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket")); $action = ''; @@ -198,8 +209,8 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { } if (is_array($contacts) and count($contacts) > 0) { - $object->fk_soc = $contacts[0]->socid; - $usertoassign = $contacts[0]->id; + $object->fk_soc = $contacts[$cid]->socid; + $usertoassign = $contacts[$cid]->id; } $ret = $extrafields->setOptionalsFromPost(null, $object); From 634348d0483158489107fa9da2aff7f82e136658 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 01:02:52 +0100 Subject: [PATCH 05/15] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index e81d9802aac..0e6515bedd2 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -148,9 +148,8 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { // Ensure that contact is active and select first active contact $cid = 0; foreach ($contacts as $key => $contact) { - if ($contact->statut !== "1") { - $cid = $key + 1; - } else { + if ((int) $contact->statut == 1) { + $cid = $key; break; } } From 414b183eadf547df2c5db76afe85b253fc7eac3a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 01:07:31 +0100 Subject: [PATCH 06/15] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 0e6515bedd2..ec47aaf4b18 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -146,7 +146,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $contacts = $object->searchContactByEmail($origin_email); // Ensure that contact is active and select first active contact - $cid = 0; + $cid = -1; foreach ($contacts as $key => $contact) { if ((int) $contact->statut == 1) { $cid = $key; @@ -156,7 +156,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { // Option to require email exists to create ticket - if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && !$contacts[$cid]->socid) { + if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && ($cid <= 0 || empty($contacts[$cid]->socid))) { $error++; array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket")); $action = ''; From 870ffb6ddaf627aa513714a440d16c604cfc04b5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 2 Nov 2022 01:10:17 +0100 Subject: [PATCH 07/15] Update create_ticket.php --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index ec47aaf4b18..60d10f012fc 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -207,7 +207,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { $object->fk_soc = $searched_companies[0]->id; } - if (is_array($contacts) and count($contacts) > 0) { + if (is_array($contacts) && count($contacts) > 0) { $object->fk_soc = $contacts[$cid]->socid; $usertoassign = $contacts[$cid]->id; } From bcfcbf19ec8c6a1750e66ef6137f9bdfbb250164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= Date: Wed, 2 Nov 2022 14:11:37 +0100 Subject: [PATCH 08/15] strictly inferior, please --- htdocs/public/ticket/create_ticket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 60d10f012fc..1b96cc5ebd6 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -156,7 +156,7 @@ if (empty($reshook) && $action == 'create_ticket' && GETPOST('save', 'alpha')) { // Option to require email exists to create ticket - if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && ($cid <= 0 || empty($contacts[$cid]->socid))) { + if (!empty($conf->global->TICKET_EMAIL_MUST_EXISTS) && ($cid < 0 || empty($contacts[$cid]->socid))) { $error++; array_push($object->errors, $langs->trans("ErrorEmailMustExistToCreateTicket")); $action = ''; From 221ce01cdcf3ff89075f95a21f9957b4e45bfddd Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Sat, 5 Nov 2022 08:02:56 +0100 Subject: [PATCH 09/15] FIX Accountancy - Better warning for situation invoice in index --- htdocs/accountancy/index.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index 18277eb6751..73bdccc1dba 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -81,12 +81,7 @@ $help_url = ''; llxHeader('', $langs->trans("AccountancyArea"), $help_url); -if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { - print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); - - print ''.$langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")."\n"; - print "
"; -} elseif ($conf->accounting->enabled) { +if ($conf->accounting->enabled) { $step = 0; $resultboxes = FormOther::getBoxesArea($user, "27"); // Load $resultboxes (selectboxlist + boxactivated + boxlista + boxlistb) @@ -111,15 +106,17 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S '; } - print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial); + if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { + print info_admin($langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")); + print "
"; + } + print '
'; // hideobject is to start hidden print "
\n"; print ''.$langs->trans("AccountancyAreaDescIntro")."
\n"; if (!empty($user->rights->accounting->chartofaccount)) { - print "
\n"; print "
\n"; - print load_fiche_titre(' '.$langs->trans("AccountancyAreaDescActionOnce"), '', '')."\n"; print '
'; print "
\n"; From e512c9aeee8519ad03339fd2a10f7e05b4cedd29 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 7 Nov 2022 14:04:01 +0100 Subject: [PATCH 10/15] Fix trans --- htdocs/core/class/utils.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 9a330c7aba5..007d34491d6 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -161,6 +161,7 @@ class Utils } if ($count > 0) { + $langs->load("admin"); $this->output = $langs->trans("PurgeNDirectoriesDeleted", $countdeleted); if ($count > $countdeleted) { $this->output .= '
'.$langs->trans("PurgeNDirectoriesFailed", ($count - $countdeleted)); From af6a708523684391e684e1df96e0c44943628ed4 Mon Sep 17 00:00:00 2001 From: Gauthier PC portable 024 Date: Tue, 8 Nov 2022 14:20:09 +0100 Subject: [PATCH 11/15] FIX : Missing $object for online signature link build --- htdocs/core/lib/signature.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/signature.lib.php b/htdocs/core/lib/signature.lib.php index 1dbefb5719a..c59acbea209 100644 --- a/htdocs/core/lib/signature.lib.php +++ b/htdocs/core/lib/signature.lib.php @@ -59,7 +59,7 @@ function showOnlineSignatureUrl($type, $ref) */ function getOnlineSignatureUrl($mode, $type, $ref = '', $localorexternal = 1) { - global $conf, $db, $langs, $dolibarr_main_url_root; + global $conf, $object, $dolibarr_main_url_root; $ref = str_replace(' ', '', $ref); $out = ''; From a8bd198a21f801ea8cf84df460d2c020fbd07835 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2022 12:26:48 +0100 Subject: [PATCH 12/15] FIX Subscription must be stopped when max of attendees reached. --- htdocs/public/eventorganization/attendee_new.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php index e0ad4a0420b..4dabf1f6c91 100644 --- a/htdocs/public/eventorganization/attendee_new.php +++ b/htdocs/public/eventorganization/attendee_new.php @@ -103,14 +103,16 @@ if ($type == 'global') { $errmsg .= $project->error; $errors = array_merge($errors, $project->errors); } else { - $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."projet"; - $sql .= " WHERE ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee = ".((int) $project->id); + $sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."eventorganization_conferenceorboothattendee"; + $sql .= " WHERE fk_project = ".((int) $project->id); - $resql = $db->query($resql); + $resql = $db->query($sql); if ($resql) { $obj = $db->fetch_object($resql); if ($obj) { $currentnbofattendees = $obj->nb; + } else { + dol_print_error($db); } } } From 64b8f96ebb6c82407f335715adfb0606b5ff7c93 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2022 14:41:19 +0100 Subject: [PATCH 13/15] Prepare 16.0.2 --- htdocs/filefunc.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c8978db3778..17c6ad187af 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '16.0.1'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '16.0.2'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { From fa07964b4b74eeac095b929fc9140a5aef22a8f0 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2022 14:53:28 +0100 Subject: [PATCH 14/15] Prepare 16.0.2 --- ChangeLog | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0c9e93454f2..321d6a29276 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,47 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 16.0.2 compared to 16.0.1 ***** + +FIX: 16.0 - computed extrafields are not displayed if the object has no other extrafields +FIX: #22538 +FIX: Accountancy - Review of Winfic - eWinfic - Winsis compta export format +FIX: add loadRoleMode on getlinearray +FIX: Autosearch on takepos was broken +FIX: avoid access forbidden with numeric ref +FIX: avoid error, check of product fetch is already check before +FIX: avoid error, fetch of product is mandatory (by id or by ref) +FIX: avoid unnecessary multiple calculation (#22637) +FIX: bug on selected value for select_bom() function +FIX: can not set prospect status "Do not contact" +FIX: change in the communication status of the prospect +FIX: check $id, already checked before +FIX: closed warehouse for shipping +FIX: extrafields_add tpl for stock movement +FIX: the request SQL for transversal user, the join on usergroup table must be with getEntity('usergroup') +FIX: Import of contact when there is duplicate thirdparties +FIX: Import of socialnetwork field +FIX: input selector is wrong with PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES usage +FIX: install wizard error management +FIX: just add integer +FIX: Missing $object for online signature link build +FIX: missing quote +FIX: only modify hidden checkbox/multislected extrafields on update if they are provided in request +FIX: php doc +FIX: private message ticket become public if edit action +FIX: remove > 0 and -1 +FIX: remove db object to avoid error with postgresql +FIX: Search ambigous field on MO list +FIX: Search on social networks +FIX: Subscription must be stopped when max of attendees reached. +FIX: supplier price update: missing error reporting +FIX: travis & stickler feedbacks +FIX: we must be able to select only bom of a specific product + several fixes on select_bom() function +FIX: wrong perm check +FIX: wrong typo, remove quote +FIX: wrong var typo + + ***** ChangeLog for 16.0.1 compared to 16.0.0 ***** FIX: #16476 on massaction the pdf generation is not using the t… From 886fa7a8121cc8aba49024a86b2fd3791f2a6a3f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 11 Nov 2022 14:57:02 +0100 Subject: [PATCH 15/15] Fix phpcs --- htdocs/comm/propal/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 8457acf1348..c017df5df97 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1655,7 +1655,7 @@ if ($action == 'create') { // Mode of payment print ''.$langs->trans('PaymentMode').''; print img_picto('', 'bank'); - $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id','int') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); + $form->select_types_paiements((GETPOSTISSET('mode_reglement_id') && GETPOST('mode_reglement_id', 'int') != 0) ? GETPOST('mode_reglement_id', 'int') : $soc->mode_reglement_id, 'mode_reglement_id', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx'); print ''; // Bank Account