From 6de6782458094fdeed32243016a965f61c021088 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 5 Mar 2021 08:41:04 +0100 Subject: [PATCH 01/12] fix: set class at right place --- htdocs/core/class/html.formfile.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 46e85707497..974bdce6d26 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1382,7 +1382,7 @@ class FormFile // $section is inside $param $newparam.=preg_replace('/&file=.*$/', '', $param); // We don't need param file= $backtopage = DOL_URL_ROOT.'/ecm/index.php?§ion_dir='.urlencode($relativepath).$newparam; - print ''.img_edit('default', 0, 'class="paddingrightonly"').''; + print ''.img_edit('default', 0, 'class="paddingrightonly"').''; } if (empty($useinecm) || $useinecm == 2 || $useinecm == 6) // 6=Media file manager @@ -1408,7 +1408,7 @@ class FormFile if ($permtoeditline) { $paramsectiondir = (in_array($modulepart, array('medias', 'ecm')) ? '§ion_dir='.urlencode($relativepath) : ''); - print ''.img_edit('default', 0, 'class="paddingrightonly"').''; + print ''.img_edit('default', 0, 'class="paddingrightonly"').''; } } if ($permonobject) From 7543b63a6ed9ff214c92b5768ad948284416f59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 5 Mar 2021 08:49:56 +0100 Subject: [PATCH 02/12] Fix #16544 --- htdocs/societe/consumption.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index e9514365c0f..4acf31c059e 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -422,6 +422,7 @@ if ($sql_select) $documentstatic->statut = $objp->status; $documentstatic->status = $objp->status; $documentstatic->paye = $objp->paid; + $documentstatic->alreadypaid = $objp->paid; if (is_object($documentstaticline)) $documentstaticline->statut = $objp->status; @@ -436,6 +437,8 @@ if ($sql_select) if ($type_element == 'contract') { print $documentstaticline->getLibStatut(2); + } elseif ($type_element == 'invoice') { + print $documentstatic->getLibStatut(5, $objp->paid); } else { From fee5bbf65b4346e40d8a67f84c287d4110945490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 7 Mar 2021 09:12:46 +0100 Subject: [PATCH 03/12] fix usage of else if --- htdocs/admin/tools/listevents.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php index 5e6667c58ad..3cfc3c74db9 100644 --- a/htdocs/admin/tools/listevents.php +++ b/htdocs/admin/tools/listevents.php @@ -68,7 +68,7 @@ $nowarray = dol_getdate($now); if (!GETPOSTISSET("date_startmonth")) { $date_start = dol_get_first_day($nowarray['year'], $nowarray['mon'], 'tzuserrel'); -} else if (GETPOST("date_startmonth") > 0) { +} elseif (GETPOST("date_startmonth") > 0) { $date_start = dol_mktime(0, 0, 0, GETPOST("date_startmonth", 'int'), GETPOST("date_startday", 'int'), GETPOST("date_startyear", 'int'), 'tzuserrel'); } else { $date_start = -1; From 4834f5fdf42986bdf402a29994cfd88a33aa5530 Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 7 Mar 2021 17:32:43 +0100 Subject: [PATCH 04/12] Fix get thirdparties by barcode or email --- htdocs/societe/class/api_thirdparties.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 3e8a6c91f92..27493d14515 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1815,7 +1815,7 @@ class Thirdparties extends DolibarrApi if (!DolibarrApiAccess::$user->rights->societe->lire) { throw new RestException(401); } - if ($rowid == 0) { + if ($rowid == 0 && empty($email) && empty($barcode)) { $result = $this->company->initAsSpecimen(); } else { $result = $this->company->fetch($rowid, $ref, $ref_ext, $barcode, $idprof1, $idprof2, $idprof3, $idprof4, $idprof5, $idprof6, $email, $ref_alias); From c0c9ac439f340be36a41f2a3dbf47b2f3535d8d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 8 Mar 2021 00:23:05 +0100 Subject: [PATCH 05/12] Update api_agendaevents.class.php --- htdocs/comm/action/class/api_agendaevents.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index e09bc905b96..d9feb4472b6 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -66,7 +66,7 @@ class AgendaEvents extends DolibarrApi if (!DolibarrApiAccess::$user->rights->agenda->myactions->read) { throw new RestException(401, "Insufficient rights to read an event"); } - if ($id == 0) { + if ($id === 0) { $result = $this->actioncomm->initAsSpecimen(); } else { $result = $this->actioncomm->fetch($id); From ec8baa6bff9b921e3591036ac22d340017369e39 Mon Sep 17 00:00:00 2001 From: ksar <35605507+ksar-ksar@users.noreply.github.com> Date: Mon, 8 Mar 2021 10:00:19 +0100 Subject: [PATCH 06/12] Update commondocgenerator.class.php #16341 --- htdocs/core/class/commondocgenerator.class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 03a5154f23f..ec05ad5d98d 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -798,6 +798,15 @@ abstract class CommonDocGenerator $resarray = $this->fill_substitutionarray_with_extrafields($line, $resarray, $extrafields, $array_key, $outputlangs); + // Load product data optional fields to the line -> enables to use "line_product_options_{extrafield}" + if (isset($line->fk_product) && $line->fk_product > 0) + { + $tmpproduct = new Product($this->db); + $result = $tmpproduct->fetch($line->fk_product); + foreach ($tmpproduct->array_options as $key=>$label) + $resarray["line_product_".$key] = $label; + } + return $resarray; } From cbb7751a157143f850e98c682bee61392e8bc4c4 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 8 Mar 2021 11:51:18 +0100 Subject: [PATCH 07/12] FIX : rounding amount on card updating --- htdocs/compta/sociales/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index d7f20622a43..9aa17914828 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -546,7 +546,7 @@ if ($id > 0) if ($action == 'edit') { print ''.$langs->trans("AmountTTC").""; - print ''; + print ''; print ""; } else { From 67c6577177cf5e58f81c140ca6cb4d46e840a0f6 Mon Sep 17 00:00:00 2001 From: Adrien Raze Date: Mon, 8 Mar 2021 15:47:02 +0100 Subject: [PATCH 08/12] FIX : Add "Now" link on social charges card creation --- htdocs/compta/sociales/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index d7f20622a43..dd5869b47c9 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -343,7 +343,7 @@ if ($action == 'create') print $langs->trans("Date"); print ''; print ''; - print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1); + print $form->selectDate(!empty($dateech) ? $dateech : '-1', 'ech', 0, 0, 0, 'charge', 1, 1); print ''; print "\n"; From 77b60d4d1cca0452b368ad8a55bc21ed3489e97f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Mar 2021 16:20:15 +0100 Subject: [PATCH 09/12] Update api_thirdparties.class.php --- htdocs/societe/class/api_thirdparties.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 27493d14515..f88668524ac 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1815,7 +1815,7 @@ class Thirdparties extends DolibarrApi if (!DolibarrApiAccess::$user->rights->societe->lire) { throw new RestException(401); } - if ($rowid == 0 && empty($email) && empty($barcode)) { + if ($rowid === 0 && empty($email) && empty($barcode)) { $result = $this->company->initAsSpecimen(); } else { $result = $this->company->fetch($rowid, $ref, $ref_ext, $barcode, $idprof1, $idprof2, $idprof3, $idprof4, $idprof5, $idprof6, $email, $ref_alias); From 3b9f38caa1f74a00c80a206446eb9501899f531d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Mar 2021 16:22:26 +0100 Subject: [PATCH 10/12] Update api_thirdparties.class.php --- htdocs/societe/class/api_thirdparties.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index f88668524ac..492916935f8 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -1793,7 +1793,7 @@ class Thirdparties extends DolibarrApi * * Return an array with thirdparty informations * - * @param int $rowid Id of third party to load + * @param int $rowid Id of third party to load (Use 0 to get a specimen record, use null to use other search criterias) * @param string $ref Reference of third party, name (Warning, this can return several records) * @param string $ref_ext External reference of third party (Warning, this information is a free field not provided by Dolibarr) * @param string $barcode Barcode of third party to load @@ -1815,7 +1815,7 @@ class Thirdparties extends DolibarrApi if (!DolibarrApiAccess::$user->rights->societe->lire) { throw new RestException(401); } - if ($rowid === 0 && empty($email) && empty($barcode)) { + if ($rowid === 0) { $result = $this->company->initAsSpecimen(); } else { $result = $this->company->fetch($rowid, $ref, $ref_ext, $barcode, $idprof1, $idprof2, $idprof3, $idprof4, $idprof5, $idprof6, $email, $ref_alias); From 20c30bade8cf1c229b1be855d7ca3700117a3b00 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Mar 2021 16:30:32 +0100 Subject: [PATCH 11/12] Update card.php --- htdocs/compta/sociales/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php index 9aa17914828..e8697aedea8 100644 --- a/htdocs/compta/sociales/card.php +++ b/htdocs/compta/sociales/card.php @@ -546,11 +546,11 @@ if ($id > 0) if ($action == 'edit') { print ''.$langs->trans("AmountTTC").""; - print ''; + print ''; print ""; } else { - print ''.$langs->trans("AmountTTC").''.price($object->amount, 0, $outputlangs, 1, -1, -1, $conf->currency).''; + print ''.$langs->trans("AmountTTC").''.price($object->amount).''; } // Mode of payment From 28c04a684f7cd384a35608070aa505a3fbae27a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Mar 2021 19:09:02 +0100 Subject: [PATCH 12/12] Fix position of field --- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index cc0bb4224b2..cc0386621a8 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -329,7 +329,7 @@ ALTER TABLE llx_product MODIFY COLUMN desiredstock float; ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN seuil_stock_alerte float; ALTER TABLE llx_product_warehouse_properties MODIFY COLUMN desiredstock float; -ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL; +ALTER TABLE llx_product ADD COLUMN fk_state integer DEFAULT NULL AFTER fk_country; ALTER TABLE llx_projet ADD COLUMN email_msgid varchar(255); ALTER TABLE llx_ticket ADD COLUMN email_msgid varchar(255);