From 6a53e02c3c1d2c5216cf68aa9788756feb223abf Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Sun, 5 Apr 2020 14:02:51 +0200 Subject: [PATCH 01/76] FIX better url for get conf with REST API need to be more userfriendly and similar to other api (without a variable with GET varible in URL "?confname=" --- htdocs/api/class/api_setup.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 7b47c59dbb7..05d9214389f 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1409,15 +1409,15 @@ class Setup extends DolibarrApi * * Note that conf variables that stores security key or password hashes can't be loaded with API. * - * @url GET /conf - * - * @param string $confname Name of conf variable to get + * @param string $constante Name of conf variable to get * @return array|mixed Data without useless information * + * @url GET conf/{constante} + * * @throws RestException 403 Forbidden - * @throws RestException 500 Error Bad or unknown value for constname + * @throws RestException 500 Error Bad or unknown value for constname */ - public function getConf($confname) + public function getConf($constante) { global $conf; @@ -1426,14 +1426,14 @@ class Setup extends DolibarrApi throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK'); } - if (! preg_match('/^[a-zA-Z0-9_]+$/', $confname) || ! isset($conf->global->$confname)) { + if (! preg_match('/^[a-zA-Z0-9_]+$/', $constante) || ! isset($conf->global->$constante)) { throw new RestException(500, 'Error Bad or unknown value for constname'); } - if (preg_match('/(_pass|password|secret|_key|key$)/i', $confname)) { + if (preg_match('/(_pass|password|secret|_key|key$)/i', $constante)) { throw new RestException(403, 'Forbidden'); } - return $conf->global->$confname; + return $conf->global->$constante; } /** From 1827541f88dab73951f49371d0f4c19d8a0205fa Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sun, 5 Apr 2020 12:04:25 +0000 Subject: [PATCH 02/76] Fixing style errors. --- htdocs/api/class/api_setup.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index 05d9214389f..d6ee0f1a79e 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1413,7 +1413,7 @@ class Setup extends DolibarrApi * @return array|mixed Data without useless information * * @url GET conf/{constante} - * + * * @throws RestException 403 Forbidden * @throws RestException 500 Error Bad or unknown value for constname */ From 26bc5381e47e2757d4bae54a977c301813216f5c Mon Sep 17 00:00:00 2001 From: ptibogxiv Date: Wed, 8 Apr 2020 14:57:34 +0200 Subject: [PATCH 03/76] Update api_setup.class.php --- htdocs/api/class/api_setup.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index d6ee0f1a79e..5f867c066c7 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1409,15 +1409,15 @@ class Setup extends DolibarrApi * * Note that conf variables that stores security key or password hashes can't be loaded with API. * - * @param string $constante Name of conf variable to get + * @param string $constantname Name of conf variable to get * @return array|mixed Data without useless information * - * @url GET conf/{constante} + * @url GET conf/{constantname} * * @throws RestException 403 Forbidden * @throws RestException 500 Error Bad or unknown value for constname */ - public function getConf($constante) + public function getConf($constantname) { global $conf; @@ -1426,14 +1426,14 @@ class Setup extends DolibarrApi throw new RestException(403, 'Error API open to admin users only or to the login user defined with constant API_LOGIN_ALLOWED_FOR_ADMIN_CHECK'); } - if (! preg_match('/^[a-zA-Z0-9_]+$/', $constante) || ! isset($conf->global->$constante)) { + if (! preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || ! isset($conf->global->$constantname)) { throw new RestException(500, 'Error Bad or unknown value for constname'); } - if (preg_match('/(_pass|password|secret|_key|key$)/i', $constante)) { + if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) { throw new RestException(403, 'Forbidden'); } - return $conf->global->$constante; + return $conf->global->$constantname; } /** From 924b8fd1386b4556f260b3b1894050f3cb1237ef Mon Sep 17 00:00:00 2001 From: jribal Date: Mon, 20 Apr 2020 13:21:12 +0100 Subject: [PATCH 04/76] add project object dependency Dependency was missing. Webapp seems fine but api fails. --- htdocs/projet/class/task.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 6136198fd5e..f3f75b716c1 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -26,6 +26,7 @@ */ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php'; +require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; /** From 66ad197fc5230383c42609ced6540119f16c26b6 Mon Sep 17 00:00:00 2001 From: "DEMAREST Maxime (Indelog)" Date: Mon, 20 Apr 2020 15:49:31 +0200 Subject: [PATCH 05/76] NEW possibility to show society info when print page If global config key SHOW_SOCINFO_ON_PRINT is set, this add a block in top of page which display basic society information when the layout for printing is activated (print button in top bar is cliqued). --- htdocs/main.inc.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 400ad73fad2..10db0b954ae 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -11,6 +11,7 @@ * Copyright (C) 2012 Christophe Battarel * Copyright (C) 2014-2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2020 Demarest Maxime * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2364,6 +2365,36 @@ function main_area($title = '') print ''."\n".'
'."\n"; if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED)); + + // Permit to add user company information on each printed document by set SHOW_SOCINFO_ON_PRINT + if ($conf->global->SHOW_SOCINFO_ON_PRINT && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) + { + global $hookmanager; + $hookmanager->initHooks(array('showsocinfoonprint')); + $parameters = array(); + $reshook = $hookmanager->executeHooks('showSocinfoOnPrint', $parameters); + if (empty($reshook)) + { + print ''."\n"; + print '
'."\n"; + print ''."\n"; + print ''; + print ''."\n"; + print ''."\n"; + print ''."\n"; + if (!empty($conf->global->MAIN_INFO_SOCIETE_TEL)) print ''; + if (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL)) print ''; + if (!empty($conf->global->MAIN_INFO_SOCIETE_WEB)) print ''; + print ''; + print '
'; + if ($conf->global->MAIN_SHOW_LOGO && empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) && !empty($conf->global->MAIN_INFO_SOCIETE_LOGO)) + print ''; + print '
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM).'
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ADDRESS).'
'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP).' '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN).'
'.$langs->trans("Phone").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TEL).'
'.$langs->trans("Email").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_MAIL).'
'.$langs->trans("Web").' : '.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_WEB).'
'."\n"; + print '
'."\n"; + print ''."\n"; + } + } + } From f4d1ca94b34bbbd65e395c05b9fdac6455073e3c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Mon, 20 Apr 2020 14:49:18 +0000 Subject: [PATCH 06/76] Fixing style errors. --- htdocs/main.inc.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 10db0b954ae..73c21459b5c 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2394,7 +2394,6 @@ function main_area($title = '') print ''."\n"; } } - } From f09fa5226a30e6846cdadf27f75894912afbc64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 20 Apr 2020 18:43:05 +0200 Subject: [PATCH 07/76] Rename llx_c_shipment_package_type to llx_c_shipment_package_type.sql --- ...lx_c_shipment_package_type => llx_c_shipment_package_type.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename htdocs/install/mysql/tables/{llx_c_shipment_package_type => llx_c_shipment_package_type.sql} (100%) diff --git a/htdocs/install/mysql/tables/llx_c_shipment_package_type b/htdocs/install/mysql/tables/llx_c_shipment_package_type.sql similarity index 100% rename from htdocs/install/mysql/tables/llx_c_shipment_package_type rename to htdocs/install/mysql/tables/llx_c_shipment_package_type.sql From f3ebc33d1e22f78d335021874fd9805ec341d157 Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Tue, 21 Apr 2020 01:14:02 -0500 Subject: [PATCH 08/76] Fix calculator to consume with to produce i.e. to produce 100 then Order can be produce 135. --- htdocs/mrp/class/mo.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 84bf44c84fe..76bbe7ef26f 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1,6 +1,6 @@ - * Copyright (C) ---Put here your own copyright and developer email--- + * Copyright (C) 2020 Lenin Rivas * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -648,7 +648,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = round($line->qty * $this->qty / $line->efficiency, 2); + $moline->qty = round($line->qty * ($this->qty / $bom->qty) / $line->efficiency, 4); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++; From b469775718e9b429628a23a825031442d55c4749 Mon Sep 17 00:00:00 2001 From: Lenin Rivas <53640168+leninrivas@users.noreply.github.com> Date: Tue, 21 Apr 2020 01:21:08 -0500 Subject: [PATCH 09/76] More Presition to 8 decimals --- htdocs/mrp/class/mo.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 76bbe7ef26f..570281ac294 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1,6 +1,7 @@ * Copyright (C) 2020 Lenin Rivas + * Copyright (C) ---Put here your own copyright and developer email--- * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -648,7 +649,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = round($line->qty * ($this->qty / $bom->qty) / $line->efficiency, 4); // Calculate with Qty to produce and more presition + $moline->qty = round($line->qty * ($this->qty / $bom->qty) / $line->efficiency, 8); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++; From cf05796f31112737fca5f2e77250121a1976635d Mon Sep 17 00:00:00 2001 From: Laurent Paumier Date: Tue, 21 Apr 2020 23:01:21 +0200 Subject: [PATCH 10/76] FIX #13027 expensereport status in generated pdf --- htdocs/expensereport/class/expensereport.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index db46d591816..dfa9a7c5b95 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -704,8 +704,8 @@ class ExpenseReport extends CommonObject // phpcs:enable global $langs; - $labelStatus = $langs->trans($this->statuts[$status]); - $labelStatusShort = $langs->trans($this->statuts_short[$status]); + $labelStatus = $langs->transnoentities($this->statuts[$status]); + $labelStatusShort = $langs->transnoentities($this->statuts_short[$status]); $statusType = $this->statuts_logo[$status]; From 2fde77703d8cb3cae1249f1fa33fac13b8949939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Apr 2020 23:06:41 +0200 Subject: [PATCH 11/76] add extrafields in note for enstein --- htdocs/core/modules/commande/doc/pdf_einstein.modules.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index b8740fa60de..3838b9146e6 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -7,7 +7,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -372,6 +372,12 @@ class pdf_einstein extends ModelePDFCommandes if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); } } + // Extrafields in note + $extranote = $this->getExtrafieldsInHtml($object, $outputlangs); + if (!empty($extranote)) { + $notetoshow = dol_concatdesc($notetoshow, $extranote); + } + if ($notetoshow) { $tab_top -= 2; From 7972a35e369a886003fc16748ac74b7900a08e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Apr 2020 23:12:12 +0200 Subject: [PATCH 12/76] Update pdf_azur.modules.php --- htdocs/core/modules/propale/doc/pdf_azur.modules.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 07074888409..c285f560678 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -7,7 +7,7 @@ * Copyright (C) 2012 Cedric Salvador * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * Copyright (C) 2019 Pierre Ardoin * * This program is free software; you can redistribute it and/or modify @@ -439,6 +439,11 @@ class pdf_azur extends ModelePDFPropales if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); } } + // Extrafields in note + $extranote = $this->getExtrafieldsInHtml($object, $outputlangs); + if (!empty($extranote)) { + $notetoshow = dol_concatdesc($notetoshow, $extranote); + } if (!empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0) { $tmpuser = new User($this->db); From 8f4270722009cbacd54d0ae3af71e8dbbe67c003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 21 Apr 2020 23:20:11 +0200 Subject: [PATCH 13/76] Update pdf_crabe.modules.php --- htdocs/core/modules/facture/doc/pdf_crabe.modules.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index 4d9df1c662a..dcb6cc33a96 100644 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -8,7 +8,7 @@ * Copyright (C) 2012-2014 Raphaël Doursenaud * Copyright (C) 2015 Marcos García * Copyright (C) 2017-2018 Ferran Marcet - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -456,6 +456,11 @@ class pdf_crabe extends ModelePDFFactures if (!empty($salerepobj->signature)) $notetoshow = dol_concatdesc($notetoshow, $salerepobj->signature); } } + // Extrafields in note + $extranote = $this->getExtrafieldsInHtml($object, $outputlangs); + if (!empty($extranote)) { + $notetoshow = dol_concatdesc($notetoshow, $extranote); + } if ($notetoshow) { $tab_top -= 2; From e8ead1d9245c55b41a5ee1fd46b1659eab457959 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 00:36:46 +0200 Subject: [PATCH 14/76] Update expensereport.class.php --- htdocs/expensereport/class/expensereport.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index dfa9a7c5b95..ab54a4f3915 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -704,8 +704,8 @@ class ExpenseReport extends CommonObject // phpcs:enable global $langs; - $labelStatus = $langs->transnoentities($this->statuts[$status]); - $labelStatusShort = $langs->transnoentities($this->statuts_short[$status]); + $labelStatus = $langs->transnoentitiesnoconv($this->statuts[$status]); + $labelStatusShort = $langs->transnoentitiesnoconv($this->statuts_short[$status]); $statusType = $this->statuts_logo[$status]; From 8ed9c30a892144493276c7503cc60158fa5c2ec1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Apr 2020 09:02:02 +0200 Subject: [PATCH 15/76] clean tab/whitespace --- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index bc353e7ef0d..f2f1bac9257 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -12,7 +12,7 @@ * Copyright (C) 2015-2019 Ferran Marcet * Copyright (C) 2016 Alexandre Spangaro * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2020 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3154,7 +3154,7 @@ class SupplierInvoiceLine extends CommonObjectLine dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); } } - + if (!$error) { // Supprime ligne $sql = 'DELETE FROM '.MAIN_DB_PREFIX.'facture_fourn_det '; From cce3085a79ceda311df5eb3a5b169f791687383f Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Wed, 22 Apr 2020 10:44:23 +0200 Subject: [PATCH 16/76] NEW can update contact in import model --- htdocs/core/modules/modSociete.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 0d74fea9b24..7d64a1a7499 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -579,6 +579,7 @@ class modSociete extends DolibarrModules 'extra' => MAIN_DB_PREFIX.'socpeople_extrafields' ); // List of tables to insert into (insert done in same order) $this->import_fields_array[$r] = array(//field order as per structure of table llx_socpeople + 's.rowid' => 'Id', 's.datec' => "DateCreation", 's.fk_soc' => 'ThirdPartyName', 's.civility' => 'UserTitle', @@ -645,6 +646,7 @@ class modSociete extends DolibarrModules 's.datec' => '^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]( [0-9][0-9]:[0-9][0-9]:[0-9][0-9])?$' ); $this->import_examplevalues_array[$r] = array(//field order as per structure of table llx_socpeople + 's.rowid' => '1', 's.datec' => 'formatted as '.dol_print_date(dol_now(), '%Y-%m-%d'), 's.fk_soc' => 'Third Party name eg. TPBigCompany', 's.civility' => 'Title of civility eg: MR...matches field "code" in table "'.MAIN_DB_PREFIX.'c_civility"', @@ -666,6 +668,9 @@ class modSociete extends DolibarrModules 's.note_private' => "My private note", 's.note_public' => "My public note" ); + $this->import_updatekeys_array[$r] = array( + 's.rowid' => 'Id' + ); // Import Bank Accounts $r++; From 8be14060d64f635d6142c0db1f6c36728440f4ac Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 22 Apr 2020 12:08:05 +0200 Subject: [PATCH 17/76] fix: avoid php notice --- htdocs/core/modules/modService.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/modService.class.php b/htdocs/core/modules/modService.class.php index 4fb5cb175b0..1b8c2d7f7e5 100644 --- a/htdocs/core/modules/modService.class.php +++ b/htdocs/core/modules/modService.class.php @@ -579,7 +579,7 @@ class modService extends DolibarrModules 'sp.remise_percent'=>'DiscountQtyMin' )); - if ($conf->multicurrency->enabled) + if (!empty($conf->multicurrency->enabled)) { $this->import_fields_array[$r] = array_merge($this->import_fields_array[$r], array( 'sp.fk_multicurrency'=>'CurrencyCodeId', //ideally this should be automatically obtained from the CurrencyCode on the next line @@ -616,7 +616,7 @@ class modService extends DolibarrModules // TODO Make this field not required and calculate it from price and qty 'sp.remise_percent' => '20' )); - if ($conf->multicurrency->enabled) + if (!empty($conf->multicurrency->enabled)) { $this->import_examplevalues_array[$r] = array_merge($this->import_examplevalues_array[$r], array( 'sp.fk_multicurrency'=>'eg: 2, rowid for code of multicurrency currency', From f6f9ca48dd9b6d76aadeca33021c8ab30a7cd020 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 22 Apr 2020 12:23:26 +0200 Subject: [PATCH 18/76] FIX missing fk_bank during export of suppliers invoices --- htdocs/core/modules/modFournisseur.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index e5ce01e3c72..4b7c8ff3ed2 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -418,7 +418,7 @@ class modFournisseur extends DolibarrModules 's.tva_intra'=>'VATIntra','f.rowid'=>"InvoiceId",'f.ref'=>"InvoiceRef",'f.ref_supplier'=>"RefSupplier",'f.datec'=>"InvoiceDateCreation", 'f.datef'=>"DateInvoice",'f.total_ht'=>"TotalHT",'f.total_ttc'=>"TotalTTC",'f.total_tva'=>"TotalVAT",'f.paye'=>"InvoicePaid", 'f.fk_statut'=>'InvoiceStatus','f.note_public'=>"InvoiceNote",'p.rowid'=>'PaymentId','pf.amount'=>'AmountPayment', - 'p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' + 'p.datep'=>'DatePayment','p.num_paiement'=>'PaymentNumber','p.fk_bank'=>'IdTransaction','project.rowid'=>'ProjectId','project.ref'=>'ProjectRef','project.title'=>'ProjectLabel' ); //$this->export_TypeFields_array[$r]=array( // 's.rowid'=>"List:societe:CompanyName",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text', @@ -430,14 +430,14 @@ class modFournisseur extends DolibarrModules 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','c.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text', 's.idprof4'=>'Text','s.tva_intra'=>'Text','f.ref'=>"Text",'f.ref_supplier'=>"Text",'f.datec'=>"Date",'f.datef'=>"Date",'f.total_ht'=>"Numeric", 'f.total_ttc'=>"Numeric",'f.total_tva'=>"Numeric",'f.paye'=>"Boolean",'f.fk_statut'=>'Status','f.note_public'=>"Text",'pf.amount'=>'Numeric', - 'p.datep'=>'Date','p.num_paiement'=>'Numeric','project.ref'=>'Text','project.title'=>'Text' + 'p.datep'=>'Date','p.num_paiement'=>'Numeric','p.fk_bank'=>'Numeric','project.ref'=>'Text','project.title'=>'Text' ); $this->export_entities_array[$r]=array( 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','c.code'=>'company','s.phone'=>'company', 's.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','s.tva_intra'=>'company', 'f.rowid'=>"invoice",'f.ref'=>"invoice",'f.ref_supplier'=>"invoice",'f.datec'=>"invoice",'f.datef'=>"invoice",'f.total_ht'=>"invoice", 'f.total_ttc'=>"invoice",'f.total_tva'=>"invoice",'f.paye'=>"invoice",'f.fk_statut'=>'invoice','f.note_public'=>"invoice",'p.rowid'=>'payment','pf.amount'=>'payment', - 'p.datep'=>'payment','p.num_paiement'=>'payment','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project'); + 'p.datep'=>'payment','p.num_paiement'=>'payment','p.fk_bank'=>'account','project.rowid'=>'project','project.ref'=>'project','project.title'=>'project'); $this->export_dependencies_array[$r]=array('payment'=>'p.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them // Add extra fields object $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'facture_fourn' AND entity IN (0, ".$conf->entity.")"; From 1788b1b252d5da23fe062bbf93ac65c4f362f597 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 12:32:20 +0200 Subject: [PATCH 19/76] Update mo.class.php Use the accuracy of stock for rounding --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 570281ac294..5f753f24443 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -649,7 +649,7 @@ class Mo extends CommonObject if ($line->qty_frozen) { $moline->qty = $line->qty; // Qty to consume does not depends on quantity to produce } else { - $moline->qty = round($line->qty * ($this->qty / $bom->qty) / $line->efficiency, 8); // Calculate with Qty to produce and more presition + $moline->qty = price2num(($line->qty / $bom->qty) * $this->qty / $line->efficiency, 'MS'); // Calculate with Qty to produce and more presition } if ($moline->qty <= 0) { $error++; From 169378f2764ce9b84d09fcc28de73e303b59e458 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 12:34:02 +0200 Subject: [PATCH 20/76] Update mo.class.php --- htdocs/mrp/class/mo.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 5f753f24443..fdfe43f4069 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -591,7 +591,7 @@ class Mo extends CommonObject } /** - * Erase and update the line to produce. + * Erase and update the line to consume and to produce. * * @param User $user User that modifies * @param bool $notrigger false=launch triggers after, true=disable triggers From 9a5986e190ccf2aff13f18564196d4f053c6ea86 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 12:40:11 +0200 Subject: [PATCH 21/76] css --- htdocs/bom/tpl/objectline_edit.tpl.php | 8 ++++++-- htdocs/core/lib/functions.lib.php | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/bom/tpl/objectline_edit.tpl.php b/htdocs/bom/tpl/objectline_edit.tpl.php index 36862e48708..3840f495dea 100644 --- a/htdocs/bom/tpl/objectline_edit.tpl.php +++ b/htdocs/bom/tpl/objectline_edit.tpl.php @@ -128,12 +128,16 @@ $coldisplay++; print ''; print ''; +$coldisplay++; +print ''; +print ''; + $coldisplay += $colspan; print ''; $coldisplay += $colspan; -print ''; +print ''; print '
'; -print ''; +print ''; print ''; print ''; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 16ecae4298b..9e5584bf7ae 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4663,9 +4663,9 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ /** * Function that return a number with universal decimal format (decimal separator is '.') from an amount typed by a user. * Function to use on each input amount before any numeric test or database insert. A better name for this function - * should be text2num(). + * should be roundtext2num(). * - * @param float $amount Amount to convert/clean + * @param float $amount Amount to convert/clean or round * @param string $rounding ''=No rounding * 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT) * 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT) From a5def19cff1021a046eeb84ae8171af5e4a75aeb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 12:56:52 +0200 Subject: [PATCH 22/76] Fix calculation from a BOM > 1 --- htdocs/langs/en_US/mrp.lang | 2 +- htdocs/mrp/class/mo.class.php | 7 ++++++- htdocs/mrp/mo_card.php | 1 + htdocs/mrp/mo_production.php | 2 +- htdocs/mrp/tpl/originproductline.tpl.php | 9 ++++++++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index 4e653e04409..d3591be3f1d 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -60,7 +60,7 @@ ConsumeOrProduce=Consume or Produce ConsumeAndProduceAll=Consume and Produce All Manufactured=Manufactured TheProductXIsAlreadyTheProductToProduce=The product to add is already the product to produce. -ForAQuantityOf1=For a quantity to produce of 1 +ForAQuantityOf=For a quantity to produce of %s ConfirmValidateMo=Are you sure you want to validate this Manufacturing Order? ConfirmProductionDesc=By clicking on '%s', you will validate the consumption and/or production for the quantities set. This will also update the stock and record stock movements. ProductionForRef=Production of %s diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index 84bf44c84fe..1fd60907763 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1268,7 +1268,7 @@ class Mo extends CommonObject print ''; print ''.$langs->trans('Ref').''; - print ''.$langs->trans('Qty').' ('.$langs->trans("ForAQuantityOf1").')'; + print ''.$langs->trans('Qty').' ('.$langs->trans("ForAQuantityOf", $this->bom->qty).')'; print ''.$langs->trans('QtyFrozen').''; print ''.$langs->trans('DisableStockChange').''; //print ''.$langs->trans('Efficiency').''; @@ -1334,6 +1334,11 @@ class Mo extends CommonObject // TODO } + $this->tpl['qty_bom'] = 1; + if (is_object($this->bom) && $this->bom->qty > 1) { + $this->tpl['qty_bom'] = $this->bom->qty; + } + $this->tpl['qty'] = $line->qty; $this->tpl['qty_frozen'] = $line->qty_frozen; $this->tpl['disable_stock_change'] = $line->disable_stock_change; diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index 91f6f75b332..59dd5ed7a7c 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -293,6 +293,7 @@ if ($action == 'create') print ''; $object->lines = $objectbom->lines; + $object->bom = $objectbom; $object->printOriginLinesList('', array()); diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 70e248eaf3a..f1e847a6213 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -691,7 +691,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; print ''; if ($conf->productbatch->enabled) { print ''; diff --git a/htdocs/mrp/tpl/originproductline.tpl.php b/htdocs/mrp/tpl/originproductline.tpl.php index abe5dfdb427..6f3b63f6d4e 100644 --- a/htdocs/mrp/tpl/originproductline.tpl.php +++ b/htdocs/mrp/tpl/originproductline.tpl.php @@ -24,13 +24,20 @@ if (empty($conf) || !is_object($conf)) } if (!is_object($form)) $form = new Form($db); + +$qtytoconsumeforline = $this->tpl['qty'] / $this->tpl['efficiency']; +/*if ((empty($this->tpl['qty_frozen']) && $this->tpl['qty_bom'] > 1)) { + $qtytoconsumeforline = $qtytoconsumeforline / $this->tpl['qty_bom']; +}*/ +$qtytoconsumeforline = price2num($qtytoconsumeforline, 'MS'); + ?> tpl['strike']) ? '' : ' strikefordisabled').'">'; print ''; -print ''; +print ''; print ''; print ''; //print ''; From 22162ac57e8aab005305bde181c84d373790ad1e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 13:14:50 +0200 Subject: [PATCH 23/76] Fix rounding of quantities --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 0e7433677ed..d42beadf791 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -229,6 +229,7 @@ ALTER TABLE llx_product_batch MODIFY COLUMN batch varchar(128); ALTER TABLE llx_commande_fournisseur_dispatch MODIFY COLUMN batch varchar(128); ALTER TABLE llx_stock_mouvement MODIFY COLUMN batch varchar(128); ALTER TABLE llx_mrp_production MODIFY COLUMN batch varchar(128); +ALTER TABLE llx_mrp_production MODIFY qty real NOT NULL DEFAULT 1; create table llx_categorie_website_page ( From 3588ae8792e6c937039320667f71f3d03ae67f1d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 13:47:33 +0200 Subject: [PATCH 24/76] Complete rules for PR --- .github/CONTRIBUTING.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5e56ac2a1fc..eb50ed3a3eb 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -104,27 +104,28 @@ Long description (Can span accross multiple lines). Pull Request (PR) process is the process to submit a change (enhancement, bug fix, ...) into the code of the project. There is some rules to know and a process to follow to optimize the chance to have PRs merged efficiently... -When submitting a pull request, use same rule as [Commits](#commits) for the message. -If your pull request only contains 1 commit, GitHub will be smart enough to fill it for you. -Otherwise, please be a bit verbose about what you're providing. +* A PR must be atomic. It means it must contains the lower possible changes for 1 need (1 bug fix or 1 new feature) without breaking usability of code. If a PR can be split into several PRs, it means your PR is not atomic. + +* Your Pull Request (PR) must pass the Continuous Integration checks and code quality checks. + +* When submitting a pull request, use same rule as [Commits](#commits) for the message. If your pull request only contains 1 commit, GitHub will be smart enough to fill it for you. Otherwise, please be a bit verbose about what you're providing. -Your Pull Request (PR) must pass the Continuous Integration checks and code quality checks. Also, some code changes need a prior approbation: -* if you want to include a new external library (into htdocs/includes directory), please ask before to the project manager (@eldy) to see if such a library can be accepted. +* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-jedi in your issue) to see if such a library can be accepted. -* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@eldy) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest. +* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@dolibarr-jedi) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest. Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case). -If the label of PR start with "WIP" (Work In Progress), it will not be analyzed (until you change the label of PR). +If the label of PR start with "Draft" or "WIP" (Work In Progress), it will not be analyzed for merging until you change the label of PR (but it can be analyzed for discussion). If your PR has errors reported by the Continuous Integration Platform, it means your PR is not valid and nothing will be done with it. It will be kept open to allow developers to fix this, or it may be closed several month later. Don't expect anything on your PR if you have such errors, you MUST first fix the Continuous Integration error to have it taken into consideration. If the PR is valid, and is kept open for a long time, a tag will also be added on the PR to describe the status of your PR and why the PR is kept open. By putting your mouse on the tag, you will get a full explanation of the tag/status that explain why your PR has not been integrated yet. In most cases, it gives you information of things you have to do to have the PR taken into consideration (for example a change is requested, a conflict is expected to be solved, some questions were asked). If you have a yellow, red flag of purple flag, don't expect to have your PR validated. You must first provide the answer the tag ask you. The majority of open PR are waiting an action of the author of the PR. -Statistics on Dolibarr project shows that around 95% of submitted PR are reviewed and tagged. Average answer delay is also one of the best among Open source project (just few days before having the Answer Tag set). This is one of the most important ratio of answered PR in Open Source world for a major project. Don't expect the core team to reach the 100%. A so high ratio is very rare on a so popular project and with the increasing popularity of Dolibarr, this ratio will probably decrease in future to a more common level. +Statistics on Dolibarr project shows that 95% of submitted PR are reviewed and tagged. Average answer delay is also one of the best among Open source projects (just few days before having the Answer Tag set). This is one of the most important ratio of answered PR in Open Source world for a major project. Don't expect the core team to reach the 100%. A so high ratio is very rare on a so popular project and with the increasing popularity of Dolibarr, this ratio will probably decrease in future to a more common level. ### Resources From 0b6d1a29c5c5048678ce2b1b28cfc02eb0af13fb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 13:48:47 +0200 Subject: [PATCH 25/76] Fix links --- .github/CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index eb50ed3a3eb..e8e2d222c0e 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -4,7 +4,7 @@ How to contribute to Dolibarr Bug reports and feature requests -------------------------------- -*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](http://www.dolibarr.org/forum). +*Note*: Issues are not a support forum. If you need help using the software, please use [the forums](https://www.dolibarr.org/forum). Issues are managed on [GitHub](https://github.com/Dolibarr/dolibarr/issues). @@ -129,7 +129,7 @@ Statistics on Dolibarr project shows that 95% of submitted PR are reviewed and t ### Resources -[Developer documentation](http://wiki.dolibarr.org/index.php/Developer_documentation) +[Developer documentation](https://wiki.dolibarr.org/index.php/Developer_documentation) Translations ------------ @@ -145,11 +145,11 @@ to retreive all old translation of a source text, and restore the translation in ### Resources -[Translator documentation](http://wiki.dolibarr.org/index.php/Translator_documentation) +[Translator documentation](https://wiki.dolibarr.org/index.php/Translator_documentation) Documentation ------------- -The project's documentation is maintained on the [Wiki](http://wiki.dolibarr.org/index.php). +The project's documentation is maintained on the [Wiki](https://wiki.dolibarr.org/index.php). *Note*: to help prevent spam, you need to create an account before being able to edit. Everybody is welcome to contribute to its content. From 1ed66bfe8909a6ca60f52984dddfd595881d871d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 13:51:23 +0200 Subject: [PATCH 26/76] Fix bad tag --- .github/CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e8e2d222c0e..39234ebb181 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -112,9 +112,9 @@ a process to follow to optimize the chance to have PRs merged efficiently... Also, some code changes need a prior approbation: -* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-jedi in your issue) to see if such a library can be accepted. +* if you want to include a new external library (into htdocs/includes directory), please ask before to the core project manager (mention @dolibarr-yoda in your issue) to see if such a library can be accepted. -* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@dolibarr-jedi) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest. +* if you add a new table, you must first create a page on https://wiki.dolibarr.org/index.php/Category:Table_SQL (copy an existing page changing its name to see it into this index page). Then ask the project manager (@dolibarr-yoda) if the new data model you plan to add is compatible with curent and future works in progress and can be accepted as you suggest. Once a PR has been submitted, you may need to wait for its integration. It is common that the project leader let the PR open for a long delay to allow every developer discuss about the PR (A label is added in such a case). From e5d3250e47c1fa51e0edc05ba20a2e28ed4f8b1c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 14:09:52 +0200 Subject: [PATCH 27/76] Doc --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 39234ebb181..fed73d7b002 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -104,7 +104,7 @@ Long description (Can span accross multiple lines). Pull Request (PR) process is the process to submit a change (enhancement, bug fix, ...) into the code of the project. There is some rules to know and a process to follow to optimize the chance to have PRs merged efficiently... -* A PR must be atomic. It means it must contains the lower possible changes for 1 need (1 bug fix or 1 new feature) without breaking usability of code. If a PR can be split into several PRs, it means your PR is not atomic. +* A PR must be atomic. It means it must contains the lower possible changes for 1 need (1 bug fix or 1 new feature) without breaking usability of code. If a PR can be split into several PRs, it often means your PR is not atomic. * Your Pull Request (PR) must pass the Continuous Integration checks and code quality checks. From 4777c74366321f56bffaa7bdad18891fc2755bb1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 14:11:03 +0200 Subject: [PATCH 28/76] Update main.inc.php --- htdocs/main.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 73c21459b5c..481fffbfef6 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2367,7 +2367,7 @@ function main_area($title = '') if (!empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode", $conf->global->MAIN_ONLY_LOGIN_ALLOWED)); // Permit to add user company information on each printed document by set SHOW_SOCINFO_ON_PRINT - if ($conf->global->SHOW_SOCINFO_ON_PRINT && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) + if (! empty($conf->global->SHOW_SOCINFO_ON_PRINT) && GETPOST('optioncss', 'aZ09') == 'print' && empty(GETPOST('disable_show_socinfo_on_print', 'az09'))) { global $hookmanager; $hookmanager->initHooks(array('showsocinfoonprint')); From 63186a60ae84f394854c638033d5bf1a14d5f082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Apr 2020 14:23:38 +0200 Subject: [PATCH 29/76] Update 11.0.0-12.0.0.sql --- .../install/mysql/migration/11.0.0-12.0.0.sql | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index d42beadf791..9c09b8b9247 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -42,6 +42,15 @@ ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA'; +create table if not exists llx_c_shipment_package_type +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + label varchar(50) NOT NULL, -- Short name + description varchar(255), -- Description + active integer DEFAULT 1 NOT NULL, -- Active or not + entity integer DEFAULT 1 NOT NULL -- Multi company id +)ENGINE=innodb; + -- For v12 @@ -253,11 +262,3 @@ ALTER TABLE llx_categorie ADD COLUMN fk_user_modif integer; ALTER TABLE llx_commandedet ADD CONSTRAINT fk_commandedet_fk_commandefourndet FOREIGN KEY (fk_commandefourndet) REFERENCES llx_commande_fournisseurdet (rowid); --Dictionary of package type because filename in V11 was incomplete -create table llx_c_shipment_package_type -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - label varchar(50) NOT NULL, -- Short name - description varchar(255), -- Description - active integer DEFAULT 1 NOT NULL, -- Active or not - entity integer DEFAULT 1 NOT NULL -- Multi company id -)ENGINE=innodb; From 43f4c5ac962d3a99b33f9cab2410c6d323a8a411 Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 22 Apr 2020 15:29:54 +0200 Subject: [PATCH 30/76] FIX : model export list must be sorted by label --- htdocs/core/class/html.formother.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 9556fd6c423..cf3cd58355c 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -75,7 +75,7 @@ class FormOther $sql.= " FROM ".MAIN_DB_PREFIX."export_model"; $sql.= " WHERE type = '".$type."'"; if (!empty($fk_user)) $sql.=" AND fk_user IN (0, ".$fk_user.")"; // An export model - $sql.= " ORDER BY rowid"; + $sql.= " ORDER BY label"; $result = $this->db->query($sql); if ($result) { From f2356aa15836b8464d663dd326d84b18abf8f68c Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Wed, 22 Apr 2020 15:37:01 +0200 Subject: [PATCH 31/76] Update README.md --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fbf59a27a74..3f329c678a7 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Dolibarr ERP & CRM is a modern software package to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda…). -It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelances. +It's an Open Source Software (written in PHP language) designed for small, medium or large companies, foundations and freelancers. You can freely use, study, modify or distribute it according to its Free Software licence. @@ -27,7 +27,7 @@ Other licenses apply for some included dependencies. See [COPYRIGHT](https://git If you have low technical skills and you're looking to install Dolibarr ERP/CRM in just a few clicks, you can use one of the packaged versions: -- DoliWamp for Windows +- [DoliWamp for Windows](https://wiki.dolibarr.org/index.php/Dolibarr_for_Windows_(DoliWamp) - DoliDeb for Debian or Ubuntu - DoliRpm for Redhat, Fedora, OpenSuse, Mandriva or Mageia @@ -67,6 +67,7 @@ You can use a Web server and a supported database (MariaDB, MySQL or PostgreSQL) If you don't have time to install it yourself, you can try some commercial 'ready to use' Cloud offers (See https://saas.dolibarr.org). However, this third solution is not free. + ## UPGRADING - At first make a backup of your Dolibarr files & than see https://wiki.dolibarr.org/index.php/Installation_-_Upgrade#Upgrade_Dolibarr @@ -85,28 +86,27 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) ### Main application/modules (all optional) -- Customers, Prospects (Leads) and/or Suppliers directory +- Customers, Prospects (Leads) and/or Suppliers directory + Contacts +- Members management - Products and/or Services catalog - Commercial proposals management -- Customer and Supplier Orders management +- Customer & Supplier Orders management +- Shipping management +- Warehouse/Stock management - Invoices and payment management - Standing orders management (European SEPA) - Bank accounts management - Accounting management - Shared calendar/agenda (with ical and vcal export for third party tools integration) - Opportunities and/or project management -- Projects management +- Projects & Tasks management - Contracts management -- Warehouse/Stock management -- Shipping management - Interventions management - Employee's leave requests management - Expense reports - Timesheets - Electronic Document Management (EDM) - Foundations members management -- Mass emailing -- Surveys - Point of Sale (POS) - … @@ -115,11 +115,13 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) - Bookmarks management - Donations management - Reporting +- Surveys - Data export/import - Barcodes support - Margin calculations - LDAP connectivity - ClickToDial integration +- Mass emailing - RSS integration - Skype integration - Payment platforms integration (PayPal, Stripe, Paybox...) From eee9e79436d0cee7328b889e59906d06b80c247a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 16:35:25 +0200 Subject: [PATCH 32/76] Tooltip --- htdocs/bom/tpl/objectline_title.tpl.php | 2 +- htdocs/langs/en_US/mrp.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/bom/tpl/objectline_title.tpl.php b/htdocs/bom/tpl/objectline_title.tpl.php index b6197342136..ab0184189a8 100644 --- a/htdocs/bom/tpl/objectline_title.tpl.php +++ b/htdocs/bom/tpl/objectline_title.tpl.php @@ -52,7 +52,7 @@ if (!empty($conf->global->MAIN_VIEW_LINE_NUMBER)) print ''; // Qty -print ''; +print ''; if ($conf->global->PRODUCT_USE_UNITS) { diff --git a/htdocs/langs/en_US/mrp.lang b/htdocs/langs/en_US/mrp.lang index d3591be3f1d..d3c4d3253c6 100644 --- a/htdocs/langs/en_US/mrp.lang +++ b/htdocs/langs/en_US/mrp.lang @@ -56,6 +56,7 @@ ToConsume=To consume ToProduce=To produce QtyAlreadyConsumed=Qty already consumed QtyAlreadyProduced=Qty already produced +QtyRequiredIfNoLoss=Qty required if there is no loss (Manufacturing efficiency is 100%%) ConsumeOrProduce=Consume or Produce ConsumeAndProduceAll=Consume and Produce All Manufactured=Manufactured From 8207d27d00237335430421ff265c9eb6edac2a0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Wed, 22 Apr 2020 17:36:10 +0200 Subject: [PATCH 33/76] Update MyCatalan.isl --- build/exe/doliwamp/Languages/MyCatalan.isl | 54 +++++++++++----------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/build/exe/doliwamp/Languages/MyCatalan.isl b/build/exe/doliwamp/Languages/MyCatalan.isl index d8b86eae5ba..b157d1cea27 100644 --- a/build/exe/doliwamp/Languages/MyCatalan.isl +++ b/build/exe/doliwamp/Languages/MyCatalan.isl @@ -1,45 +1,47 @@ [CustomMessages] -NameAndVersion=%1 versió %2 +NameAndVersion=%1 versió %2 AdditionalIcons=Icones addicionals: CreateDesktopIcon=Crea una icona a l'&Escriptori CreateQuickLaunchIcon=Crea una icona a la &Barra de tasques ProgramOnTheWeb=%1 a Internet -UninstallProgram=Desinstal·la %1 +UninstallProgram=Desinstal·la %1 LaunchProgram=Obre %1 -AssocFileExtension=&Associa %1 amb l'extensió de fitxer %2 -AssocingFileExtension=Associant %1 amb l'extensió de fitxer %2... +AssocFileExtension=&Associa %1 amb l'extensió de fitxer %2 +AssocingFileExtension=Associant %1 amb l'extensió de fitxer %2... -YouWillInstallDoliWamp=Va a instal·lar o actualitzar (Apache + Mysql + PHP + Dolibarr) al seu ordinador. -ThisAssistantInstallOrUpgrade=Aquest assistent instal·la o actualitza Dolibarr ERP-CRM i tots els seus requisits (Apache, Mysql i PHP) optimitzats per a l'ús de Dolibarr. -IfYouHaveTechnicalKnowledge=Si teniu coneixements tècnics i necessita usar la seva Apache, Mysql i PHP amb altres aplicacions a part de Dolibarr, no utilitzeu aquest assistent, hauria lació manual d'Dolibarr sobre un Apache, Mysql i PHP existent. -ButIfYouLook=Però si busca una instal·lació automàtica, es troba en el bon camí... -DoYouWantToStart=Vol iniciar el procés d'instal·lació/actualització? +YouWillInstallDoliWamp=Instal·laràs DoliWamp (Dolibarr i altres programaris com Apache, Mysql i PHP) al teu ordinador. +ThisAssistantInstallOrUpgrade=ALERTA: Utilitzar un ERP CRM instal·lat en un ordinador en local pot ser perillós: si l'ordinador s'espatlla, pots perdre totes les teves dades. Fes-ho si estàs preparat per autogestionar-te còpies de seguretat. Si no, pots utilitzar una instal·lació Saas (pots veure https://saas.dolibarr.org). +IfYouHaveTechnicalKnowledge=Si tens coneixements tècnics i vols autogestionar el teu Apache, Mysql i PHP, no utilitzis aquest assistent i fes una instal·lació manual de Dolibarr sobre un servidor existent d'Apache, Mysql i PHP. +ButIfYouLook=Però si busques una instal·lació automàtica en el teu propi ordinador, et trobes en el bon camí... +DoYouWantToStart=Vols iniciar el procés d'instal·lació? -TechnicalParameters=Paràmetres tècnics -IfFirstInstall=Si es tracta de la primera instal lació, haurà d'especificar alguns paràmetres tècnics. Si no els entén, no sabeu o va a procedir a una actualització, deixi els camps amb els valors proposats per defecte. +TechnicalParameters=Paràmetres tècnics +IfFirstInstall=Si es tracta de la primera instal·lació, hauràs d'especificar alguns paràmetres tècnics. Si no els entens, no n'estàs segur, o estàs fent una actualització, pots deixar els valors per defecte. -; WARNING !!! STRINGS HERE MUST BE LOWER THAN 70 CHARACTERS -SMTPServer=Servidor SMTP (El seu o el del seu ISP, únicament primera instal.lació) : -ApachePort=Puerto Apache (únicament primera instal.lació, normalment és el 80) : -MySqlPort=Puerto Mysql (únicament primera instal.lació, normalment és el 3306) : -MySqlPassword=Contrasenya del servidor i la base de dades MySQL de root (únicament primera instal.lació): +; WARNING !!! STRINGS HERE MUST BE LOWER THAN 60 CHARACTERS +SMTPServer=Servidor SMTP (propi o ISP, només primera instal·lació) : +ApachePort=Port Apache (només primera instal·lació, normalment el 80) : +MySqlPort=Port MySql (només primera instal·lació, normalment el 3306) : +MySqlPassword=Contrasenya del servidor i base de dades MySql de root (només primera instal·lació): -FailedToDeleteLock=FailedToDeleteLock=Error en l'eliminació del fitxer %1/www/dolibarr/install.lock. Pot ignorar l'avís però és possible que hagi de eliminar-lo manualment més tard. En aquest cas, serà informat. Feu clic a OK per continuar... +FailedToDeleteLock=FailedToDeleteLock=Error en l'eliminació del fitxer %1/www/dolibarr/install.lock. Pots ignorar l'avís però és possible que hagis d'eliminar-lo manualment més tard. En aquest cas, serà informat. Fes clic a OK per continuar... -PortAlreadyInUse=Sembla que el port %1 ja està sent utilitzat. Es recomana cancel·lar, tornar enrere i especificar un altre valor per al port% 2. Cancel·lar i escollir un altre valor? +PortAlreadyInUse=Sembla que el port %1 ja està sent utilitzat. Es recomana cancel·lar, tornar enrere i especificar un altre valor per al port% 2. Vols cancel·lar i escollir un altre valor? -FirefoxDetected=S'ha detectat Firefox al seu ordinador. Voleu activar per defecte com a navegador per Dolibarr? -ChromeDetected=S'ha detectat Chrome al seu ordinador. Voleu activar per defecte com a navegador per Dolibarr? -ChooseDefaultBrowser=Esculli el seu navegador per defecte. Si no està segur, simplement feu clic a Obrir: +FirefoxDetected=S'ha detectat Firefox al teu ordinador. El vols utilitzar com a navegador per defecte per Dolibarr? +ChromeDetected=S'ha detectat Chrome al teu ordinador. El vols utilitzar com a navegador per defecte per Dolibarr? +ChooseDefaultBrowser=Escull el teu navegador per defecte (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...).. Si no estàs segur, simplement fes clic a Obre: -LaunchNow=Llançar ara Dolibarr +LaunchNow=Obre ara el Dolibarr -ProgramHasBeenRemoved=Els arxius del programa Dolibarr han estat eliminats. No obstant això tots els seus arxius de dades es troben encara al directori %1. Haurà eliminar aquest directori manualment per a una desinstal completa. +ProgramHasBeenRemoved=Els arxius del programa Dolibarr han estat eliminats. No obstant això tots els seus arxius de dades es troben encara al directori %1. Hauràs d'eliminar aquest directori manualment per a una desinstal·lació completa. -DoliWampWillStartApacheMysql=L'instal·lador DoliWamp intentarà iniciar o reiniciar Apache i MySQL, això pot durar des de diversos segons a un minut després de la confirmació. Iniciar la instal·lació o actualització dels servidors web i bases de dades requerides per Dolibarr? +DoliWampWillStartApacheMysql=L'instal·lador DoliWamp intentarà iniciar o reiniciar Apache i MySQL, això pot durar des de diversos segons a un minut després de la confirmació. Vols iniciar la instal·lació o actualització dels servidors web i de base de dades requerides per Dolibarr? -OldVersionFoundAndMoveInNew=S'ha trobat una versió antiga de base de dades i ha estat moguda per a ser utilitzada per la nova versió de Dolibarr -OldVersionFoundButFailedToMoveInNew=S'ha trobat una versió antiga de base de dades, però no es pot moure per a ser utilitzada per la nova versió de Dolibarr +OldVersionFoundAndMoveInNew=S'ha trobat una versió antiga de base de dades i ha estat moguda per a ser utilitzada per la nova versió de Dolibarr +OldVersionFoundButFailedToMoveInNew=S'ha trobat una versió antiga de base de dades, però no es pot moure per a ser utilitzada per la nova versió de Dolibarr +DLLMissing=La teva instal·lació windows no té el component "Microsoft Visual C++ Redistributable for Visual Studio 2012". Instal·la primer la versió de 32-bit (vcredist_x86.exe) (pots trobar-la a https://www.microsoft.com/en-us/download/) i reiniciar després la instal·lació/actualització de DoliWamp. +ContinueAnyway=Continua igualment (el procés d'instal·lació podria fallar sense aquest prerequisit) From 3f071462ab7c81a4cb19e0d6eb9803fbc1d972ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Wed, 22 Apr 2020 17:50:15 +0200 Subject: [PATCH 34/76] Update MySpanish.isl --- build/exe/doliwamp/Languages/MySpanish.isl | 50 +++++++++++----------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/build/exe/doliwamp/Languages/MySpanish.isl b/build/exe/doliwamp/Languages/MySpanish.isl index 63c0136f351..c31aedf895f 100644 --- a/build/exe/doliwamp/Languages/MySpanish.isl +++ b/build/exe/doliwamp/Languages/MySpanish.isl @@ -1,45 +1,47 @@ [CustomMessages] -NameAndVersion=%1 versión %2 +NameAndVersion=%1 versión %2 AdditionalIcons=Iconos adicionales: CreateDesktopIcon=Crear un icono en el &escritorio -CreateQuickLaunchIcon=Crear un icono de Inicio Rápido +CreateQuickLaunchIcon=Crear un icono de Inicio Rápido ProgramOnTheWeb=%1 en la Web UninstallProgram=Desinstalar %1 LaunchProgram=Ejecutar %1 -AssocFileExtension=&Asociar %1 con la extensión de archivo %2 -AssocingFileExtension=Asociando %1 con la extensión de archivo %2... +AssocFileExtension=&Asociar %1 con la extensión de archivo %2 +AssocingFileExtension=Asociando %1 con la extensión de archivo %2... -YouWillInstallDoliWamp=Va a instalar o actualizar (Apache+Mysql+PHP+Dolibarr) en su ordenador. -ThisAssistantInstallOrUpgrade=Este asistente instala o actualiza Dolibarr ERP-CRM y todos sus requisitos (Apache, Mysql y PHP) optimizados para el uso de Dolibarr. -IfYouHaveTechnicalKnowledge=Si tiene conocimientos técnicos y necesita usar su Apache, Mysql y PHP con otras aplicaciones aparte de Dolibarr, no debería usar este asistente, debería realizar una instalación manual de Dolibarr sobre un Apache, Mysql y PHP existente. -ButIfYouLook=Pero si busca una instalación automática, se encuentra en el buen camino... -DoYouWantToStart=¿Quiere iniciar el proceso de instalación/actualización? +YouWillInstallDoliWamp=Va a instalar DoliWamp (Dolibarr y otro software como Apache, Mysql y PHP) en su ordenador. +ThisAssistantInstallOrUpgrade=ALERTA: Utilizar un ERP CRM instalado en un ordenador en local puede ser peligroso: si el ordenador se estropea, puede perder todos sus datos. Hágalo si está preparado para autogestionar sus copias de seguridad. Si no, puede utilizar una instalacion Saas (puede ver https://saas.dolibarr.org). +IfYouHaveTechnicalKnowledge=Si tiene conocimientos técnicos y necesita usar su Apache, Mysql y PHP con otras aplicaciones aparte de Dolibarr, no debería usar este asistente, debería realizar una instalación manual de Dolibarr sobre un Apache, Mysql y PHP existente. +ButIfYouLook=Pero si busca una instalación automática en tu propio ordenador, se encuentra en el buen camino... +DoYouWantToStart=¿Quiere iniciar el proceso de instalación? -TechnicalParameters=Parámetros técnicos -IfFirstInstall=Si se trata de la primera instalación, deberá especificar algunos parámetros técnicos. Si no los entiende, no está seguro o va a proceder a una actualización, deje los campos con los valores propuestos por defecto. +TechnicalParameters=Parámetros técnicos +IfFirstInstall=Si se trata de la primera instalación, deberá especificar algunos parámetros técnicos. Si no los entiende, no está seguro o va a proceder a una actualización, deje los campos con los valores propuestos por defecto. -; WARNING !!! STRINGS HERE MUST BE LOWER THAN 70 CHARACTERS -SMTPServer=Servidor SMTP (El suyo o el de su ISP, únicamente primera instalación) : -ApachePort=Puerto Apache (únicamente primera instalación, normalmente es el 80) : -MySqlPort=Puerto Mysql (únicamente primera instalación, normalmente es el 3306) : -MySqlPassword=Contraseña del servidor y la base de datos MySQL de root (únicamente primera instalación): +; WARNING !!! STRINGS HERE MUST BE LOWER THAN 60 CHARACTERS +SMTPServer=Servidor SMTP (propio o su ISP, sólo primera instalación) : +ApachePort=Puerto Apache (sólo primera instalación, normalmente el 80) : +MySqlPort=Puerto Mysql (sólo primera instalación, normalmente el 3306) : +MySqlPassword=Contraseña del servidor y la base de datos MySQL de root (sólo primera instalación): -FailedToDeleteLock=Error en la eliminación del archivo %1/www/dolibarr/install.lock. Puede ignorar el aviso pero es posible que deba eliminarlo manualmente más tarde. En este caso, será informado. Haga clic en OK para continuar... +FailedToDeleteLock=Error en la eliminación del archivo %1/www/dolibarr/install.lock. Puede ignorar el aviso pero es posible que deba eliminarlo manualmente más tarde. En este caso, será informado. Haga clic en OK para continuar... -PortAlreadyInUse=Parece que el puerto %1 ya esta siendo usado. Se recomienda cancelar, volver atras y especificar otro valor para el puerto %2. ¿Cancelar y escojer otro valor? +PortAlreadyInUse=Parece que el puerto %1 ya esta siendo usado. Se recomienda cancelar, volver atras y especificar otro valor para el puerto %2. ¿Cancelar y escojer otro valor? FirefoxDetected=Se ha detectado Firefox en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ? ChromeDetected=Se ha detectado Chrome en su ordenador. Desea activarlo por defecto como navegador para Dolibarr ? -ChooseDefaultBrowser=Escoja su navegador por defecto. Si no está seguro, simplementa haga clic en Abrir : +ChooseDefaultBrowser=Escoja su navegador por defecto (iexplore.exe, firefox.exe, chrome.exe, MicrosoftEdge.exe...). Si no está seguro, simplementa haga clic en Abrir : LaunchNow=Lanzar ahora Dolibarr -ProgramHasBeenRemoved=Los archivos del programa Dolibarr han sido eliminados. Sin embargo todos sus archivos de datos se encuentran todavía en el directorio %1. Deberá eliminar este directorio manualmente para una desinstalación completa. +ProgramHasBeenRemoved=Los archivos del programa Dolibarr han sido eliminados. Sin embargo todos sus archivos de datos se encuentran todavía en el directorio %1. Deberá eliminar este directorio manualmente para una desinstalación completa. -DoliWampWillStartApacheMysql=El instalador DoliWamp intentará iniciar o reiniciar Apache y MySQL, esto puede durar desde varios segundos a un minuto después de la confirmación. ¿Iniciar la instalación o actualización de los servidores Web y bases de datos requeridas por Dolibarr? +DoliWampWillStartApacheMysql=El instalador DoliWamp intentará iniciar o reiniciar Apache y MySQL, esto puede durar desde varios segundos a un minuto después de la confirmación. ¿Iniciar la instalación o actualización de los servidores Web y bases de datos requeridas por Dolibarr? -OldVersionFoundAndMoveInNew=Se ha encontrado una versión antigua de base de datos y ha sido movida para ser utilizada por la nueva versión de Dolibarr -OldVersionFoundButFailedToMoveInNew=Se ha encontrado una versión antigua de base de datos, pero no se pudo mover para ser utilizada por la nueva versión de Dolibarr - \ No newline at end of file +OldVersionFoundAndMoveInNew=Se ha encontrado una versión antigua de base de datos y ha sido movida para ser utilizada por la nueva versión de Dolibarr +OldVersionFoundButFailedToMoveInNew=Se ha encontrado una versión antigua de base de datos, pero no se pudo mover para ser utilizada por la nueva versión de Dolibarr + +DLLMissing=Su instalación Windows no tiene el componente "Microsoft Visual C++ Redistributable for Visual Studio 2012". Instale primero la versión de 32-bit (vcredist_x86.exe) (puedes encontrarlo en https://www.microsoft.com/en-us/download/) y reiniciar después la instalación/actualización de DoliWamp. +ContinueAnyway=Continua igualmente (el proceso de instalación podría fallar sin este prerequisito) From 496d8f354f83d7c03d22b6cf8bfda2a27acfaed2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 17:59:54 +0200 Subject: [PATCH 35/76] Look and feel v12 --- htdocs/admin/accountant.php | 2 +- htdocs/admin/company.php | 2 +- htdocs/contact/card.php | 78 +++++++++++++------- htdocs/core/class/commonobject.class.php | 2 +- htdocs/core/lib/functions.lib.php | 15 ++-- htdocs/core/tpl/objectline_view.tpl.php | 14 +++- htdocs/langs/en_US/main.lang | 1 + htdocs/product/stock/card.php | 23 ++++-- htdocs/product/stock/movement_list.php | 4 +- htdocs/societe/card.php | 2 + htdocs/theme/eldy/global.inc.php | 4 +- htdocs/theme/eldy/main_menu_fa_icons.inc.php | 2 +- 12 files changed, 98 insertions(+), 51 deletions(-) diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php index 7a436c5a363..c8c082db6ae 100644 --- a/htdocs/admin/accountant.php +++ b/htdocs/admin/accountant.php @@ -128,7 +128,7 @@ print ''."\n"; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 3229eda7365..d4664a13de1 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -429,7 +429,7 @@ print ''."\n"; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index cecc7867b0f..ce948211c46 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -691,6 +691,7 @@ else // Country print ''; @@ -722,24 +723,34 @@ else if (($objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->fax)) == 0) $object->fax = $objsoc->fax; // Predefined with third party // Phone / Fax - print ''; - print ''; + print ''; + print ''; if ($conf->browser->layout == 'phone') print ''; - print ''; - print ''; + print ''; + print ''; - print ''; - print ''; + print ''; + print ''; if ($conf->browser->layout == 'phone') print ''; - print ''; - print ''; + print ''; + print ''; print ''; if (($objsoc->typent_code == 'TE_PRIVATE' || !empty($conf->global->CONTACT_USE_COMPANY_ADDRESS)) && dol_strlen(trim($object->email)) == 0) $object->email = $objsoc->email; // Predefined with third party // Email - print ''; - print ''; + print ''; + print ''; print ''; if (!empty($conf->mailing->enabled)) @@ -964,12 +975,12 @@ else // Lastname print ''; - print ''; + print ''; print ''; print ''; // Firstname print ''; - print ''; + print ''; print ''; // Company @@ -988,13 +999,13 @@ else print ''; print ''; - print ''; + print ''; // Address print ''; print ''; // Country print ''; @@ -1029,19 +1041,29 @@ else } // Phone - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; // EMail - print ''; - print ''; + print ''; + print ''; if (!empty($conf->mailing->enabled)) { $langs->load("mails"); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 7bbf7b6475c..20dbdf18fd3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -667,7 +667,7 @@ abstract class CommonObject $namecoords .= $this->getFullName($langs, 1).'
'.$coords; // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile $out .= ''; - $out .= img_picto($langs->trans("Address"), 'object_address.png'); + $out .= img_picto($langs->trans("Address"), 'map-marker-alt'); $out .= ' '; } $out .= dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', '); $outdone++; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9e5584bf7ae..94e9af511ea 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3143,8 +3143,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', 'address', 'bank_account', 'barcode', 'bank', 'bookmark', 'bom', 'building', 'cash-register', 'check', 'close_title', 'company', 'contact', 'cubes', 'delete', 'dolly', 'dollyrevert', 'edit', 'ellipsis-h', 'external-link-alt', 'external-link-square-alt', - 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'lot', - 'money-bill-alt', 'mrp', 'note', 'stock', + 'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'help', 'language', 'list', 'listlight', 'lot', + 'map-marker-alt', 'money-bill-alt', 'mrp', 'note', 'stock', 'object_accounting', 'object_action', 'object_account', 'object_barcode', 'object_bom', 'object_category', 'object_bookmark', 'object_bug', 'object_dolly', 'object_dollyrevert', 'object_generic', 'object_folder', 'object_list-alt', 'object_calendar', 'object_calendarweek', 'object_calendarmonth', 'object_calendarday', 'object_calendarperuser', @@ -3153,10 +3153,10 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'object_lot', 'object_mrp', 'object_payment', 'object_product', 'object_propal', 'object_supplier_proposal', 'object_service', 'object_stock', 'object_paragraph', 'object_poll', 'object_printer', 'object_project', 'object_projectpub', 'object_propal', 'object_resource', 'object_rss', 'object_projecttask', 'object_technic', 'object_ticket', 'object_trip', 'object_user', 'object_group', 'object_member', 'object_other', - 'object_phoning', 'object_phoning_fax', 'object_email', + 'object_phoning', 'object_phoning_mobile', 'object_phoning_fax', 'object_email', 'off', 'on', 'paiment', 'play', 'playdisabled', 'poll', 'printer', 'product', 'propal', 'resize', 'service', 'stats', 'trip', - 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'globe', + 'note', 'setup', 'sign-out', 'split', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'wrench', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp', 'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'home', 'companies', 'products', 'commercial', 'invoicing', 'accountancy', 'preview', 'project', 'projectpub', 'hrm', 'members', 'ticket', 'generic', @@ -3194,7 +3194,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'other'=>'square', 'playdisabled'=>'play', 'poll'=>'check-double', 'preview'=>'binoculars', 'project'=>'sitemap', 'projectpub'=>'sitemap', 'projecttask'=>'tasks', 'propal'=>'file-signature', 'resize'=>'crop', 'supplier_proposal'=>'file-signature', - 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', + 'payment'=>'money-check-alt', 'phoning'=>'phone', 'phoning_mobile'=>'mobile-alt', 'phoning_fax'=>'fax', 'printer'=>'print', 'product'=>'cube', 'service'=>'concierge-bell', 'resource'=>'laptop-house', 'stock'=>'box-open', 'stats' => 'chart-bar', 'split'=>'code-branch', 'technic'=>'cogs', 'ticket'=>'ticket-alt', 'title_setup'=>'tools', 'title_accountancy'=>'money-check-alt', 'title_bank'=>'university', 'title_hrm'=>'umbrella-beach', @@ -3271,10 +3271,11 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ 'address'=>'#37a', 'building'=>'#37a', 'bom'=>'#a69944', 'companies'=>'#37a', 'company'=>'#37a', 'contact'=>'#37a', 'dynamicprice'=>'#a69944', 'edit'=>'#444', 'note'=>'#999', 'error'=>'', 'listlight'=>'#999', - 'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', + 'dolly'=>'#a69944', 'dollyrevert'=>'#a69944', 'lot'=>'#a69944', + 'map-marker-alt'=>'#aaa', 'mrp'=>'#a69944', 'product'=>'#a69944', 'service'=>'#a69944', 'stock'=>'#a69944', 'other'=>'#ddd', 'playdisabled'=>'#ccc', 'printer'=>'#444', 'projectpub'=>'#986c6a', 'resize'=>'#444', 'rss'=>'#cba', - 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'warning'=>'' + 'stats'=>'#444', 'switch_off'=>'#999', 'uparrow'=>'#555', 'globe-americas'=>'#aaa' ); if (isset($arrayconvpictotocolor[$pictowithouttext])) { $facolor = $arrayconvpictotocolor[$pictowithouttext]; diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 57e4c14e5d5..28b6c6f0dbd 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -284,11 +284,19 @@ if ($line->special_code == 3) { ?> { $tooltiponprice = $langs->transcountry("TotalHT", $mysoc->country_code).'='.price($line->total_ht); $tooltiponprice .= '
'.$langs->transcountry("TotalVAT", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_tva); - if (price2num($line->total_localtax1)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); - if (price2num($line->total_localtax2)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2); + if (! $senderissupplier && is_object($object->thirdparty)) { + if ($object->thirdparty->useLocalTax(1)) { + if (price2num($line->total_localtax1)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax1); + else $tooltiponprice .= '
'.$langs->transcountry("TotalLT1", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + } + if ($object->thirdparty->useLocalTax(1)) { + if (price2num($line->total_localtax2)) $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.price($line->total_localtax2); + else $tooltiponprice .= '
'.$langs->transcountry("TotalLT2", ($senderissupplier ? $object->thirdparty->country_code : $mysoc->country_code)).'='.$langs->trans("NotUsedForThisCustomer").''; + } + } $tooltiponprice .= '
'.$langs->transcountry("TotalTTC", $mysoc->country_code).'='.price($line->total_ttc); - print ''; + print ''; } print price($line->total_ht); if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index c34ea6a9e96..7cb9b21791a 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -1030,3 +1030,4 @@ DeleteFileHeader=Confirm file delete DeleteFileText=Do you really want delete this file? ShowOtherLanguages=Show other languages SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for this language +NotUsedForThisCustomer=Not used for this customer \ No newline at end of file diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 11b901a9c66..0665cc48e06 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -293,13 +293,19 @@ if ($action == 'create') // Country print ''; // Phone / Fax - print ''; - print ''; + print ''; + print ''; + print ''; // Status print '
'; - print ''; + print ''; print ' '.$this->tpl['label'].''.$this->tpl['qty'].(($this->tpl['efficiency'] > 0 && $this->tpl['efficiency'] < 1) ? ' / '.$form->textwithpicto($this->tpl['efficiency'], $langs->trans("ValueOfMeansLoss")).' = '.round($this->tpl['qty'] / $this->tpl['efficiency'], 2) : '').''.$this->tpl['qty'].(($this->tpl['efficiency'] > 0 && $this->tpl['efficiency'] < 1) ? ' / '.$form->textwithpicto($this->tpl['efficiency'], $langs->trans("ValueOfMeansLoss")).' = '.$qtytoconsumeforline : '').''.($this->tpl['qty_frozen'] ? yn($this->tpl['qty_frozen']) : '').''.($this->tpl['disable_stock_change'] ? yn($this->tpl['disable_stock_change']) : '').''.$this->tpl['efficiency'].''.$langs->trans('Description').''.$langs->trans('Qty').''.$form->textwithpicto($langs->trans('Qty'), $langs->trans("QtyRequiredIfNoLoss")).''; -//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization +print img_picto('', 'globe-americas', 'class="paddingrightonly"'); print $form->select_country($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; -//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization +print img_picto('', 'globe-americas', 'class="paddingrightonly"'); print $form->select_country($mysoc->country_id, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'; + print img_picto('', 'globe-americas', 'class="paddingrightonly"'); print $form->select_country((GETPOST("country_id", 'alpha') ? GETPOST("country_id", 'alpha') : $object->country_id), 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.img_picto('', 'object_phoning').' '.$form->editfieldkey('PhonePro', 'phone_pro', '', $object, 0).'
'.$form->editfieldkey('PhonePro', 'phone_pro', '', $object, 0).''; + print img_picto('', 'object_phoning'); + print '
'.img_picto('', 'object_phoning').' '.$form->editfieldkey('PhonePerso', 'phone_perso', '', $object, 0).'
'.$form->editfieldkey('PhonePerso', 'phone_perso', '', $object, 0).''; + print img_picto('', 'object_phoning'); + print '
'.img_picto('', 'object_phoning_mobile').' '.$form->editfieldkey('PhoneMobile', 'phone_mobile', '', $object, 0).'
'.$form->editfieldkey('PhoneMobile', 'phone_mobile', '', $object, 0).''; + print img_picto('', 'object_phoning_mobile'); + print '
'.img_picto('', 'object_phoning_fax').' '.$form->editfieldkey('Fax', 'fax', '', $object, 0).''.$form->editfieldkey('Fax', 'fax', '', $object, 0).''; + print img_picto('', 'object_phoning_fax'); + print '
'.img_picto('', 'object_email').' '.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '').'
'.$form->editfieldkey('EMail', 'email', '', $object, 0, 'string', '').''; + print img_picto('', 'object_email'); + print '
lastname).'" autofocus="autofocus">lastname).'" autofocus="autofocus">
firstname).'">firstname).'">
poste).'">
poste).'">
'; - print '
'; - print ''; + print '
'; + print ''; print '
'; if ($conf->use_javascript_ajax) print ''.$langs->trans('CopyAddressFromSoc').'
'; print '
'; @@ -1002,13 +1013,14 @@ else // Zip / Town print '
/ '; - print $formcompany->select_ziptown((isset($_POST["zipcode"]) ?GETPOST("zipcode") : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6).' '; - print $formcompany->select_ziptown((isset($_POST["town"]) ?GETPOST("town") : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id')); + print $formcompany->select_ziptown((GETPOSTISSET("zipcode") ? GETPOST("zipcode") : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6).' '; + print $formcompany->select_ziptown((GETPOSTISSET("town") ? GETPOST("town") : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '
'; - print $form->select_country(isset($_POST["country_id"]) ?GETPOST("country_id") : $object->country_id, 'country_id'); + print img_picto('', 'globe-americas', 'class="paddingrightonly"'); + print $form->select_country(GETPOSTISSET("country_id") ? GETPOST("country_id") : $object->country_id, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.img_picto('', 'object_phoning').' '.$form->editfieldkey('PhonePro', 'phone_pro', GETPOST('phone_pro', 'alpha'), $object, 0).''.img_picto('', 'object_phoning').' '.$form->editfieldkey('PhonePerso', 'fax', GETPOST('phone_perso', 'alpha'), $object, 0).'
'.$form->editfieldkey('PhonePro', 'phone_pro', GETPOST('phone_pro', 'alpha'), $object, 0).''; + print img_picto('', 'object_phoning'); + print ''.$form->editfieldkey('PhonePerso', 'fax', GETPOST('phone_perso', 'alpha'), $object, 0).''; + print img_picto('', 'object_phoning'); + print '
'.img_picto('', 'object_phoning_mobile').' '.$form->editfieldkey('PhoneMobile', 'phone_mobile', GETPOST('phone_mobile', 'alpha'), $object, 0, 'string', '').''.img_picto('', 'object_phoning_fax').' '.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).'
'.$form->editfieldkey('PhoneMobile', 'phone_mobile', GETPOST('phone_mobile', 'alpha'), $object, 0, 'string', '').''; + print img_picto('', 'object_phoning_mobile'); + print ''.$form->editfieldkey('Fax', 'fax', GETPOST('fax', 'alpha'), $object, 0).''; + print img_picto('', 'object_phoning_fax'); + print '
'.img_picto('', 'object_email').' '.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).'
'.$form->editfieldkey('EMail', 'email', GETPOST('email', 'alpha'), $object, 0, 'string', '', (!empty($conf->global->SOCIETE_EMAIL_MANDATORY))).''; + print img_picto('', 'object_email'); + print '
'.$langs->trans('Country').''; + print img_picto('', 'globe-americas', 'class="paddingright"'); print $form->select_country((!empty($object->country_id) ? $object->country_id : $mysoc->country_code), 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.img_picto('', 'object_phoning').' '.$form->editfieldkey('Phone', 'phone', '', $object, 0).'
'.img_picto('', 'object_phoning_fax').' '.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).''; + print img_picto('', 'object_phoning', 'class="paddingright"'); + print '
'.$form->editfieldkey('Fax', 'fax', '', $object, 0).''; + print img_picto('', 'object_phoning_fax', 'class="paddingright"'); + print '
'.$langs->trans("Status").''; @@ -395,7 +401,7 @@ else print '
'; print '
'; - print ''; + print '
'; // Parent entrepot $parentwarehouse = new Entrepot($db); @@ -429,7 +435,7 @@ else print '
'; print '
'; - print '
'; + print '
'; // Value print ''; // Phone / Fax - print ''; - print ''; + print ''; + print ''; // Status print '
'.$langs->trans("EstimatedStockValueShort").''; @@ -723,13 +729,18 @@ else // Country print '
'.$langs->trans('Country').''; + print img_picto('', 'globe-americas', 'class="paddingright"'); print $form->select_country($object->country_id ? $object->country_id : $mysoc->country_code, 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.img_picto('', 'object_phoning').' '.$form->editfieldkey('Phone', 'phone', '', $object, 0).'
'.img_picto('', 'object_phoning_fax').' '.$form->editfieldkey('Fax', 'fax', '', $object, 0).'
'.$form->editfieldkey('Phone', 'phone', '', $object, 0).''; + print img_picto('', 'object_phoning', 'class="paddingright"'); + print '
'.$form->editfieldkey('Fax', 'fax', '', $object, 0).''; + print img_picto('', 'object_phoning_fax', 'class="paddingright"'); + print '
'.$langs->trans("Status").''; diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index e2cd50fd2e2..944462ccdfc 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -574,7 +574,7 @@ if ($resql) print '
'; print '
'; - print ''; + print '
'; print ''; @@ -602,7 +602,7 @@ if ($resql) print '
'; print '
'; - print '
'; + print '
'; // Value print ''; @@ -1977,6 +1978,7 @@ else // Country print ''; diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 89d803781ba..e495a3bb4bc 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -210,7 +210,9 @@ textarea.cke_source:focus { box-shadow: none; } - +div#cke_dp_desc { + margin-top: 5px; +} textarea { border-radius: 0; border-top:solid 1px rgba(0,0,0,.2); diff --git a/htdocs/theme/eldy/main_menu_fa_icons.inc.php b/htdocs/theme/eldy/main_menu_fa_icons.inc.php index e2cd9d339c5..5b9395fbc04 100644 --- a/htdocs/theme/eldy/main_menu_fa_icons.inc.php +++ b/htdocs/theme/eldy/main_menu_fa_icons.inc.php @@ -145,7 +145,7 @@ div.mainmenu.generic4::before { /* Define color of some picto */ -.fa-phone, .fa-fax { +.fa-phone, .fa-mobile-alt, .fa-fax { opacity: 0.5; color: #440; } From 8598fd99c2973b491ea25ef620e5644f40627d6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 18:08:02 +0200 Subject: [PATCH 36/76] if not exists not required --- htdocs/install/mysql/migration/11.0.0-12.0.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql index 9c09b8b9247..4b87b4b9ce3 100644 --- a/htdocs/install/mysql/migration/11.0.0-12.0.0.sql +++ b/htdocs/install/mysql/migration/11.0.0-12.0.0.sql @@ -42,7 +42,7 @@ ALTER TABLE llx_commande_fournisseur_dispatch_extrafields ADD INDEX idx_commande UPDATE llx_accounting_system SET fk_country = NULL, active = 0 WHERE pcg_version = 'SYSCOHADA'; -create table if not exists llx_c_shipment_package_type +create table llx_c_shipment_package_type ( rowid integer AUTO_INCREMENT PRIMARY KEY, label varchar(50) NOT NULL, -- Short name From 7bc8a70b0a593a39d0acb72e29b445e39ccd3812 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 18:23:48 +0200 Subject: [PATCH 37/76] FIX #13670 --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6e71125cbd5..37dbcbf5ded 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4548,7 +4548,7 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $ { if ($currency_code == 'auto') $currency_code = $conf->currency; - $listofcurrenciesbefore = array('USD', 'GBP', 'AUD', 'HKD', 'MXN', 'PEN', 'CNY', 'CAD'); + $listofcurrenciesbefore = array('AUD', 'CAD', 'CNY', 'COP', 'CLP', 'GBP', 'HKD', 'MXN', 'PEN', 'USD'); $listoflanguagesbefore = array('nl_NL'); if (in_array($currency_code, $listofcurrenciesbefore) || in_array($outlangs->defaultlang, $listoflanguagesbefore)) { From 52c8e3aff10b2bd3afbb08dbde918e109942ab22 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 18:30:25 +0200 Subject: [PATCH 38/76] Look and feel v12 --- htdocs/admin/multicurrency.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php index a2db56549e3..4ba581398ee 100644 --- a/htdocs/admin/multicurrency.php +++ b/htdocs/admin/multicurrency.php @@ -281,8 +281,8 @@ if (!empty($conf->global->MAIN_MULTICURRENCY_ALLOW_SYNCHRONIZATION)) print ''."\n"; print ''; print ''; From 3170060c650acee32e8852d1861c552274c8072b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 18:34:52 +0200 Subject: [PATCH 39/76] Help show format of price --- htdocs/admin/limits.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index d828873be36..0646c7f6d46 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -209,6 +209,8 @@ else // Show examples print load_fiche_titre($langs->trans("ExamplesWithCurrentSetup"), '', ''); + print ''.$langs->trans("Format").': '.price(price2num(1234.56789, 'MT'), 0, $langs, 1, -1, -1, $currencycode)."
\n"; + // Always show vat rates with vat 0 $s = 2 / 7; $qty = 1; $vat = 0; $tmparray = calcul_price_total(1, $qty * price2num($s, 'MU'), 0, $vat, 0, 0, 0, 'HT', 0, 0, $mysoc); From 4605b9ec61350024fc197ae4f5c45c4f2765f971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Wed, 22 Apr 2020 19:16:58 +0200 Subject: [PATCH 40/76] Update api_bankaccounts.class.php --- htdocs/compta/bank/class/api_bankaccounts.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/api_bankaccounts.class.php b/htdocs/compta/bank/class/api_bankaccounts.class.php index d947d169695..ad75559b362 100644 --- a/htdocs/compta/bank/class/api_bankaccounts.class.php +++ b/htdocs/compta/bank/class/api_bankaccounts.class.php @@ -78,7 +78,7 @@ class BankAccounts extends DolibarrApi $sql .= ' WHERE t.entity IN ('.getEntity('bank_account').')'; // Select accounts of given category if ($category > 0) { - $sql .= " AND c.fk_categorie = ".$db->escape($category)." AND c.fk_account = t.rowid "; + $sql .= " AND c.fk_categorie = ".$this->db->escape($category)." AND c.fk_account = t.rowid "; } // Add sql filters if ($sqlfilters) From 245f89ceaaac7844ecac8ce3ca880bd195433a37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 21:28:23 +0200 Subject: [PATCH 41/76] Look and feel v12 --- htdocs/product/stock/class/entrepot.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 40b7c4916de..aa922c4ab0c 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -715,7 +715,7 @@ class Entrepot extends CommonObject $result = ''; - $label = ''.$langs->trans("ShowWarehouse").''; + $label = ''.$langs->trans("Warehouse").''; $label .= '
'.$langs->trans('Ref').': '.(empty($this->ref) ? (empty($this->label) ? $this->libelle : $this->label) : $this->ref); if (!empty($this->lieu)) { $label .= '
'.$langs->trans('LocationSummary').': '.$this->lieu; @@ -731,7 +731,7 @@ class Entrepot extends CommonObject { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label = $langs->trans("ShowWarehouse"); + $label = $langs->trans("Warehouse"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; From de90f24bd47ef33892f21a0c6fb86185f8bd7c0c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 21:29:15 +0200 Subject: [PATCH 42/76] Fix phpcs --- htdocs/core/class/html.formother.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php index 3a709e295f7..daf8b3db617 100644 --- a/htdocs/core/class/html.formother.class.php +++ b/htdocs/core/class/html.formother.class.php @@ -262,7 +262,7 @@ class FormOther { // phpcs:enable global $langs; - + $out = ''; $sql = "SELECT r.taux, r.revenuestamp_type"; From 9bda294edcac49f34ba3ca216649f6d9ac6ce247 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 21:41:56 +0200 Subject: [PATCH 43/76] Fix set default warehouse of product in MO consumption --- htdocs/mrp/mo_production.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index f1e847a6213..301cf4a76ae 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -684,6 +684,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; if ($action == 'addconsumeline') { + print ''."\n"; print ''; print ''; print ''; $preselected = (GETPOSTISSET('qty-'.$line->id.'-'.$i) ? GETPOST('qty-'.$line->id.'-'.$i) : max(0, $line->qty - $alreadyconsumed)); @@ -800,8 +802,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'.$langs->trans("EstimatedStockValueShort").''; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 20ada9bfbaf..8800bd887a1 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1330,6 +1330,7 @@ else // Country print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; + print img_picto('', 'globe-americas', 'class="paddingrightonly"'); print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->editfieldkey('Country', 'selectcounty_id', '', $object, 0).''; + print img_picto('', 'globe-americas', 'class="paddingrightonly"'); print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id') : $object->country_id), 'country_id'); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '
'.$form->textwithpicto($langs->trans("CurrencyLayerAccount"), $langs->trans("CurrencyLayerAccount_help_to_synchronize", $urlforapilayer)).''; print ''; - print ''; - print ''; + print ''; + print ''; print '
'; print $form->select_produits('', 'productidtoadd', '', 0, 0, -1, 2, '', 0, array(), 0, '1', 0, 'maxwidth300'); @@ -791,6 +792,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { $i = 1; + print ''."\n"; print '
'.$langs->trans("ToConsume").''; if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { if (empty($line->disable_stock_change)) { - $preselected = (GETPOSTISSET('idwarehouse-'.$line->id.'-'.$i) ? GETPOST('idwarehouse-'.$line->id.'-'.$i) : 'ifone'); - print $formproduct->selectWarehouses($preselected, 'idwarehouse-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1); + $preselected = (GETPOSTISSET('idwarehouse-'.$line->id.'-'.$i) ? GETPOST('idwarehouse-'.$line->id.'-'.$i) : ($tmpproduct->fk_default_warehouse > 0 ? $tmpproduct->fk_default_warehouse : 'ifone')); + print $formproduct->selectWarehouses($preselected, 'idwarehouse-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1, 0, null, 'maxwidth300'); } else { print ''.$langs->trans("DisableStockChange").''; } @@ -949,7 +951,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; if ($tmpproduct->type == Product::TYPE_PRODUCT || !empty($conf->global->STOCK_SUPPORTS_SERVICES)) { $preselected = (GETPOSTISSET('idwarehousetoproduce-'.$line->id.'-'.$i) ? GETPOST('idwarehousetoproduce-'.$line->id.'-'.$i) : ($object->fk_warehouse > 0 ? $object->fk_warehouse : 'ifone')); - print $formproduct->selectWarehouses($preselected, 'idwarehousetoproduce-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1, 0, null, 'csswarehouse_'.$line->id.'_'.$i); + print $formproduct->selectWarehouses($preselected, 'idwarehousetoproduce-'.$line->id.'-'.$i, '', 1, 0, $line->fk_product, '', 1, 0, null, 'maxwidth300 csswarehouse_'.$line->id.'_'.$i); } else { print ''.$langs->trans("NoStockChangeOnServices").''; } From a7641cdb9028c5b41aae62a2315d2e15b6cae078 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 22:02:25 +0200 Subject: [PATCH 44/76] CSS --- htdocs/product/stock/class/entrepot.class.php | 2 +- htdocs/user/home.php | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index aa922c4ab0c..3dd22c9e5c3 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -765,7 +765,7 @@ class Entrepot extends CommonObject // Initialize parameters $this->id = 0; - $this->libelle = 'WAREHOUSE SPECIMEN'; + $this->label = 'WAREHOUSE SPECIMEN'; $this->description = 'WAREHOUSE SPECIMEN '.dol_print_date($now, 'dayhourlog'); $this->statut = 1; $this->specimen = 1; diff --git a/htdocs/user/home.php b/htdocs/user/home.php index da037243ed8..4bb99e4c261 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -92,7 +92,7 @@ print '
'; /* - * Last created users + * Latest created users */ $max = 10; @@ -128,8 +128,7 @@ if ($resql) print '
'; print ''; print ''; - print ''; - print ''; + print ''; print ''; $i = 0; @@ -165,7 +164,7 @@ if ($resql) print img_picto($langs->trans("Administrator"), 'star'); } print ""; - print ''; + print ''; print "'; @@ -1188,7 +1187,7 @@ if ($id > 0) $object->contactid = GETPOST("contactid", 'int'); $object->fk_project = GETPOST("projectid", 'int'); - $object->note = GETPOST("note", 'none'); + $object_private = GETPOST("note", 'none'); } if ($result2 < 0 || $result3 < 0 || $result4 < 0 || $result5 < 0) @@ -1540,7 +1539,7 @@ if ($id > 0) print ''; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 09c114375b1..d5b2d542b05 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -733,14 +733,14 @@ class ActionComm extends CommonObject $this->type_short = (($transcode != "Action".$obj->type_code.'Short') ? $transcode : ''); $this->code = $obj->code; - $this->label = $obj->label; - $this->datep = $this->db->jdate($obj->datep); - $this->datef = $this->db->jdate($obj->datep2); + $this->label = $obj->label; + $this->datep = $this->db->jdate($obj->datep); + $this->datef = $this->db->jdate($obj->datep2); - $this->datec = $this->db->jdate($obj->datec); - $this->datem = $this->db->jdate($obj->datem); + $this->datec = $this->db->jdate($obj->datec); + $this->datem = $this->db->jdate($obj->datem); - $this->note = $obj->note; + $this->note = $obj->note; // deprecated $this->note_private = $obj->note; $this->percentage = $obj->percentage; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 9f28d278ed1..a4b1a9618fb 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -553,8 +553,7 @@ if ($resql) $actionstatic->type_picto = $obj->type_picto; $actionstatic->label = $obj->label; $actionstatic->location = $obj->location; - $actionstatic->note = dol_htmlentitiesbr($obj->note); // deprecated - $actionstatic->note_public = dol_htmlentitiesbr($obj->note); + $actionstatic->note_private = dol_htmlentitiesbr($obj->note); $actionstatic->fetchResources(); @@ -613,8 +612,8 @@ if ($resql) // Description if (!empty($arrayfields['a.note']['checked'])) { print ''; } From 69f4a3e7b08af95fd1a8960820a87f2505b3c1ca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 11:41:03 +0200 Subject: [PATCH 48/76] Doc --- htdocs/install/mysql/tables/llx_commande.sql | 2 +- htdocs/install/mysql/tables/llx_facture.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index c6b9049a64f..676e768c73b 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -58,7 +58,7 @@ create table llx_commande last_main_doc varchar(255), -- relative filepath+filename of last main generated document module_source varchar(32), -- name of module when order generated by a dedicated module (POS, ...) - pos_source varchar(32), -- name of POS station when order is generated by a POS module + pos_source varchar(32), -- numero of POS terminal when order is generated by a POS module, IDsession@IDwebsite when order is generated for a website basket. facture tinyint default 0, fk_account integer, -- bank account fk_currency varchar(3), -- currency code diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index 5a2d5464cfc..429095e1111 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -65,7 +65,7 @@ create table llx_facture fk_user_closing integer, -- user closing module_source varchar(32), -- name of module when invoice generated by a dedicated module (POS, ...) - pos_source varchar(32), -- name of POS station when invoice is generated by a POS module + pos_source varchar(32), -- numero of POS terminal when order is generated by a POS module, IDsession@IDwebsite when order is generated for a website basket. fk_fac_rec_source integer, -- facture rec source fk_facture_source integer, -- facture origin if credit notes or replacement invoice fk_projet integer DEFAULT NULL, -- project invoice is linked to From da02863242eddf76fda5cdddc17dd916663a40b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 12:19:51 +0200 Subject: [PATCH 49/76] Code comment --- htdocs/install/mysql/tables/llx_societe_account.sql | 4 ++-- htdocs/societe/class/societeaccount.class.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/tables/llx_societe_account.sql b/htdocs/install/mysql/tables/llx_societe_account.sql index feffc7c9bd6..6a78a9a7839 100644 --- a/htdocs/install/mysql/tables/llx_societe_account.sql +++ b/htdocs/install/mysql/tables/llx_societe_account.sql @@ -20,15 +20,15 @@ CREATE TABLE llx_societe_account( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, entity integer DEFAULT 1, - key_account varchar(128), -- the id of third party in external web site (for site_account if site_account defined) login varchar(128) NOT NULL, pass_encoding varchar(24), pass_crypted varchar(128), pass_temp varchar(128), -- temporary password when asked for forget password fk_soc integer, + fk_website integer, -- id of local web site site varchar(128), -- name of external web site site_account varchar(128), -- a key to identify the account on external web site - fk_website integer, -- id of local web site + key_account varchar(128), -- the id of third party in external web site (for site_account if site_account defined) note_private text, date_last_login datetime, date_previous_login datetime, diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index f90cb17c230..4b3fcc15ec1 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -79,15 +79,15 @@ class SocieteAccount extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1), - 'key_account' => array('type'=>'varchar(128)', 'label'=>'KeyAccount', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Key account',), 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>10), 'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30), 'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1), 'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,), 'fk_soc' => array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'visible'=>1, 'enabled'=>1, 'position'=>40, 'notnull'=>-1, 'index'=>1), - 'site' => array('type'=>'varchar(128)', 'label'=>'Site', 'visible'=>-1, 'enabled'=>1, 'position'=>41), - 'site_account' => array('type'=>'varchar(128)', 'label'=>'SiteAccount', 'visible'=>-1, 'enabled'=>1, 'position'=>42, 'help'=>'A key to identify the account on external web site'), - 'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>43, 'notnull'=>-1, 'index'=>1), + 'fk_website' => array('type'=>'integer:Website:website/class/website.class.php', 'label'=>'WebSite', 'visible'=>1, 'enabled'=>1, 'position'=>42, 'notnull'=>-1, 'index'=>1), + 'site' => array('type'=>'varchar(128)', 'label'=>'ExternalSite', 'visible'=>0, 'enabled'=>1, 'position'=>43, 'help'=>'Name of the website or service if this is account on an external website or service'), + 'site_account' => array('type'=>'varchar(128)', 'label'=>'ExternalSiteAccount', 'visible'=>0, 'enabled'=>1, 'position'=>44, 'help'=>'A key to identify the account on external web site if this is an account on an external website'), + 'key_account' => array('type'=>'varchar(128)', 'label'=>'KeyAccount', 'visible'=>0, 'enabled'=>1, 'position'=>48, 'notnull'=>0, 'index'=>1, 'searchall'=>1, 'comment'=>'The id of third party in the external web site (for site_account if site_account defined)',), 'date_last_login' => array('type'=>'datetime', 'label'=>'LastConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>50, 'notnull'=>0,), 'date_previous_login' => array('type'=>'datetime', 'label'=>'PreviousConnexion', 'visible'=>2, 'enabled'=>1, 'position'=>51, 'notnull'=>0,), //'note_public' => array('type'=>'text', 'label'=>'NotePublic', 'visible'=>-1, 'enabled'=>1, 'position'=>45, 'notnull'=>-1,), From 18d3d68caea89d18e4467a50417437b4ce0c23e4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 12:22:24 +0200 Subject: [PATCH 50/76] Fix def --- htdocs/societe/class/societeaccount.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 4b3fcc15ec1..41fc8633be1 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -79,7 +79,7 @@ class SocieteAccount extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1), - 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'position'=>10), + 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'notnull'=>1, 'position'=>10), 'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30), 'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1), 'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,), From d11396be3e5becdb80fe72c54e30a6fa905ff8c9 Mon Sep 17 00:00:00 2001 From: Drosis Nikos Date: Thu, 23 Apr 2020 13:22:30 +0300 Subject: [PATCH 51/76] Fix check VAT ID HTTP to HTTPS No response to HTTP --- htdocs/societe/checkvat/checkVatPopup.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 8d004fa4c79..91f24bbb915 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -28,9 +28,9 @@ require_once NUSOAP_PATH.'/nusoap.php'; $langs->load("companies"); //http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl -$WS_DOL_URL = 'http://ec.europa.eu/taxation_customs/vies/services/checkVatService'; +$WS_DOL_URL = 'https://ec.europa.eu/taxation_customs/vies/services/checkVatService'; //$WS_DOL_URL_WSDL=$WS_DOL_URL.'?wsdl'; -$WS_DOL_URL_WSDL = 'http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; +$WS_DOL_URL_WSDL = 'https://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl'; $WS_METHOD = 'checkVat'; From 8f8ae5a4dbed13228655c499b1d62b309d00abb8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 12:33:22 +0200 Subject: [PATCH 52/76] Fix typo --- htdocs/langs/en_US/website.lang | 2 +- htdocs/societe/class/societeaccount.class.php | 7 +++---- htdocs/societe/website.php | 2 ++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index c3e9870266f..d9b0454c848 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -77,7 +77,7 @@ BlogPost=Blog post WebsiteAccount=Website account WebsiteAccounts=Website accounts AddWebsiteAccount=Create web site account -BackToListOfThirdParty=Back to list for Third Party +BackToListOfThirdParty=Back to list of third-parties DisableSiteFirst=Disable website first MyContainerTitle=My web site title AnotherContainer=This is how to include content of another page/container (you may have an error here if you enable dynamic code because the embedded subcontainer may not exists) diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php index 41fc8633be1..98bdeffa637 100644 --- a/htdocs/societe/class/societeaccount.class.php +++ b/htdocs/societe/class/societeaccount.class.php @@ -79,7 +79,7 @@ class SocieteAccount extends CommonObject public $fields = array( 'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'visible'=>-2, 'enabled'=>1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>'Id',), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>5, 'default'=>1), - 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'notnull'=>1, 'position'=>10), + 'login' => array('type'=>'varchar(64)', 'label'=>'Login', 'visible'=>1, 'enabled'=>1, 'notnull'=>1, 'position'=>10, 'showoncombobox'=>1), 'pass_encoding' => array('type'=>'varchar(24)', 'label'=>'PassEncoding', 'visible'=>0, 'enabled'=>1, 'position'=>30), 'pass_crypted' => array('type'=>'varchar(128)', 'label'=>'Password', 'visible'=>1, 'enabled'=>1, 'position'=>31, 'notnull'=>1), 'pass_temp' => array('type'=>'varchar(128)', 'label'=>'Temp', 'visible'=>0, 'enabled'=>0, 'position'=>32, 'notnull'=>-1,), @@ -405,11 +405,10 @@ class SocieteAccount extends CommonObject if (!empty($conf->dol_no_mouse_hover)) $notooltip = 1; // Force disable tooltips $result = ''; - $companylink = ''; $this->ref = $this->login; - $label = ''.$langs->trans("SocieteAccount").''; + $label = ''.$langs->trans("WebsiteAccount").''; $label .= '
'; $label .= ''.$langs->trans('Login').': '.$this->ref; //$label.= '' . $langs->trans('WebSite') . ': ' . $this->ref; @@ -429,7 +428,7 @@ class SocieteAccount extends CommonObject { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { - $label = $langs->trans("ShowsocieteAccount"); + $label = $langs->trans("WebsiteAccount"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 7b3bf774a68..dc53f47ff26 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -449,6 +449,8 @@ while ($i < min($num, $limit)) // Store properties in $object $objectwebsiteaccount->id = $obj->rowid; + $objectwebsiteaccount->login = $obj->login; + $objectwebsiteaccount->ref = $obj->login; foreach ($objectwebsiteaccount->fields as $key => $val) { if (property_exists($obj, $key)) $object->$key = $obj->$key; From 46716f2259ee2a337ef200c26c333dfd8577090a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 12:34:37 +0200 Subject: [PATCH 53/76] Typo --- htdocs/langs/en_US/website.lang | 2 +- htdocs/website/websiteaccount_card.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/en_US/website.lang b/htdocs/langs/en_US/website.lang index d9b0454c848..f4d88b0d606 100644 --- a/htdocs/langs/en_US/website.lang +++ b/htdocs/langs/en_US/website.lang @@ -77,7 +77,7 @@ BlogPost=Blog post WebsiteAccount=Website account WebsiteAccounts=Website accounts AddWebsiteAccount=Create web site account -BackToListOfThirdParty=Back to list of third-parties +BackToListForThirdParty=Back to list for the third-party DisableSiteFirst=Disable website first MyContainerTitle=My web site title AnotherContainer=This is how to include content of another page/container (you may have an error here if you enable dynamic code because the embedded subcontainer may not exists) diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 046a5005e51..be0c4c3cc41 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -223,7 +223,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Object card // ------------------------------------------------------------ $linkback = ''; - if ($socid) $linkback = ''.$langs->trans("BackToListOfThirdParty").''; + if ($socid) $linkback = ''.$langs->trans("BackToListForThirdParty").''; if ($fk_website) $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; From 93278b2dca15a5c3cf299d9648ef7ccbcfb51772 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 12:42:03 +0200 Subject: [PATCH 54/76] FIX #13713 --- htdocs/fourn/commande/info.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index efabf409cdc..6764c00f003 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -40,6 +40,17 @@ $id=GETPOST('id', 'int'); $ref=GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); +$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST("sortfield", 'alpha'); +$sortorder = GETPOST("sortorder", 'alpha'); +$page = GETPOST("page", 'int'); +if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1 +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; +if (!$sortfield) $sortfield = 'a.datep,a.id'; +if (!$sortorder) $sortorder = 'DESC,DESC'; + if (GETPOST('actioncode', 'array')) { $actioncode=GETPOST('actioncode', 'array', 3); @@ -217,7 +228,7 @@ if (!empty($object->id)) // List of all actions $filters = array(); $filters['search_agenda_label'] = $search_agenda_label; - show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters); + show_actions_done($conf, $langs, $db, $object, null, 0, $actioncode, '', $filters, $sortfield, $sortorder); } // End of page From e1129babbcbe1eab280d22d0fc5c5cb0a973e2e6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 12:44:30 +0200 Subject: [PATCH 55/76] Code comment --- htdocs/fourn/commande/info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index 6764c00f003..3da0211d3f1 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -223,7 +223,7 @@ if (!empty($object->id)) //show_actions_todo($conf,$langs,$db,$object,null,0,$actioncode); // List of done actions - //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode); + //show_actions_done($conf,$langs,$db,$object,null,0,$actioncode, '', $filters, $sortfield, $sortorder); // List of all actions $filters = array(); From 4475df14b4efa0c8e500f1629102bd882138088e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 12:54:28 +0200 Subject: [PATCH 56/76] Finish removal of duplicate hook/trigger --- .../fournisseur.commande.dispatch.class.php | 21 ++------ htdocs/reception/card.php | 39 +++++++-------- htdocs/reception/class/reception.class.php | 49 ++++++------------- 3 files changed, 37 insertions(+), 72 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index 6a7d8a3e8ba..d7b8807bb28 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -210,22 +210,11 @@ class CommandeFournisseurDispatch extends CommonObject } } - // Actions on extra fields (by external module or standard code) - // TODO le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('commandefournisseurdispatchdao')); - $parameters = array('id'=>$this->id); - $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) - { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result = $this->insertExtraFields(); - - if ($result < 0) - { - $error++; - } - } + // Create extrafields + if (! $error) + { + $result=$this->insertExtraFields(); + if ($result < 0) $error++; } // Commit or rollback diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 1269a99d1ea..9c6e8df76f1 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -186,30 +186,25 @@ if (empty($reshook)) if ($action == 'update_extras') { - // Fill array 'array_options' with data from update form - $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute')); - if ($ret < 0) $error++; + $object->oldcopy = dol_clone($object); - if (!$error) - { - // Actions on extra fields (by external module or standard code) - // TODO le hook fait double emploi avec le trigger !! - $hookmanager->initHooks(array('receptiondao')); - $parameters = array('id' => $object->id); - $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) { - $result = $object->insertExtraFields(); - if ($result < 0) - { - setEventMessages($object->error, $object->errors, 'errors'); - $error++; - } - } elseif ($reshook < 0) - $error++; - } + // Fill array 'array_options' with data from update form + $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'none')); + if ($ret < 0) $error++; - if ($error) - $action = 'edit_extras'; + if (!$error) + { + // Actions on extra fields + $result = $object->insertExtraFields('RECEPTION_MODIFY'); + if ($result < 0) + { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } + } + + if ($error) + $action = 'edit_extras'; } // Create reception diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 1679f186a72..b09a5918def 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -305,24 +305,12 @@ class Reception extends CommonObject } } - // Actions on extra fields (by external module or standard code) - // TODO le hook fait double emploi avec le trigger !! - $action = 'add'; - $hookmanager->initHooks(array('receptiondao')); - $parameters = array('socid'=>$this->id); - $reshook = $hookmanager->executeHooks('insertExtraFields', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks - if (empty($reshook)) + // Create extrafields + if (! $error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result = $this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } + $result=$this->insertExtraFields(); + if ($result < 0) $error++; } - elseif ($reshook < 0) $error++; if (!$error && !$notrigger) { @@ -330,29 +318,22 @@ class Reception extends CommonObject $result = $this->call_trigger('RECEPTION_CREATE', $user); if ($result < 0) { $error++; } // End call triggers + } - if (!$error) - { - $this->db->commit(); - return $this->id; - } - else - { - foreach ($this->errors as $errmsg) - { - dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); - $this->error .= ($this->error ? ', '.$errmsg : $errmsg); - } - $this->db->rollback(); - return -1 * $error; - } + if (!$error) + { + $this->db->commit(); + return $this->id; } else { - $error++; - $this->error = $this->db->lasterror()." - sql=$sql"; + foreach ($this->errors as $errmsg) + { + dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR); + $this->error .= ($this->error ? ', '.$errmsg : $errmsg); + } $this->db->rollback(); - return -3; + return -1 * $error; } } else From 72c6ac1c7263dcc73aed38f8da1a71faf386c5ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 13:21:39 +0200 Subject: [PATCH 57/76] Complete #13708, normalization of code --- htdocs/adherents/class/adherent.class.php | 15 ++++----- .../adherents/class/adherent_type.class.php | 2 +- htdocs/asset/class/asset_type.class.php | 2 +- htdocs/categories/class/categorie.class.php | 6 ++-- htdocs/comm/action/class/actioncomm.class.php | 15 ++++----- htdocs/comm/propal/card.php | 2 +- htdocs/comm/propal/class/propal.class.php | 30 +++++++----------- htdocs/commande/card.php | 2 +- htdocs/commande/class/commande.class.php | 19 +++++------- htdocs/commande/orderstoinvoice.php | 2 +- htdocs/compta/bank/class/account.class.php | 11 +++---- htdocs/compta/facture/card.php | 4 +-- .../facture/class/facture-rec.class.php | 6 ++-- htdocs/compta/facture/class/facture.class.php | 6 ++-- htdocs/contact/class/contact.class.php | 4 +-- htdocs/contrat/card.php | 2 +- htdocs/contrat/class/contrat.class.php | 31 +++++++++---------- htdocs/core/actions_massactions.inc.php | 2 +- htdocs/core/class/commonobject.class.php | 21 ++++++++----- htdocs/don/class/don.class.php | 4 +-- htdocs/expedition/class/expedition.class.php | 11 ++++--- htdocs/fichinter/class/fichinter.class.php | 10 +++--- .../class/fournisseur.commande.class.php | 6 ++-- .../fournisseur.commande.dispatch.class.php | 2 +- .../fourn/class/fournisseur.facture.class.php | 12 +++---- htdocs/fourn/commande/card.php | 4 +-- htdocs/fourn/facture/card.php | 4 +-- htdocs/product/class/product.class.php | 4 +-- htdocs/product/stock/class/entrepot.class.php | 6 ++-- .../product/stock/class/productlot.class.php | 4 +-- htdocs/projet/class/project.class.php | 4 +-- htdocs/projet/class/task.class.php | 4 +-- htdocs/reception/class/reception.class.php | 2 +- htdocs/resource/class/dolresource.class.php | 4 +-- htdocs/salaries/class/paymentsalary.class.php | 4 +-- htdocs/societe/class/societe.class.php | 4 +-- htdocs/supplier_proposal/card.php | 2 +- .../class/supplier_proposal.class.php | 25 +++++++-------- htdocs/ticket/class/ticket.class.php | 16 ++++------ htdocs/user/class/user.class.php | 4 +-- 40 files changed, 149 insertions(+), 169 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 4225dad5f31..dd2593329e0 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -657,7 +657,7 @@ class Adherent extends CommonObject $action = 'update'; // Actions on extra fields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) { @@ -927,14 +927,11 @@ class Adherent extends CommonObject // Removed extrafields if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result = $this->deleteExtraFields(); - if ($result < 0) { - $error++; - $errorflag = -4; - dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); - } + $result = $this->deleteExtraFields(); + if ($result < 0) { + $error++; + $errorflag = -4; + dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); } } diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 442d8cf091f..46733575c36 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -409,7 +409,7 @@ class AdherentType extends CommonObject $action = 'update'; // Actions on extra fields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/asset/class/asset_type.class.php b/htdocs/asset/class/asset_type.class.php index edb6fdf90c9..56be39a8ad0 100644 --- a/htdocs/asset/class/asset_type.class.php +++ b/htdocs/asset/class/asset_type.class.php @@ -202,7 +202,7 @@ class AssetType extends CommonObject $action = 'update'; // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (! $error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 9c0985078e7..dc451855c0a 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -461,7 +461,7 @@ class Categorie extends CommonObject $action = 'create'; // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -553,7 +553,7 @@ class Categorie extends CommonObject $action = 'update'; // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -646,7 +646,7 @@ class Categorie extends CommonObject } // Removed extrafields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 8c1e2051a81..0cd1eeb5051 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -567,14 +567,11 @@ class ActionComm extends CommonObject if (!$error) { // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result = $this->insertExtraFields(); - if ($result < 0) - { - $error++; - } - } + $result = $this->insertExtraFields(); + if ($result < 0) + { + $error++; + } } if (!$error && !$notrigger) @@ -1048,7 +1045,7 @@ class ActionComm extends CommonObject $action = 'update'; // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 92338ebf68e..85927472c56 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -511,7 +511,7 @@ if (empty($reshook)) } // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + if (method_exists($lines[$i], 'fetch_optionals')) { $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 6a2eac53f95..465bb52033c 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1253,13 +1253,10 @@ class Propal extends CommonObject // Actions on extra fields if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $result = $this->insertExtraFields(); + if ($result < 0) { - $result = $this->insertExtraFields(); - if ($result < 0) - { - $error++; - } + $error++; } } @@ -1683,7 +1680,7 @@ class Propal extends CommonObject $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -3053,15 +3050,12 @@ class Propal extends CommonObject // Removed extrafields if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $result = $this->deleteExtraFields(); + if ($result < 0) { - $result = $this->deleteExtraFields(); - if ($result < 0) - { - $error++; - $errorflag = -4; - dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); - } + $error++; + $errorflag = -4; + dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); } } @@ -4152,7 +4146,7 @@ class PropaleLigne extends CommonObjectLine { $this->rowid = $this->db->last_insert_id(MAIN_DB_PREFIX.'propaldet'); - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $this->id = $this->rowid; $result = $this->insertExtraFields(); @@ -4204,7 +4198,7 @@ class PropaleLigne extends CommonObjectLine if ($this->db->query($sql)) { // Remove extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $this->id = $this->rowid; $result = $this->deleteExtraFields(); @@ -4334,7 +4328,7 @@ class PropaleLigne extends CommonObjectLine $resql = $this->db->query($sql); if ($resql) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $this->id = $this->rowid; $result = $this->insertExtraFields(); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index b43a702c2f2..4aad42ca44f 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -384,7 +384,7 @@ if (empty($reshook)) } // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used + if (method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if trigger used { $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c39a5a05a13..9a13ae1abdf 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3342,7 +3342,7 @@ class Commande extends CommonOrder $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -3437,14 +3437,11 @@ class Commande extends CommonOrder if (!$error) { // Remove extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + $result = $this->deleteExtraFields(); + if ($result < 0) { - $result = $this->deleteExtraFields(); - if ($result < 0) - { - $error++; - dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); - } + $error++; + dol_syslog(get_class($this)."::delete error -4 ".$this->error, LOG_ERR); } } @@ -4255,7 +4252,7 @@ class OrderLine extends CommonOrderLine if ($resql) { // Remove extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $this->id = $this->rowid; $result = $this->deleteExtraFields(); @@ -4401,7 +4398,7 @@ class OrderLine extends CommonOrderLine $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'commandedet'); $this->rowid = $this->id; - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -4534,7 +4531,7 @@ class OrderLine extends CommonOrderLine $resql = $this->db->query($sql); if ($resql) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $this->id = $this->rowid; $result = $this->insertExtraFields(); diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index bad5034eac5..f230f7935a5 100644 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -285,7 +285,7 @@ if (($action == 'create' || $action == 'add') && !$error) } // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + if (method_exists($lines[$i], 'fetch_optionals')) { $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ab99173b614..58115537b1f 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -823,13 +823,10 @@ class Account extends CommonObject if ($result) { // Actions on extra fields (by external module or standard code) - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { - if (!$error) - { - $result = $this->insertExtraFields(); - if ($result < 0) $error++; - } + $result = $this->insertExtraFields(); + if ($result < 0) $error++; } if (!$error && !$notrigger) @@ -1107,7 +1104,7 @@ class Account extends CommonObject if ($result) { // Remove extrafields - if ((empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 4f111c26f39..e5cfb1574dc 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1146,7 +1146,7 @@ if (empty($reshook)) foreach ($facture_source->lines as $line) { // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($line, 'fetch_optionals')) { + if (method_exists($line, 'fetch_optionals')) { // load extrafields $line->fetch_optionals(); } @@ -1644,7 +1644,7 @@ if (empty($reshook)) } // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + if (method_exists($lines[$i], 'fetch_optionals')) { $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 205ca88290e..bbb926f7772 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -342,7 +342,7 @@ class FactureRec extends CommonInvoice if ($objectline->fetch($result_insert)) { // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($facsrc->lines[$i], 'fetch_optionals')) { + if (method_exists($facsrc->lines[$i], 'fetch_optionals')) { $facsrc->lines[$i]->fetch_optionals($facsrc->lines[$i]->rowid); $objectline->array_options = $facsrc->lines[$i]->array_options; } @@ -438,7 +438,7 @@ class FactureRec extends CommonInvoice $resql = $this->db->query($sql); if ($resql) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -2112,7 +2112,7 @@ class FactureLigneRec extends CommonInvoiceLine $resql = $this->db->query($sql); if ($resql) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index b6f9c4d7969..b6f41149331 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1881,7 +1881,7 @@ class Facture extends CommonInvoice $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -5237,7 +5237,7 @@ class FactureLigne extends CommonInvoiceLine $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'facturedet'); $this->rowid = $this->id; // For backward compatibility - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -5423,7 +5423,7 @@ class FactureLigne extends CommonInvoiceLine $resql = $this->db->query($sql); if ($resql) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $this->id = $this->rowid; $result = $this->insertExtraFields(); diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 7f52195297b..a3cdb1747a0 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -489,7 +489,7 @@ class Contact extends CommonObject $action = 'update'; // Actions on extra fields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -1168,7 +1168,7 @@ class Contact extends CommonObject } // Removed extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) { + if (!$error) { // For avoid conflicts if trigger used $result = $this->deleteExtraFields(); if ($result < 0) $error++; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9d240a31a79..322d309b15b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -316,7 +316,7 @@ if (empty($reshook)) // Extrafields $array_options = array(); // For avoid conflicts if trigger used - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + if (method_exists($lines[$i], 'fetch_optionals')) { $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 310aed1cd52..5bf9f1f11c1 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1035,7 +1035,7 @@ class Contrat extends CommonObject } } - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -1383,7 +1383,7 @@ class Contrat extends CommonObject $resql = $this->db->query($sql); if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); } - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -1588,7 +1588,7 @@ class Contrat extends CommonObject { $contractlineid = $this->db->last_insert_id(MAIN_DB_PREFIX."contratdet"); - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used + if (!$error) { $contractline = new ContratLigne($this->db); $contractline->array_options = $array_options; @@ -1777,7 +1777,7 @@ class Contrat extends CommonObject $result = $this->update_statut($user); if ($result >= 0) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used + if (is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used { $contractline = new ContratLigne($this->db); $contractline->fetch($rowid); @@ -1859,18 +1859,15 @@ class Contrat extends CommonObject $error++; } - if (empty($error)) { + if (!$error) { // Remove extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + $contractline = new ContratLigne($this->db); + $contractline->id = $idline; + $result = $contractline->deleteExtraFields(); + if ($result < 0) { - $contractline = new ContratLigne($this->db); - $contractline->id = $idline; - $result = $contractline->deleteExtraFields(); - if ($result < 0) - { - $error++; - $this->error = "Error ".get_class($this)."::deleteline deleteExtraFields error -4 ".$contractline->error; - } + $error++; + $this->error = "Error ".get_class($this)."::deleteline deleteExtraFields error -4 ".$contractline->error; } } @@ -3092,7 +3089,7 @@ class ContratLigne extends CommonObjectLine $error++; } - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) // For avoid conflicts if trigger used + if (!$error) // For avoid conflicts if trigger used { $result = $this->insertExtraFields(); if ($result < 0) @@ -3202,6 +3199,8 @@ class ContratLigne extends CommonObjectLine { global $conf, $user; + $error = 0; + // Insertion dans la base $sql = "INSERT INTO ".MAIN_DB_PREFIX."contratdet"; $sql .= " (fk_contrat, label, description, fk_product, qty, vat_src_code, tva_tx,"; @@ -3240,7 +3239,7 @@ class ContratLigne extends CommonObjectLine $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'contratdet'); // Insert of extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index e8cfa803573..ebae28e9582 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -751,7 +751,7 @@ if ($massaction == 'confirm_createbills') // Create bills from orders } // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + if (method_exists($lines[$i], 'fetch_optionals')) { $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 20dbdf18fd3..3d8871dc07a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5351,9 +5351,14 @@ abstract class CommonObject * Delete all extra fields values for the current object. * * @return int <0 if KO, >0 if OK + * @see deleteExtraLanguages(), insertExtraField(), updateExtraField(), setValueFrom() */ public function deleteExtraFields() { + global $conf; + + if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; + $this->db->begin(); $table_element = $this->table_element; @@ -5383,18 +5388,18 @@ abstract class CommonObject * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) * @param User $userused Object user * @return int -1=error, O=did nothing, 1=OK - * @see insertExtraLanguages(), updateExtraField(), setValueFrom() + * @see insertExtraLanguages(), updateExtraField(), deleteExtraField(), setValueFrom() */ public function insertExtraFields($trigger = '', $userused = null) { global $conf, $langs, $user; + if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; + if (empty($userused)) $userused = $user; $error = 0; - if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used - if (!empty($this->array_options)) { // Check parameters @@ -5792,18 +5797,18 @@ abstract class CommonObject * @param string $trigger If defined, call also the trigger (for example COMPANY_MODIFY) * @param User $userused Object user * @return int -1=error, O=did nothing, 1=OK - * @see updateExtraLanguages(), setValueFrom(), insertExtraFields() + * @see updateExtraLanguages(), insertExtraFields(), deleteExtraFields(), setValueFrom() */ public function updateExtraField($key, $trigger = null, $userused = null) { global $conf, $langs, $user; + if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; + if (empty($userused)) $userused = $user; $error = 0; - if (!empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) return 0; // For avoid conflicts if trigger used - if (!empty($this->array_options) && isset($this->array_options["options_".$key])) { // Check parameters @@ -8174,7 +8179,7 @@ abstract class CommonObject } // Update extrafield - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -8335,7 +8340,7 @@ abstract class CommonObject if (empty($error)) { // Remove extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $tmpobjectline = new $tmpforobjectlineclass($this->db); $tmpobjectline->id = $idline; diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 8260656e4d0..102d7e58685 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -432,7 +432,7 @@ class Don extends CommonObject // Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -519,7 +519,7 @@ class Don extends CommonObject // Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 624add5c075..e1c24106e09 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -380,7 +380,7 @@ class Expedition extends CommonObject } // Actions on extra fields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -1046,7 +1046,8 @@ class Expedition extends CommonObject } } $line->entrepot_id = $linebatch->entrepot_id; - $line->origin_line_id = $dbatch['ix_l']; + $line->origin_line_id = $dbatch['ix_l']; // deprecated + $line->fk_origin_line = $dbatch['ix_l']; $line->qty = $dbatch['qty']; $line->detail_batch = $tab; @@ -2617,7 +2618,7 @@ class ExpeditionLigne extends CommonObjectLine { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."expeditiondet"); - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -2691,7 +2692,7 @@ class ExpeditionLigne extends CommonObjectLine if (!$error && $this->db->query($sql)) { // Remove extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) @@ -2895,7 +2896,7 @@ class ExpeditionLigne extends CommonObjectLine if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index f8a62da7ba6..502eb5ccb69 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -305,7 +305,7 @@ class Fichinter extends CommonObject if (!$resql) $error++; } - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -385,7 +385,7 @@ class Fichinter extends CommonObject dol_syslog(get_class($this)."::update", LOG_DEBUG); if ($this->db->query($sql)) { - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -1001,7 +1001,7 @@ class Fichinter extends CommonObject if (!$resql) $error++; } - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { // Remove extrafields $res = $this->deleteExtraFields(); @@ -1552,7 +1552,7 @@ class FichinterLigne extends CommonObjectLine $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'fichinterdet'); $this->rowid = $this->id; - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -1623,7 +1623,7 @@ class FichinterLigne extends CommonObjectLine $resql = $this->db->query($sql); if ($resql) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index e5505cbaa9f..c95e403a24c 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2063,7 +2063,7 @@ class CommandeFournisseur extends CommonOrder } // Remove extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) @@ -3626,7 +3626,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); $this->rowid = $this->id; - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -3716,7 +3716,7 @@ class CommandeFournisseurLigne extends CommonOrderLine $result = $this->db->query($sql); if ($result > 0) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php index d7b8807bb28..041958448fa 100644 --- a/htdocs/fourn/class/fournisseur.commande.dispatch.class.php +++ b/htdocs/fourn/class/fournisseur.commande.dispatch.class.php @@ -362,7 +362,7 @@ class CommandeFournisseurDispatch extends CommonObject if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { if (empty($this->id) && !empty($this->rowid))$this->id = $this->rowid; $result = $this->insertExtraFields(); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index f2f1bac9257..8bbee47a2cd 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -558,7 +558,7 @@ class FactureFournisseur extends CommonInvoice if ($result > 0) { // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); // This also set $this->error or $this->errors if errors are found if ($result < 0) @@ -977,7 +977,7 @@ class FactureFournisseur extends CommonInvoice } } - if (! $error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options)>0) + if (! $error) { $result=$this->insertExtraFields(); if ($result < 0) @@ -1243,7 +1243,7 @@ class FactureFournisseur extends CommonInvoice } // Remove extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) @@ -3145,7 +3145,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->deleteObjectLinked(); // Remove extrafields - if ((! $error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (! $error) { $result=$this->deleteExtraFields(); if ($result < 0) @@ -3265,7 +3265,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->rowid = $this->id; $error = 0; - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -3406,7 +3406,7 @@ class SupplierInvoiceLine extends CommonObjectLine $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); $this->rowid = $this->id; // backward compatibility - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index bc86076644c..f2ab694e352 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -1064,7 +1064,7 @@ if (empty($reshook)) if (!$error) { // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $object->insertExtraFields('ORDER_SUPPLIER_MODIFY'); if ($result < 0) @@ -1190,7 +1190,7 @@ if (empty($reshook)) } // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if + if (method_exists($lines[$i], 'fetch_optionals')) // For avoid conflicts if { $lines[$i]->fetch_optionals(); $array_option = $lines[$i]->array_options; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 697c8cb74f0..0b63356480c 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -951,7 +951,7 @@ if (empty($reshook)) $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + if (method_exists($lines[$i], 'fetch_optionals')) { $lines[$i]->fetch_optionals(); } @@ -1597,7 +1597,7 @@ if (empty($reshook)) if (!$error) { // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $object->insertExtraFields('BILL_SUPPLIER_MODIFY'); if ($result < 0) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c37dbaeb3f7..4f4334e4125 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1052,7 +1052,7 @@ class Product extends CommonObject $action = 'update'; // Actions on extra fields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) { $error++; @@ -1265,7 +1265,7 @@ class Product extends CommonObject } // Remove extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) { diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 3dd22c9e5c3..db2f84db15a 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -221,7 +221,7 @@ class Entrepot extends CommonObject // Actions on extra fields if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -319,7 +319,7 @@ class Entrepot extends CommonObject $this->errors[] = "Error ".$this->db->lasterror(); } - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($this->array_options) && count($this->array_options) > 0) { + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) { @@ -383,7 +383,7 @@ class Entrepot extends CommonObject // Removed extrafields if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 6db4e81db79..f0a5c0a48ea 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -185,7 +185,7 @@ class Productlot extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element); // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -359,7 +359,7 @@ class Productlot extends CommonObject } // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 0e793361d2b..674db2cc5d6 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -316,7 +316,7 @@ class Project extends CommonObject // Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -405,7 +405,7 @@ class Project extends CommonObject // Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index f3f75b716c1..41f6a76afb2 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -205,7 +205,7 @@ class Task extends CommonObject // Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -384,7 +384,7 @@ class Task extends CommonObject // Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index b09a5918def..2bb34859a6b 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -750,7 +750,7 @@ class Reception extends CommonObject } // extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) $line->array_options = $array_options; $line->fk_product = $fk_product; diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 75c6e50dec3..4cda97b39d1 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -136,7 +136,7 @@ class Dolresource extends CommonObject $action = 'create'; // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -309,7 +309,7 @@ class Dolresource extends CommonObject $action = 'update'; // Actions on extra fields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/salaries/class/paymentsalary.class.php b/htdocs/salaries/class/paymentsalary.class.php index 44c25b09a13..82cdf3c80ce 100644 --- a/htdocs/salaries/class/paymentsalary.class.php +++ b/htdocs/salaries/class/paymentsalary.class.php @@ -160,7 +160,7 @@ class PaymentSalary extends CommonObject // Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -449,7 +449,7 @@ class PaymentSalary extends CommonObject // Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ea175c13c6a..c35b17fe4fa 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1393,7 +1393,7 @@ class Societe extends CommonObject $action = 'update'; // Actions on extra fields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -1771,7 +1771,7 @@ class Societe extends CommonObject } // Removed extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 5910f77a819..ee9f5a1d072 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -353,7 +353,7 @@ if (empty($reshook)) } // Extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && method_exists($lines[$i], 'fetch_optionals')) { + if (method_exists($lines[$i], 'fetch_optionals')) { $lines[$i]->fetch_optionals(); $array_options = $lines[$i]->array_options; } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 3e69fbc167f..52bb42c4526 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1063,7 +1063,7 @@ class SupplierProposal extends CommonObject $action = 'update'; // Actions on extra fields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -2116,16 +2116,13 @@ class SupplierProposal extends CommonObject // Removed extrafields if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used - { - $result = $this->deleteExtraFields(); - if ($result < 0) - { - $error++; - $errorflag = -4; - dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); - } - } + $result = $this->deleteExtraFields(); + if ($result < 0) + { + $error++; + $errorflag = -4; + dol_syslog(get_class($this)."::delete erreur ".$errorflag." ".$this->error, LOG_ERR); + } } if (!$error) @@ -3106,7 +3103,7 @@ class SupplierProposalLine extends CommonObjectLine { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.'supplier_proposaldet'); - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) @@ -3155,7 +3152,7 @@ class SupplierProposalLine extends CommonObjectLine if ($this->db->query($sql)) { // Remove extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) @@ -3277,7 +3274,7 @@ class SupplierProposalLine extends CommonObjectLine $resql = $this->db->query($sql); if ($resql) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index 863c0c03072..172309a233e 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -408,11 +408,9 @@ class Ticket extends CommonObject //Update extrafield if (!$error) { - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { // For avoid conflicts if trigger used - $result = $this->insertExtraFields(); - if ($result < 0) { - $error++; - } + $result = $this->insertExtraFields(); + if ($result < 0) { + $error++; } } @@ -838,11 +836,9 @@ class Ticket extends CommonObject if (!$error) { // Update extrafields - if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) { // For avoid conflicts if trigger used - $result = $this->insertExtraFields(); - if ($result < 0) { - $error++; - } + $result = $this->insertExtraFields(); + if ($result < 0) { + $error++; } } diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index f944083f6c5..24bf871af1f 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1094,7 +1094,7 @@ class User extends CommonObject } // Remove extrafields - if ((!$error) && (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED))) // For avoid conflicts if trigger used + if (!$error) { $result = $this->deleteExtraFields(); if ($result < 0) @@ -1762,7 +1762,7 @@ class User extends CommonObject $action = 'update'; // Actions on extra fields - if (!$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) + if (!$error) { $result = $this->insertExtraFields(); if ($result < 0) From 86928efb950e88fc55fd2222435eb5bc7bb68c26 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 13:35:40 +0200 Subject: [PATCH 58/76] Var not defined --- htdocs/core/class/html.formfile.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d4e6620c0da..075fb95066b 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -971,6 +971,7 @@ class FormFile // Get object entity if (!empty($conf->multicompany->enabled)) { + $regs = array(); preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs); $entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default } From 3a9add0e7078508ffd79369a659449bfa918edb2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 13:37:43 +0200 Subject: [PATCH 59/76] FIX #13663 --- htdocs/compta/facture/class/facture.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index c2c82424b77..f9285eb2d9c 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1434,9 +1434,10 @@ class Facture extends CommonInvoice $txttoshow = ($user->socid > 0 ? $this->note_public : $this->note_private); if ($txttoshow) { - $notetoshow = $langs->trans("ViewPrivateNote").':
'.dol_string_nohtmltag($txttoshow, 1); + //$notetoshow = $langs->trans("ViewPrivateNote").':
'.dol_string_nohtmltag($txttoshow, 1); + $notetoshow = $langs->trans("ViewPrivateNote").':
'.$txttoshow; $result .= ' '; - $result .= ''; + $result .= ''; $result .= img_picto('', 'note'); $result .= ''; //$result.=img_picto($langs->trans("ViewNote"),'object_generic'); From 436362502c3be8740d03ffe561e8a2954fdcd818 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 13:41:51 +0200 Subject: [PATCH 60/76] CSS --- htdocs/loan/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php index 9e7b8f2565a..3e96a33c931 100644 --- a/htdocs/loan/card.php +++ b/htdocs/loan/card.php @@ -475,7 +475,7 @@ if ($id > 0) print '
'; print '
'; - print '
'.$langs->trans("LastUsersCreated", min($num, $max)).''.$langs->trans("FullList").''.$langs->trans("FullList").'
'.$obj->login.''.$obj->login.'"; if ($obj->fk_soc) { From b6786c515a68bc6a1ede800633b2810fee61b97e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 22 Apr 2020 22:12:53 +0200 Subject: [PATCH 45/76] picto --- htdocs/user/home.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 4bb99e4c261..4c46c502acc 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -61,7 +61,7 @@ $hookmanager->initHooks(array('userhome')); llxHeader(); -print load_fiche_titre($langs->trans("MenuUsersAndGroups")); +print load_fiche_titre($langs->trans("MenuUsersAndGroups"), '', 'user'); print '
'; From 4220d6b253d1626d73920072de291ef30c97aeba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Apr 2020 00:38:42 +0200 Subject: [PATCH 46/76] actioncomm note deprecated --- htdocs/comm/action/class/actioncomm.class.php | 15 +++++++-------- test/phpunit/ActionCommTest.php | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 8c1e2051a81..09c114375b1 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -380,7 +380,7 @@ class ActionComm extends CommonObject // Clean parameters $this->label = dol_trunc(trim($this->label), 128); $this->location = dol_trunc(trim($this->location), 128); - $this->note = dol_htmlcleanlastbr(trim($this->note)); + $this->note_private = dol_htmlcleanlastbr(trim(empty($this->note_private) ? $this->note : $this->note_private)); if (empty($this->percentage)) $this->percentage = 0; if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0; if (empty($this->fulldayevent)) $this->fulldayevent = 0; @@ -488,7 +488,7 @@ class ActionComm extends CommonObject $sql .= ($this->ref_ext ? ("'".$this->db->idate($this->ref_ext)."'") : "null").", "; $sql .= ((isset($this->socid) && $this->socid > 0) ? $this->socid : "null").", "; $sql .= ((isset($this->fk_project) && $this->fk_project > 0) ? $this->fk_project : "null").", "; - $sql .= " '".$this->db->escape($this->note_private ? $this->note_private : $this->note)."', "; + $sql .= " '".$this->db->escape($this->note_private)."', "; $sql .= ((isset($this->contactid) && $this->contactid > 0) ? $this->contactid : "null").", "; $sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", "; $sql .= ($userownerid > 0 ? $userownerid : "null").", "; @@ -993,7 +993,7 @@ class ActionComm extends CommonObject // Clean parameters $this->label = trim($this->label); - $this->note = trim($this->note); + $this->note_private = dol_htmlcleanlastbr(trim(empty($this->note_private) ? $this->note : $this->note_private)); if (empty($this->percentage)) $this->percentage = 0; if (empty($this->priority) || !is_numeric($this->priority)) $this->priority = 0; if (empty($this->transparency)) $this->transparency = 0; @@ -1027,7 +1027,7 @@ class ActionComm extends CommonObject $sql .= ", datep = ".(strval($this->datep) != '' ? "'".$this->db->idate($this->datep)."'" : 'null'); $sql .= ", datep2 = ".(strval($this->datef) != '' ? "'".$this->db->idate($this->datef)."'" : 'null'); $sql .= ", durationp = ".(isset($this->durationp) && $this->durationp >= 0 && $this->durationp != '' ? "'".$this->db->escape($this->durationp)."'" : "null"); // deprecated - $sql .= ", note = '".$this->db->escape($this->note_private ? $this->note_private : $this->note)."'"; + $sql .= ", note = '".$this->db->escape($this->note_private)."'"; $sql .= ", fk_project =".($this->fk_project > 0 ? $this->fk_project : "null"); $sql .= ", fk_soc =".($socid > 0 ? $socid : "null"); $sql .= ", fk_contact =".($contactid > 0 ? $contactid : "null"); @@ -1406,8 +1406,8 @@ class ActionComm extends CommonObject $tooltip .= '
'.$langs->trans('Type').': '.$labeltype; if (!empty($this->location)) $tooltip .= '
'.$langs->trans('Location').': '.$this->location; - if (!empty($this->note)) - $tooltip .= '
'.$langs->trans('Note').': '.(dol_textishtml($this->note) ? str_replace(array("\r", "\n"), "", $this->note) : str_replace(array("\r", "\n"), '
', $this->note)); + if (!empty($this->note_private)) + $tooltip .= '
'.$langs->trans('Note').': '.(dol_textishtml($this->note_private) ? str_replace(array("\r", "\n"), "", $this->note_private) : str_replace(array("\r", "\n"), '
', $this->note_private)); $linkclose = ''; if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) $linkclose = ' style="background-color:#'.$this->type_color.'"'; @@ -1940,8 +1940,7 @@ class ActionComm extends CommonObject $this->location = 'Location'; $this->transparency = 1; // 1 means opaque $this->priority = 1; - $this->note = "This is a 'public' note"; - $this->note_public = "This is a 'public' note."; + //$this->note_public = "This is a 'public' note."; $this->note_private = "This is a 'private' note."; $this->userownerid = $user->id; diff --git a/test/phpunit/ActionCommTest.php b/test/phpunit/ActionCommTest.php index 6bb7f12250d..34d67341afb 100644 --- a/test/phpunit/ActionCommTest.php +++ b/test/phpunit/ActionCommTest.php @@ -140,7 +140,7 @@ class ActionCommTest extends PHPUnit\Framework\TestCase $localobject->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...) $localobject->code = 'AC_PHPUNITTEST'; $localobject->label = 'This is a description'; - $localobject->note = 'This is note'; + $localobject->note_private = 'This is note'; $localobject->fk_project = 0; $localobject->datep = $now; $localobject->datef = $now; From 177008ab65a06221663e496809e904ec2363ae8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 23 Apr 2020 00:45:33 +0200 Subject: [PATCH 47/76] actioncomm note deprecated --- htdocs/comm/action/card.php | 9 ++++----- htdocs/comm/action/class/actioncomm.class.php | 12 ++++++------ htdocs/comm/action/list.php | 7 +++---- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index fb07acbd337..716e02ae678 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -317,7 +317,7 @@ if (empty($reshook) && $action == 'add') if (GETPOST("doneby") > 0) $object->userdoneid = GETPOST("doneby", "int"); } - $object->note = trim(GETPOST("note")); + $object->note_private = trim(GETPOST("note")); if (isset($_POST["contactid"])) $object->contact = $contact; @@ -465,7 +465,6 @@ if (empty($reshook) && $action == 'update') $object->contactid = key($object->socpeopleassigned); } $object->fk_project = GETPOST("projectid", 'int'); - $object->note = GETPOST("note", "none"); // deprecated $object->note_private = GETPOST("note", "none"); $object->fk_element = GETPOST("fk_element", "int"); $object->elementtype = GETPOST("elementtype", "alphanohtml"); @@ -1122,7 +1121,7 @@ if ($action == 'create') // Description print '
'.$langs->trans("Description").''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', (GETPOST('note', 'none') ?GETPOST('note', 'none') : $object->note), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); + $doleditor = new DolEditor('note', (GETPOST('note', 'none') ?GETPOST('note', 'none') : $object->note_private), '', 180, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_4, '90%'); $doleditor->Create(); print '
'.$langs->trans("Description").''; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; - $doleditor = new DolEditor('note', $object->note, '', 200, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_5, '90%'); + $doleditor = new DolEditor('note', $object->note_private, '', 200, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_5, '90%'); $doleditor->Create(); print '
'; - $text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note, 0)); - print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note); + $text = dolGetFirstLineOfText(dol_string_nohtmltag($actionstatic->note_private, 0)); + print $form->textwithtooltip(dol_trunc($text, 40), $actionstatic->note_private); print '
'; + print '
'; // Capital if ($action == 'edit') From 6819255b764a2a004ee10770dde354893c9b9f37 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 13:49:18 +0200 Subject: [PATCH 61/76] FIX #13650 --- htdocs/core/modules/modFournisseur.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/modFournisseur.class.php b/htdocs/core/modules/modFournisseur.class.php index 4b7c8ff3ed2..b8539ad41c1 100644 --- a/htdocs/core/modules/modFournisseur.class.php +++ b/htdocs/core/modules/modFournisseur.class.php @@ -346,7 +346,10 @@ class modFournisseur extends DolibarrModules case 'sellist': $tmp=''; $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null - if ($tmpparam['options'] && is_array($tmpparam['options'])) $tmp=array_shift(array_keys($tmpparam['options'])); + if ($tmpparam['options'] && is_array($tmpparam['options'])) { + $var=array_keys($tmpparam['options']); + $tmp=array_shift($var); + } if (preg_match('/[a-z0-9_]+:[a-z0-9_]+:[a-z0-9_]+/', $tmp)) $typeFilter="List:".$tmp; break; } From defef24c3c39296e1f99bcece7c2a9fc8c6e0b92 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 13:57:27 +0200 Subject: [PATCH 62/76] Fix regression --- htdocs/product/stock/class/entrepot.class.php | 8 ++++---- test/phpunit/EntrepotTest.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index db2f84db15a..5f98de4993b 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -184,10 +184,10 @@ class Entrepot extends CommonObject $error = 0; - $this->libelle = trim($this->libelle); + if (empty($this->label)) $this->label = $this->libelle; // For backward compatibility - // Si libelle non defini, erreur - if ($this->libelle == '') + $this->label = trim($this->label); + if ($this->label == '') { $this->error = "ErrorFieldRequired"; return 0; @@ -198,7 +198,7 @@ class Entrepot extends CommonObject $this->db->begin(); $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)"; - $sql .= " VALUES ('".$this->db->escape($this->libelle)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; + $sql .= " VALUES ('".$this->db->escape($this->label)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); $result = $this->db->query($sql); diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index f5468d49c4b..45845cc8033 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -139,7 +139,7 @@ class EntrepotTest extends PHPUnit\Framework\TestCase $result=$localobject->create($user); print __METHOD__." result=".$result."\n"; - $this->assertLessThanOrEqual($result, 0); + $this->assertGreaterThan(0, $result); return $result; } From 098b7828faa7055a0143163aa808a6fbaf1e5960 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 13:59:40 +0200 Subject: [PATCH 63/76] Removed useless test --- test/phpunit/EntrepotTest.php | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/test/phpunit/EntrepotTest.php b/test/phpunit/EntrepotTest.php index 45845cc8033..2ab2fc2aff3 100644 --- a/test/phpunit/EntrepotTest.php +++ b/test/phpunit/EntrepotTest.php @@ -242,24 +242,4 @@ class EntrepotTest extends PHPUnit\Framework\TestCase return $result; } - - /** - * testEntrepotStatic - * - * @return void - */ - public function testEntrepotStatic() - { - global $conf,$user,$langs,$db; - $conf=$this->savconf; - $user=$this->savuser; - $langs=$this->savlangs; - $db=$this->savdb; - - $localobject=new Entrepot($db); - - //$this->assertLessThan(1, 0); - - return; - } } From 882b39628f81710491c61258b9993bac76adca75 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Apr 2020 15:50:42 +0200 Subject: [PATCH 64/76] fix: uniformize extrafeild replacemnt for ODT docs --- .../core/class/commondocgenerator.class.php | 88 +++++++------------ .../task/doc/doc_generic_task_odt.modules.php | 25 ++++-- 2 files changed, 46 insertions(+), 67 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index a5cb9bf7d35..2317636f42a 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -170,12 +170,13 @@ abstract class CommonDocGenerator * * @param Societe $object Object * @param Translate $outputlangs Language object for output + * @param string $array_key Name of the key for return array * @return array Array of substitution key->code */ - public function get_substitutionarray_thirdparty($object, $outputlangs) + public function get_substitutionarray_thirdparty($object, $outputlangs, $array_key = 'company') { // phpcs:enable - global $conf; + global $conf, $extrafields; if (empty($object->country) && !empty($object->country_code)) { @@ -221,27 +222,14 @@ abstract class CommonDocGenerator 'company_default_bank_bic'=>$object->bank_account->bic ); - // Retrieve extrafields - if (is_array($object->array_options) && count($object->array_options)) - { - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields = new ExtraFields($this->db); - $extrafields->fetch_name_optionals_label($object->table_element, true); - $object->fetch_optionals(); + // Retrieve extrafields + if (is_array($object->array_options) && count($object->array_options)) + { + $object->fetch_optionals(); - foreach ($extrafields->attributes[$object->table_element]['label'] as $key=>$label) - { - if ($extrafields->attributes[$object->table_element]['type'][$key] == 'price') - { - $object->array_options['options_'.$key] = price($object->array_options['options_'.$key], 0, $outputlangs, 0, 0, -1, $conf->currency); - } - elseif ($extrafields->attributes[$object->table_element]['type'][$key] == 'select' || $extrafields->attributes[$object->table_element]['type'][$key] == 'checkbox') - { - $object->array_options['options_'.$key] = $extrafields->attributes[$object->table_element]['param'][$key]['options'][$object->array_options['options_'.$key]]; - } - $array_thirdparty = array_merge($array_thirdparty, array('company_options_'.$key => $object->array_options ['options_'.$key])); - } - } + $array_thirdparty = $this->fill_substitutionarray_with_extrafields($object, $array_thirdparty, $extrafields, $array_key, $outputlangs); + + } return $array_thirdparty; } @@ -251,13 +239,13 @@ abstract class CommonDocGenerator * * @param Contact $object contact * @param Translate $outputlangs object for output - * @param array $array_key Name of the key for return array + * @param string $array_key Name of the key for return array * @return array Array of substitution key->code */ public function get_substitutionarray_contact($object, $outputlangs, $array_key = 'object') { // phpcs:enable - global $conf; + global $conf, $extrafields; if (empty($object->country) && !empty($object->country_code)) { @@ -298,24 +286,14 @@ abstract class CommonDocGenerator $array_key.'_civility' => $object->civility, ); - // Retrieve extrafields - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields = new ExtraFields($this->db); - $extrafields->fetch_name_optionals_label($object->table_element, true); - $object->fetch_optionals(); + // Retrieve extrafields + if (is_array($object->array_options) && count($object->array_options)) + { + $object->fetch_optionals(); - foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $label) - { - if ($extrafields->attributes[$object->table_element]['type'][$key] == 'price') - { - $object->array_options['options_'.$key] = price($object->array_options ['options_'.$key], 0, $outputlangs, 0, 0, - 1, $conf->currency); - } - elseif ($extrafields->attributes[$object->table_element]['type'][$key] == 'select' || $extrafields->attributes[$object->table_element]['type'][$key] == 'checkbox') - { - $object->array_options['options_'.$key] = $extrafields->attributes[$object->table_element]['param'][$key]['options'][$object->array_options['options_'.$key]]; - } - $array_contact = array_merge($array_contact, array($array_key.'_options_'.$key => $object->array_options['options_'.$key])); - } + $array_contact = $this->fill_substitutionarray_with_extrafields($object, $array_contact, $extrafields, $array_key, $outputlangs); + + } return $array_contact; } @@ -370,7 +348,7 @@ abstract class CommonDocGenerator public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object') { // phpcs:enable - global $conf; + global $conf, $extrafields; $sumpayed = $sumdeposit = $sumcreditnote = ''; $already_payed_all = 0; @@ -528,14 +506,10 @@ abstract class CommonDocGenerator // Retrieve extrafields if (is_array($object->array_options) && count($object->array_options)) { - $extrafieldkey = $object->element; - - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields = new ExtraFields($this->db); - $extrafields->fetch_name_optionals_label($extrafieldkey, true); $object->fetch_optionals(); $resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs); + } return $resarray; @@ -605,7 +579,7 @@ abstract class CommonDocGenerator } // Retrieve extrafields - $extrafieldkey = $line->element; + $extrafieldkey = $line->table_element; $array_key = "line"; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $extrafields = new ExtraFields($this->db); @@ -672,7 +646,7 @@ abstract class CommonDocGenerator public function get_substitutionarray_shipment($object, $outputlangs, $array_key = 'object') { // phpcs:enable - global $conf; + global $conf, $extrafields; dol_include_once('/core/lib/product.lib.php'); $object->list_delivery_methods($object->shipping_method_id); $calculatedVolume = ($object->trueWidth * $object->trueHeight * $object->trueDepth); @@ -708,16 +682,14 @@ abstract class CommonDocGenerator $array_shipment[$array_key.'_total_vat_'.$line->tva_tx] += $line->total_tva; } - // Retrieve extrafields - if (is_array($object->array_options) && count($object->array_options)) - { - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields = new ExtraFields($this->db); - $extrafields->fetch_name_optionals_label('expedition', true); - $object->fetch_optionals(); + // Retrieve extrafields + if (is_array($object->array_options) && count($object->array_options)) + { + $object->fetch_optionals(); - $array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs); - } + $array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs); + + } return $array_shipment; } diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 8a38450697f..1aa8f05d9df 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -130,7 +130,7 @@ class doc_generic_task_odt extends ModelePDFTask public function get_substitutionarray_object($object, $outputlangs, $array_key = 'object') { // phpcs:enable - global $conf; + global $conf, $extrafields; $resarray = array( $array_key.'_id'=>$object->id, @@ -150,14 +150,10 @@ class doc_generic_task_odt extends ModelePDFTask // Retrieve extrafields if (is_array($object->array_options) && count($object->array_options)) { - $extrafieldkey = $object->element; - - require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; - $extrafields = new ExtraFields($this->db); - $extrafields->fetch_name_optionals_label($extrafieldkey, true); $object->fetch_optionals(); $resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs); + } return $resarray; @@ -169,14 +165,15 @@ class doc_generic_task_odt extends ModelePDFTask * * @param array $task Task Object * @param Translate $outputlangs Lang object to use for output + * @param string $array_key Name of the key for return array * @return array Return a substitution array */ - public function get_substitutionarray_tasks($task, $outputlangs) + public function get_substitutionarray_tasks($task, $outputlangs, $array_key = 'task') { // phpcs:enable - global $conf; + global $conf, $extrafields; - return array( + $resarray = array( 'task_ref'=>$task->ref, 'task_fk_project'=>$task->fk_project, 'task_projectref'=>$task->projectref, @@ -192,6 +189,16 @@ class doc_generic_task_odt extends ModelePDFTask 'task_note_private'=>$task->note_private, 'task_note_public'=>$task->note_public ); + + // Retrieve extrafields + if (is_array($task->array_options) && count($task->array_options)) + { + $task->fetch_optionals(); + + $resarray = $this->fill_substitutionarray_with_extrafields($task, $resarray, $extrafields, $array_key, $outputlangs); + } + + return $resarray; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 68e9d8463a101340b707d20f750206a06971a1a3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 15:52:15 +0200 Subject: [PATCH 65/76] Debug MAIN_USE_ALTERNATE_TRANSLATION_FOR variable --- htdocs/core/class/extralanguages.class.php | 26 +++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/htdocs/core/class/extralanguages.class.php b/htdocs/core/class/extralanguages.class.php index 8f61e84839c..8ae1fd0a4c7 100644 --- a/htdocs/core/class/extralanguages.class.php +++ b/htdocs/core/class/extralanguages.class.php @@ -69,7 +69,9 @@ class ExtraLanguages // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** - * Load array this->attributes + * Load array this->attributes with list of fields per object that need an alternate translation. + * You can set variable MAIN_USE_ALTERNATE_TRANSLATION_FOR=elementA:fieldname,fieldname2;elementB:... + * Example: MAIN_USE_ALTERNATE_TRANSLATION_FOR=societe:name,town;contact:firstname,lastname * * @param string $elementtype Type of element ('' = all, 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). * @param boolean $forceload Force load of extra fields whatever is status of cache. @@ -86,11 +88,25 @@ class ExtraLanguages if ($elementtype == 'contact') $elementtype = 'socpeople'; if ($elementtype == 'order_supplier') $elementtype = 'commande_fournisseur'; - $array_name_label = array( - 'societe' => array('name'=>'Name'), - 'contact' => array('firstname' => 'Firstname', 'lastname' => 'Lastname') - ); + $array_name_label = array(); + if (! empty($conf->global->MAIN_USE_ALTERNATE_TRANSLATION_FOR)) { + $tmpelement = explode(';', $conf->global->MAIN_USE_ALTERNATE_TRANSLATION_FOR); + foreach($tmpelement as $elementstring) { + $reg=array(); + preg_match('/^(.*):(.*)$/', $elementstring, $reg); + $element = $reg[1]; + $array_name_label[$element] = array(); + $tmpfields=explode(',', $reg[2]); + foreach($tmpfields as $field) { + //var_dump($fields); + //$tmpkeyvar = explode(':', $fields); + //$array_name_label[$element][$tmpkeyvar[0]] = $tmpkeyvar[1]; + $array_name_label[$element][$field] = $field; + } + } + } + //var_dump($array_name_label); $this->attributes = $array_name_label; return $array_name_label; From 55a9aa5991c3a4468ef8a90452218b6786f7b183 Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Apr 2020 15:55:37 +0200 Subject: [PATCH 66/76] fix: missing duration odt task substitution --- .../project/task/doc/doc_generic_task_odt.modules.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 1aa8f05d9df..033aee6b8fa 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -163,7 +163,7 @@ class doc_generic_task_odt extends ModelePDFTask /** * Define array with couple substitution key => substitution value * - * @param array $task Task Object + * @param Task $task Task Object * @param Translate $outputlangs Lang object to use for output * @param string $array_key Name of the key for return array * @return array Return a substitution array @@ -181,7 +181,8 @@ class doc_generic_task_odt extends ModelePDFTask 'task_label'=>$task->label, 'task_description'=>$task->description, 'task_fk_parent'=>$task->fk_parent, - 'task_duration'=>$task->duration, + 'task_duration'=>$task->convertSecondToTime(duration_effective,'allhourmin'), + 'task_planned_workload'=>convertSecondToTime($task->planned_workload,'allhourmin'), 'task_progress'=>$task->progress, 'task_public'=>$task->public, 'task_date_start'=>dol_print_date($task->date_start, 'day'), From 6dafb30ee8e57be64f2ca2c5a6f347c94476f80d Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Apr 2020 15:57:06 +0200 Subject: [PATCH 67/76] fix time duration substitution --- .../modules/project/task/doc/doc_generic_task_odt.modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 033aee6b8fa..6e96699116e 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -181,7 +181,7 @@ class doc_generic_task_odt extends ModelePDFTask 'task_label'=>$task->label, 'task_description'=>$task->description, 'task_fk_parent'=>$task->fk_parent, - 'task_duration'=>$task->convertSecondToTime(duration_effective,'allhourmin'), + 'task_duration'=>convertSecondToTime($task->duration_effective,'allhourmin'), 'task_planned_workload'=>convertSecondToTime($task->planned_workload,'allhourmin'), 'task_progress'=>$task->progress, 'task_public'=>$task->public, From 32385b75e18458a95e7c9bfde6c2659ea9ac7c8d Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Thu, 23 Apr 2020 16:18:31 +0200 Subject: [PATCH 68/76] travis --- htdocs/core/class/commondocgenerator.class.php | 4 ---- .../project/task/doc/doc_generic_task_odt.modules.php | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 2317636f42a..5c43f4f83a1 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -228,7 +228,6 @@ abstract class CommonDocGenerator $object->fetch_optionals(); $array_thirdparty = $this->fill_substitutionarray_with_extrafields($object, $array_thirdparty, $extrafields, $array_key, $outputlangs); - } return $array_thirdparty; } @@ -292,7 +291,6 @@ abstract class CommonDocGenerator $object->fetch_optionals(); $array_contact = $this->fill_substitutionarray_with_extrafields($object, $array_contact, $extrafields, $array_key, $outputlangs); - } return $array_contact; } @@ -509,7 +507,6 @@ abstract class CommonDocGenerator $object->fetch_optionals(); $resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs); - } return $resarray; @@ -688,7 +685,6 @@ abstract class CommonDocGenerator $object->fetch_optionals(); $array_shipment = $this->fill_substitutionarray_with_extrafields($object, $array_shipment, $extrafields, $array_key, $outputlangs); - } return $array_shipment; diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index 6e96699116e..ceb735dc486 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -153,7 +153,6 @@ class doc_generic_task_odt extends ModelePDFTask $object->fetch_optionals(); $resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs); - } return $resarray; @@ -181,8 +180,8 @@ class doc_generic_task_odt extends ModelePDFTask 'task_label'=>$task->label, 'task_description'=>$task->description, 'task_fk_parent'=>$task->fk_parent, - 'task_duration'=>convertSecondToTime($task->duration_effective,'allhourmin'), - 'task_planned_workload'=>convertSecondToTime($task->planned_workload,'allhourmin'), + 'task_duration'=>convertSecondToTime($task->duration_effective, 'allhourmin'), + 'task_planned_workload'=>convertSecondToTime($task->planned_workload, 'allhourmin'), 'task_progress'=>$task->progress, 'task_public'=>$task->public, 'task_date_start'=>dol_print_date($task->date_start, 'day'), From cd1368cb71202231393aeb207ddd9fcd3cdfdf72 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 17:10:40 +0200 Subject: [PATCH 69/76] Fix dispatch in ledger for various payment done in same account when there is 2 different transaction in 2 different account (backport v12) --- htdocs/accountancy/journal/bankjournal.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index e9be75990dc..06f5a56f943 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -666,7 +666,7 @@ if (! $error && $action == 'writebookkeeping') { } elseif ($tabtype[$key] == 'payment_various') { $bookkeeping->subledger_account = $k; $bookkeeping->subledger_label = $tabcompany[$key]['name']; - $bookkeeping->numero_compte = $tabpay[$obj->rowid]["account_various"]; + $bookkeeping->numero_compte = $tabpay[$key]["account_various"]; $accountingaccount->fetch(null, $bookkeeping->numero_compte, true); $bookkeeping->label_compte = $accountingaccount->label; @@ -1174,7 +1174,11 @@ if (empty($action) || $action == 'view') { //print ''.$langs->trans("ThirdpartyAccountNotDefined").''; if (! empty($tabcompany[$key]['code_compta'])) { - print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).''; + if (in_array($tabtype[$key], array('payment_various'))) { + // For such case, if subledger is not defined, we won't use subledger accounts. + print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").''; + } else { + print ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).''; } else { From 8401f68bde8672b76036192d63f26f8cc9610583 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 18:21:17 +0200 Subject: [PATCH 70/76] Update doc_generic_task_odt.modules.php --- .../project/task/doc/doc_generic_task_odt.modules.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php index ceb735dc486..c56506eb311 100644 --- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php +++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php @@ -180,8 +180,10 @@ class doc_generic_task_odt extends ModelePDFTask 'task_label'=>$task->label, 'task_description'=>$task->description, 'task_fk_parent'=>$task->fk_parent, - 'task_duration'=>convertSecondToTime($task->duration_effective, 'allhourmin'), - 'task_planned_workload'=>convertSecondToTime($task->planned_workload, 'allhourmin'), + 'task_duration'=>$task->duration_effective, + 'task_duration_formated'=>convertSecondToTime($task->duration_effective, 'allhourmin'), + 'task_planned_workload'=>$task->planned_workload, + 'task_planned_workload_formated'=>convertSecondToTime($task->planned_workload, 'allhourmin'), 'task_progress'=>$task->progress, 'task_public'=>$task->public, 'task_date_start'=>dol_print_date($task->date_start, 'day'), From 73ddfb1c81a27ab1e7e69f3d3d597983ecdd9558 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 18:33:25 +0200 Subject: [PATCH 71/76] Use label instead of libelle --- test/phpunit/MouvementStockTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/phpunit/MouvementStockTest.php b/test/phpunit/MouvementStockTest.php index d095736042b..85137234a3b 100644 --- a/test/phpunit/MouvementStockTest.php +++ b/test/phpunit/MouvementStockTest.php @@ -148,13 +148,13 @@ class MouvementStockTest extends PHPUnit\Framework\TestCase // We create a product for tests $warehouse1=new Entrepot($db); $warehouse1->initAsSpecimen(); - $warehouse1->libelle.=' 1'; + $warehouse1->label.=' 1'; $warehouse1->description.=' 1'; $warehouse1id=$warehouse1->create($user); $warehouse2=new Entrepot($db); $warehouse2->initAsSpecimen(); - $warehouse2->libelle.=' 2'; + $warehouse2->label.=' 2'; $warehouse2->description.=' 2'; $warehouse2id=$warehouse2->create($user); From 0aa0d62f43d56987126f240dabd98aeb073a57d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 18:42:59 +0200 Subject: [PATCH 72/76] Fix constant --- htdocs/api/class/api_setup.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/api/class/api_setup.class.php b/htdocs/api/class/api_setup.class.php index f4c73c1b8ec..945a0efdf46 100644 --- a/htdocs/api/class/api_setup.class.php +++ b/htdocs/api/class/api_setup.class.php @@ -1415,7 +1415,7 @@ class Setup extends DolibarrApi * @url GET conf/{constantname} * * @throws RestException 403 Forbidden - * @throws RestException 500 Error Bad or unknown value for constname + * @throws RestException 500 Error Bad or unknown value for constantname */ public function getConf($constantname) { @@ -1427,7 +1427,7 @@ class Setup extends DolibarrApi } if (!preg_match('/^[a-zA-Z0-9_]+$/', $constantname) || ! isset($conf->global->$constantname)) { - throw new RestException(500, 'Error Bad or unknown value for constname'); + throw new RestException(500, 'Error Bad or unknown value for constantname'); } if (preg_match('/(_pass|password|secret|_key|key$)/i', $constantname)) { throw new RestException(403, 'Forbidden'); From 4e6017e5bfb2c156bd28fe1cd96ee5978bd8c2a2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 18:50:20 +0200 Subject: [PATCH 73/76] Look and feel v12 --- htdocs/api/admin/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php index 73041f6c386..d0a0e79c855 100644 --- a/htdocs/api/admin/index.php +++ b/htdocs/api/admin/index.php @@ -153,7 +153,7 @@ $urlwithroot = $urlwithouturlroot.DOL_URL_ROOT; // This is to use external domai // Show message $message = ''; $url = $urlwithroot.'/api/index.php/login?login=auserlogin&password=thepassword[&reset=1]'; -$message .= $langs->trans("UrlToGetKeyToUseAPIs").':
'; +$message .= ''.$langs->trans("UrlToGetKeyToUseAPIs").':
'; $message .= img_picto('', 'globe').' '.$url; print $message; print '
'; From 548f3007cffcddd67b41391611c5456e61b21977 Mon Sep 17 00:00:00 2001 From: Scrutinizer Auto-Fixer Date: Thu, 23 Apr 2020 16:55:10 +0000 Subject: [PATCH 74/76] Scrutinizer Auto-Fixes This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com --- htdocs/admin/facture_situation.php | 36 ++++++++--------- htdocs/compta/facture/card.php | 38 +++++++++--------- htdocs/compta/facture/class/facture.class.php | 40 +++++++++---------- .../core/class/commondocgenerator.class.php | 2 +- htdocs/core/lib/website.lib.php | 2 +- htdocs/core/modules/modSociete.class.php | 2 +- htdocs/product/class/product.class.php | 2 +- htdocs/product/composition/card.php | 30 +++++++------- .../societe/class/api_thirdparties.class.php | 2 +- htdocs/user/class/usergroup.class.php | 6 +-- htdocs/user/group/perms.php | 2 +- htdocs/website/index.php | 8 ++-- 12 files changed, 85 insertions(+), 85 deletions(-) diff --git a/htdocs/admin/facture_situation.php b/htdocs/admin/facture_situation.php index ce327cc5187..223045db2e9 100644 --- a/htdocs/admin/facture_situation.php +++ b/htdocs/admin/facture_situation.php @@ -36,13 +36,13 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; // Load translation files required by the page $langs->loadLangs(array('admin', 'errors', 'other', 'bills')); -if (! $user->admin) accessforbidden(); +if (!$user->admin) accessforbidden(); $action = GETPOST('action', 'alpha'); $value = GETPOST('value', 'alpha'); $label = GETPOST('label', 'alpha'); $scandir = GETPOST('scan_dir', 'alpha'); -$type='invoice'; +$type = 'invoice'; /* @@ -57,17 +57,17 @@ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php'; * View */ -$dirmodels=array_merge(array('/'), (array) $conf->modules_parts['models']); +$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); llxHeader( "", $langs->trans("BillsSetup"), 'EN:Invoice_Configuration|FR:Configuration_module_facture|ES:ConfiguracionFactura' ); -$form=new Form($db); +$form = new Form($db); -$linkback=''.$langs->trans("BackToModuleList").''; +$linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("BillsSetup"), $linkback, 'title_setup'); $head = invoice_admin_prepare_head(); @@ -106,12 +106,12 @@ $arrayAvailableType = array( ); $selected = array(); $implodeglue = '+'; -if(!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})){ +if (!empty($conf->global->{$confkey}) && !is_array($conf->global->{$confkey})) { $selected = explode('+', $conf->global->{$confkey}); } -$curentInput = (empty($inputCount)?1:($inputCount+1)); -$formSelectInvoiceType = $form->selectarray('value'. $curentInput, $arrayAvailableType, $selected, 1); +$curentInput = (empty($inputCount) ? 1 : ($inputCount + 1)); +$formSelectInvoiceType = $form->selectarray('value'.$curentInput, $arrayAvailableType, $selected, 1); _printInputFormPart($confkey, $langs->trans('AllowedInvoiceForRetainedWarranty'), '', array(), $formSelectInvoiceType); //_printOnOff('INVOICE_RETAINED_WARRANTY_LIMITED_TO_SITUATION', $langs->trans('RetainedwarrantyOnlyForSituation')); @@ -126,7 +126,7 @@ $metas = array( _printInputFormPart('INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT', $langs->trans('RetainedwarrantyDefaultPercent'), '', $metas); // Conditions paiements -$inputCount = empty($inputCount)?1:($inputCount+1); +$inputCount = empty($inputCount) ? 1 : ($inputCount + 1); print '
'; print ''; print ''; @@ -178,7 +178,7 @@ function _printOnOff($confkey, $title = false, $desc = '') global $langs; print ''; - print ''; - if($conf->global->INVOICE_USE_RETAINED_WARRANTY){ + if ($conf->global->INVOICE_USE_RETAINED_WARRANTY) { $rwStyle = 'display:none;'; - if(in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)){ + if (in_array(GETPOST('type', 'int'), $retainedWarrantyInvoiceAvailableType)) { $rwStyle = ''; } $retained_warranty = GETPOST('retained_warranty', 'int'); - if(empty($retained_warranty)){ - if(!empty($objectsrc->retained_warranty)){ // use previous situation value + if (empty($retained_warranty)) { + if (!empty($objectsrc->retained_warranty)) { // use previous situation value $retained_warranty = $objectsrc->retained_warranty; } } - $retained_warranty_js_default = !empty($retained_warranty)?$retained_warranty:$conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; + $retained_warranty_js_default = !empty($retained_warranty) ? $retained_warranty : $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_PERCENT; print ''; + if ($num == 0) print ''; $MAX = 100; while ($i < min($num, $MAX)) { $objp = $db->fetch_object($resql); - if($objp->rowid != $id) + if ($objp->rowid != $id) { // check if a product is not already a parent product of this one - $prod_arbo=new Product($db); - $prod_arbo->id=$objp->rowid; + $prod_arbo = new Product($db); + $prod_arbo->id = $objp->rowid; // This type is not supported (not required to have virtual products working). if ($prod_arbo->type == Product::TYPE_ASSEMBLYKIT || $prod_arbo->type == Product::TYPE_STOCKKIT) { - $is_pere=0; + $is_pere = 0; $prod_arbo->get_sousproduits_arbo(); // associations sousproduits $prods_arbo = $prod_arbo->get_arbo_each_prod(); if (count($prods_arbo) > 0) { - foreach($prods_arbo as $key => $value) + foreach ($prods_arbo as $key => $value) { - if ($value[1]==$id) + if ($value[1] == $id) { - $is_pere=1; + $is_pere = 1; } } } - if ($is_pere==1) + if ($is_pere == 1) { $i++; continue; diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 1100432c854..c50a746c444 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -129,7 +129,7 @@ class Thirdparties extends DolibarrApi $sql .= " FROM ".MAIN_DB_PREFIX."societe as t"; if ($category > 0) { if ($mode != 4) $sql .= ", ".MAIN_DB_PREFIX."categorie_societe as c"; - if (!in_array($mode, array(1,2,3))) $sql .= ", ".MAIN_DB_PREFIX."categorie_fournisseur as cc"; + if (!in_array($mode, array(1, 2, 3))) $sql .= ", ".MAIN_DB_PREFIX."categorie_fournisseur as cc"; } if ((!DolibarrApiAccess::$user->rights->societe->client->voir && !$socids) || $search_sale > 0) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; // We need this table joined to the select in order to filter by sale $sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st"; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 2cf11c3851f..bc5396e9f51 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -118,12 +118,12 @@ class UserGroup extends CommonObject /** * @var array List of child tables. To test if we can delete object. */ - protected $childtables=array(); + protected $childtables = array(); /** * @var array List of child tables. To know object to delete on cascade. */ - protected $childtablesoncascade = array('usergroup_rights','usergroup_user'); + protected $childtablesoncascade = array('usergroup_rights', 'usergroup_user'); /** @@ -162,7 +162,7 @@ class UserGroup extends CommonObject $this->name = $this->nom; // For compatibility with field name - if($result) + if ($result) { if ($load_members) { diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 8efd7ef38e2..70030dbf1af 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -77,7 +77,7 @@ if (empty($reshook)) { $editgroup = new Usergroup($db); $result = $editgroup->fetch($id); if ($result > 0) { - $result= $editgroup->addrights($rights, $module, '', $entity); + $result = $editgroup->addrights($rights, $module, '', $entity); if ($result < 0) { setEventMessages($editgroup->error, $editgroup->errors, 'errors'); } diff --git a/htdocs/website/index.php b/htdocs/website/index.php index 32c51d3eef1..0f684ca5232 100644 --- a/htdocs/website/index.php +++ b/htdocs/website/index.php @@ -327,8 +327,8 @@ if ($cancel) $savbacktopage = $backtopage; $backtopage = $_SERVER["PHP_SELF"].'?file_manager=1&website='.$websitekey.'&pageid='.$pageid.(GETPOST('section_dir', 'alpha') ? '§ion_dir='.urlencode(GETPOST('section_dir', 'alpha')) : ''); // used after a confirm_deletefile into actions_linkedfiles.inc.php -if ($sortfield) $backtopage.='&sortfield='.$sortfield; -if ($sortorder) $backtopage.='&sortorder='.$sortorder; +if ($sortfield) $backtopage .= '&sortfield='.$sortfield; +if ($sortorder) $backtopage .= '&sortorder='.$sortorder; include DOL_DOCUMENT_ROOT.'/core/actions_linkedfiles.inc.php'; $backtopage = $savbacktopage; @@ -2133,7 +2133,7 @@ print '
'; // Add a margin under toolbar ? $style = ''; -if ($action != 'preview' && $action != 'editcontent' && $action != 'editsource' && ! GETPOST('createpagefromclone', 'alphanohtml')) $style = ' margin-bottom: 5px;'; +if ($action != 'preview' && $action != 'editcontent' && $action != 'editsource' && !GETPOST('createpagefromclone', 'alphanohtml')) $style = ' margin-bottom: 5px;'; if (!GETPOST('hide_websitemenu')) @@ -2437,7 +2437,7 @@ if (!GETPOST('hide_websitemenu')) $preselectedlanguage = GETPOST('newlang', 'aZ09') ? GETPOST('newlang', 'aZ09') : ($objectpage->lang ? $objectpage->lang : $langs->defaultlang); $onlylang = array(); if ($website->otherlang) { - foreach(explode(',', $website->otherlang) as $langkey) { + foreach (explode(',', $website->otherlang) as $langkey) { $onlylang[$langkey] = $langkey; } $textifempty = 1; From 2ba6e65feb6c29b4cbdf409629ff5fb9069e4cc6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 20:03:41 +0200 Subject: [PATCH 75/76] Fix label --- htdocs/product/stock/class/entrepot.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 5f98de4993b..9f764f7d412 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -272,6 +272,7 @@ class Entrepot extends CommonObject $error = 0; if (empty($id)) $id = $this->id; + if (empty($this->label)) $this->label = $this->libelle; // For backward compatibility // Check if new parent is already a child of current warehouse if (!empty($this->fk_parent)) @@ -285,7 +286,7 @@ class Entrepot extends CommonObject } } - $this->libelle = trim($this->libelle); + $this->label = trim($this->label); $this->description = trim($this->description); $this->lieu = trim($this->lieu); @@ -296,7 +297,7 @@ class Entrepot extends CommonObject $this->country_id = ($this->country_id > 0 ? $this->country_id : 0); $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; - $sql .= " SET ref = '".$this->db->escape($this->libelle)."'"; + $sql .= " SET ref = '".$this->db->escape($this->label)."'"; $sql .= ", fk_parent = ".(($this->fk_parent > 0) ? $this->fk_parent : "NULL"); $sql .= ", description = '".$this->db->escape($this->description)."'"; $sql .= ", statut = ".$this->statut; From 5756e3be09e2d41fb367559fe597009218941993 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 23 Apr 2020 20:45:51 +0200 Subject: [PATCH 76/76] Look and feel v12 --- htdocs/contrat/agenda.php | 13 ++++++++----- htdocs/contrat/document.php | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 2b7ca20c6e8..0055b0ba428 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -146,14 +146,16 @@ if ($id > 0) $morehtmlref .= $form->editfieldval("", 'ref', $object->ref, $object, $user->rights->contrat->creer, 'string', '', 0, 2); } + $permtoedit = 0; + $morehtmlref .= '
'; // Ref customer - $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedCustomerRef'); + $morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $permtoedit, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $permtoedit, 'string', '', null, null, '', 1, 'getFormatedCustomerRef'); // Ref supplier $morehtmlref .= '
'; - $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1); - $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); + $morehtmlref .= $form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', 0, 1); + $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $permtoedit, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; @@ -165,7 +167,8 @@ if ($id > 0) if ($user->rights->contrat->creer) { if ($action != 'classify') { - $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : '; + //$morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).''; + $morehtmlref .= ' : '; } if ($action == 'classify') { //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1); diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 330db63e30c..7d47b5102ac 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -136,6 +136,7 @@ if ($object->id) $morehtmlref .= $form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, 0, 'string', '', null, null, '', 1, 'getFormatedSupplierRef'); // Thirdparty $morehtmlref .= '
'.$langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl(1); + if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref .= ' ('.$langs->trans("OtherContracts").')'; // Project if (!empty($conf->projet->enabled)) {
'.$langs->trans('PaymentConditionsShortRetainedWarranty').' 
'.($title?$title:$langs->trans($confkey)); + print ''.($title ? $title : $langs->trans($confkey)); if (!empty($desc)) { print '
'.$langs->trans($desc).''; } @@ -206,14 +206,14 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra { global $langs, $conf, $db, $inputCount; - $inputCount = empty($inputCount)?1:($inputCount+1); - $form=new Form($db); + $inputCount = empty($inputCount) ? 1 : ($inputCount + 1); + $form = new Form($db); $defaultMetas = array( 'name' => 'value'.$inputCount ); - if ($type!='textarea') { + if ($type != 'textarea') { $defaultMetas['type'] = 'text'; $defaultMetas['value'] = $conf->global->{$confkey}; } @@ -229,9 +229,9 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra print '
'; if (!empty($help)) { - print $form->textwithtooltip(($title?$title:$langs->trans($confkey)), $langs->trans($help), 2, 1, img_help(1, '')); + print $form->textwithtooltip(($title ? $title : $langs->trans($confkey)), $langs->trans($help), 2, 1, img_help(1, '')); } else { - print $title?$title:$langs->trans($confkey); + print $title ? $title : $langs->trans($confkey); } if (!empty($desc)) { @@ -244,12 +244,12 @@ function _printInputFormPart($confkey, $title = false, $desc = '', $metas = arra print ''; print ''; - if ($type=='textarea') { + if ($type == 'textarea') { print ''; - }elseif($type=='input'){ + }elseif ($type == 'input') { print ''; } - else{ + else { // custom print $type; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e5cfb1574dc..89801a357dd 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -140,8 +140,8 @@ $isdraft = (($object->statut == Facture::STATUS_DRAFT) ? 1 : 0); $result = restrictedArea($user, 'facture', $id, '', '', 'fk_soc', $fieldid, $isdraft); // retained warranty invoice available type -$retainedWarrantyInvoiceAvailableType=array(); -if(!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { +$retainedWarrantyInvoiceAvailableType = array(); +if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { $retainedWarrantyInvoiceAvailableType = explode('+', $conf->global->INVOICE_USE_RETAINED_WARRANTY); } @@ -952,7 +952,7 @@ if (empty($reshook)) } $discount->tva_tx = abs($tva_tx); - $discount->vat_src_code =$vat_src_code; + $discount->vat_src_code = $vat_src_code; $result = $discount->create($user); if ($result < 0) @@ -1362,11 +1362,11 @@ if (empty($reshook)) $object->situation_cycle_ref = $object->newCycle(); } - if(in_array($object->type, $retainedWarrantyInvoiceAvailableType)){ + if (in_array($object->type, $retainedWarrantyInvoiceAvailableType)) { $object->retained_warranty = GETPOST('retained_warranty', 'int'); $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); } - else{ + else { $object->retained_warranty = 0; $object->retained_warranty_fk_cond_reglement = 0; } @@ -1772,15 +1772,15 @@ if (empty($reshook)) $object->origin_id = $originid; // retained warranty - if(!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) + if (!empty($conf->global->INVOICE_USE_RETAINED_WARRANTY)) { $retained_warranty = GETPOST('retained_warranty', 'int'); - if(price2num($retained_warranty) > 0) + if (price2num($retained_warranty) > 0) { - $object->retained_warranty = price2num($retained_warranty); + $object->retained_warranty = price2num($retained_warranty); } - if(GETPOST('retained_warranty_fk_cond_reglement', 'int') > 0) + if (GETPOST('retained_warranty_fk_cond_reglement', 'int') > 0) { $object->retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); } @@ -2629,10 +2629,10 @@ if (empty($reshook)) $pa_ht = $originLine->pa_ht; $label = $originLine->label; $array_options = $originLine->array_options; - if($object->type == Facture::TYPE_SITUATION){ + if ($object->type == Facture::TYPE_SITUATION) { $situation_percent = 0; } - else{ + else { $situation_percent = 100; } $fk_prev_id = ''; @@ -3393,19 +3393,19 @@ if ($action == 'create') print '
'.$langs->trans('RetainedWarranty').''; print '%'; @@ -3413,11 +3413,11 @@ if ($action == 'create') // Retained warranty payment term print '
'.$langs->trans('PaymentConditionsShortRetainedWarranty').''; $retained_warranty_fk_cond_reglement = GETPOST('retained_warranty_fk_cond_reglement', 'int'); - if(empty($retained_warranty_fk_cond_reglement)){ + if (empty($retained_warranty_fk_cond_reglement)) { $retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID; - if(!empty($objectsrc->retained_warranty_fk_cond_reglement)){ // use previous situation value + if (!empty($objectsrc->retained_warranty_fk_cond_reglement)) { // use previous situation value $retained_warranty_fk_cond_reglement = $objectsrc->retained_warranty_fk_cond_reglement; - }else{ + } else { $retained_warranty_fk_cond_reglement = $conf->global->INVOICE_SITUATION_DEFAULT_RETAINED_WARRANTY_COND_ID; } } diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 62acafe4bf9..d872b02a35d 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -813,12 +813,12 @@ class Facture extends CommonInvoice $vatrate = $line->tva_tx; if ($line->vat_src_code && !preg_match('/\(.*\)/', $vatrate)) $vatrate .= ' ('.$line->vat_src_code.')'; - if(!empty($conf->global->MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION)) { - $originid=$line->origin_id; - $origintype=$line->origin; + if (!empty($conf->global->MAIN_CREATEFROM_KEEP_LINE_ORIGIN_INFORMATION)) { + $originid = $line->origin_id; + $origintype = $line->origin; } else { - $originid=$line->id; - $origintype=$this->element; + $originid = $line->id; + $origintype = $this->element; } $result = $this->addline( @@ -3734,44 +3734,44 @@ class Facture extends CommonInvoice } if (!empty($addon)) { - dol_syslog("Call getNextNumRef with " . $addonConstName . " = " . $conf->global->FACTURE_ADDON . ", thirdparty=" . $soc->nom . ", type=" . $soc->typent_code, LOG_DEBUG); + dol_syslog("Call getNextNumRef with ".$addonConstName." = ".$conf->global->FACTURE_ADDON.", thirdparty=".$soc->nom.", type=".$soc->typent_code, LOG_DEBUG); $mybool = false; - $file = $addon . '.php'; + $file = $addon.'.php'; $classname = $addon; // Include file with class $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir . 'core/modules/' . $moduleName . '/'); + $dir = dol_buildpath($reldir.'core/modules/'.$moduleName.'/'); // Load file with numbering class (if found) - if (is_file($dir . $file) && is_readable($dir . $file)) { - $mybool |= include_once $dir . $file; + if (is_file($dir.$file) && is_readable($dir.$file)) { + $mybool |= include_once $dir.$file; } } // For compatibility if (!$mybool) { - $file = $addon . '/' . $addon . '.modules.php'; - $classname = 'mod_' . $moduleName . '_' . $addon; + $file = $addon.'/'.$addon.'.modules.php'; + $classname = 'mod_'.$moduleName.'_'.$addon; $classname = preg_replace('/\-.*$/', '', $classname); // Include file with class foreach ($conf->file->dol_document_root as $dirroot) { - $dir = $dirroot . '/core/modules/' . $moduleName . '/'; + $dir = $dirroot.'/core/modules/'.$moduleName.'/'; // Load file with numbering class (if found) - if (is_file($dir . $file) && is_readable($dir . $file)) { - $mybool |= include_once $dir . $file; + if (is_file($dir.$file) && is_readable($dir.$file)) { + $mybool |= include_once $dir.$file; } } } if (!$mybool) { - dol_print_error('', 'Failed to include file ' . $file); + dol_print_error('', 'Failed to include file '.$file); return ''; } @@ -3790,7 +3790,7 @@ class Facture extends CommonInvoice return $numref; } else { $langs->load('errors'); - print $langs->trans('Error') . ' ' . $langs->trans('ErrorModuleSetupNotComplete', $langs->transnoentitiesnoconv($moduleSourceName)); + print $langs->trans('Error').' '.$langs->trans('ErrorModuleSetupNotComplete', $langs->transnoentitiesnoconv($moduleSourceName)); return ''; } } @@ -4756,7 +4756,7 @@ class Facture extends CommonInvoice // note : we dont need to test INVOICE_USE_RETAINED_WARRANTY because if $this->retained_warranty is not empty it's because it was set when this conf was active $displayWarranty = false; - if(!empty($this->retained_warranty)) { + if (!empty($this->retained_warranty)) { $displayWarranty = true; if ($this->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION)) { @@ -4795,7 +4795,7 @@ class Facture extends CommonInvoice $retainedWarrantyAmount = 0; // Billed - retained warranty - if($this->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION)) + if ($this->type == Facture::TYPE_SITUATION && !empty($conf->global->INVOICE_RETAINED_WARRANTY_LIMITED_TO_FINAL_SITUATION)) { $displayWarranty = true; // Check if this situation invoice is 100% for real @@ -4835,7 +4835,7 @@ class Facture extends CommonInvoice $rounding = min($conf->global->MAIN_MAX_DECIMALS_UNIT, $conf->global->MAIN_MAX_DECIMALS_TOT); } - if($rounding>0){ + if ($rounding > 0) { return round($retainedWarrantyAmount, $rounding); } diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php index 5c43f4f83a1..4bcfbafa9d8 100644 --- a/htdocs/core/class/commondocgenerator.class.php +++ b/htdocs/core/class/commondocgenerator.class.php @@ -365,7 +365,7 @@ abstract class CommonDocGenerator $remain_to_pay = $sumpayed - $sumdeposit - $sumcreditnote; if ($object->fk_account > 0) { - require_once DOL_DOCUMENT_ROOT .'/compta/bank/class/account.class.php'; + require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $bank_account = new Account($this->db); $bank_account->fetch($object->fk_account); } diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 2dcabbcafaa..76e910bdecd 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -352,7 +352,7 @@ function dolWebsiteOutput($content, $contenttype = 'html', $containerid = '') $content = str_replace(' contenteditable="true"', ' contenteditable="false"', $content); - if (! empty($conf->global->WEBSITE_ADD_CSS_TO_BODY)) { + if (!empty($conf->global->WEBSITE_ADD_CSS_TO_BODY)) { $content = str_replace('entity.")"; $resql = $this->db->query($sql); diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 4f4334e4125..e245ec2cf4e 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4938,7 +4938,7 @@ class Product extends CommonObject { $filterStatus = '4'; if (isset($includedraftpoforvirtual)) $filterStatus = '0,'.$filterStatus; - $result = $this->load_stats_reception(0, $filterStatus, 1); // Use same tables than when module reception is not used. + $result = $this->load_stats_reception(0, $filterStatus, 1); // Use same tables than when module reception is not used. if ($result < 0) dol_print_error($this->db, $this->error); $stock_reception_fournisseur = $this->stats_reception['qty']; } diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index d57db91aa82..dbdb6cb6f42 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -64,14 +64,14 @@ if ($id > 0 || !empty($ref)) * Actions */ -if ($cancel) $action =''; +if ($cancel) $action = ''; // Action association d'un sousproduit if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->service->creer)) { - $error=0; + $error = 0; $maxprod = GETPOST("max_prod", 'int'); - for ($i=0; $i < $maxprod; $i++) + for ($i = 0; $i < $maxprod; $i++) { $qty = price2num(GETPOST("prod_qty_".$i, 'alpha'), 'MS'); if ($qty > 0) @@ -109,13 +109,13 @@ if ($action == 'add_prod' && ($user->rights->produit->creer || $user->rights->se } } - if (! $error) + if (!$error) { header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } } -elseif($action==='save_composed_product') +elseif ($action === 'save_composed_product') { $TProduct = GETPOST('TProduct', 'array'); if (!empty($TProduct)) @@ -540,38 +540,38 @@ if ($id > 0 || !empty($ref)) if ($resql) { $num = $db->num_rows($resql); - $i=0; + $i = 0; - if($num == 0) print '
'.$langs->trans("NoMatchFound").'
'.$langs->trans("NoMatchFound").'