From b777a0660cc68bfd254ab62ebc0761108d31c426 Mon Sep 17 00:00:00 2001 From: David Bensel <40593993+davidNDU@users.noreply.github.com> Date: Mon, 18 Jan 2021 17:31:49 +0300 Subject: [PATCH 1/5] FIX: type 'sellist' not handled properly in showInputField and showOutputField --- htdocs/core/class/commonobject.class.php | 34 +++++++++++-------- .../template/class/myobject.class.php | 2 +- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b095712d972..8aacc8880a9 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5868,8 +5868,14 @@ abstract class CommonObject } elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) { $param['options'] = array($reg[2].':'.$reg[3] => 'N'); $type = 'link'; - } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { - $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); + } elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); + $type = 'sellist'; + } elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); + $type = 'sellist'; + } elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); $type = 'sellist'; } elseif (preg_match('/varchar\((\d+)\)/', $val['type'], $reg)) { $param['options'] = array(); @@ -6036,24 +6042,20 @@ abstract class CommonObject $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid'); - if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) - { - if (strpos($InfoFieldList[4], 'extra.') !== false) - { + if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { + if (strpos($InfoFieldList[4], 'extra.') !== false) { $keyList = 'main.'.$InfoFieldList[2].' as rowid'; } else { $keyList = $InfoFieldList[2].' as rowid'; } } - if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) - { + if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) { list($parentName, $parentField) = explode('|', $InfoFieldList[3]); $keyList .= ', '.$parentField; } $fields_label = explode('|', $InfoFieldList[1]); - if (is_array($fields_label)) - { + if (is_array($fields_label)) { $keyList .= ', '; $keyList .= implode(', ', $fields_label); } @@ -6448,13 +6450,18 @@ abstract class CommonObject $param['options'] = array(); if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) $param['options'] = $val['arrayofkeyval']; - if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) - { + if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { $type = 'link'; $param['options'] = array($reg[1].':'.$reg[2]=>$reg[1].':'.$reg[2]); } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); $type = 'sellist'; + } elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N'); + $type = 'sellist'; + } elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[1].':'.$reg[2] => 'N'); + $type = 'sellist'; } $langfile = $val['langfile']; @@ -6545,8 +6552,7 @@ abstract class CommonObject $selectkey = "rowid"; $keyList = 'rowid'; - if (count($InfoFieldList) >= 3) - { + if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { $selectkey = $InfoFieldList[2]; $keyList = $InfoFieldList[2].' as rowid'; } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index a15f0f67fe9..b4206c5ea9d 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -70,7 +70,7 @@ class MyObject extends CommonObject /** - * 'type' if the field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') + * 'type' field format ('integer', 'integer:ObjectClass:PathToClass[:AddCreateButtonOrNot[:Filter]]', 'sellist:TableName:LabelFieldName[:KeyFieldName[:KeyFieldParent[:Filter]]]', 'varchar(x)', 'double(24,8)', 'real', 'price', 'text', 'text:none', 'html', 'date', 'datetime', 'timestamp', 'duration', 'mail', 'phone', 'url', 'password') * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.nature:is:NULL)" * 'label' the translation key. * 'picto' is code of a picto to show before value in forms From 5f15c339c7f7168208b469dadc70f2a5c0a10e01 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 18 Jan 2021 16:03:27 +0100 Subject: [PATCH 2/5] Update dolibarr /var/run/php/php7.0-fpm.sock --- dev/setup/nginx/dolibarr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/setup/nginx/dolibarr b/dev/setup/nginx/dolibarr index 82b8d2dc7bf..ffda5fae609 100644 --- a/dev/setup/nginx/dolibarr +++ b/dev/setup/nginx/dolibarr @@ -5,13 +5,13 @@ server { root /path/to/your/htdocs; - # Optionnal + # Optional error_log /path/to/your/log/directory/nginx.error.log; access_log /path/to/your/log/directory/nginx.access.log; index index.php index.html index.htm; - # Optionnal + # Optional server_name your-fqdn.tld; location / { @@ -23,6 +23,6 @@ server { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_read_timeout 600; include fastcgi_params; - fastcgi_pass unix:/var/run/php5-fpm.sock; + fastcgi_pass unix:/var/run/php5-fpm.sock; // /var/run/php/php7.0-fpm.sock } } From ca7c5359801a5059c8463210d4222f22b75c5c13 Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 18 Jan 2021 16:11:43 +0100 Subject: [PATCH 3/5] Update barcode_EAN13.txt --- dev/resources/iso-normes/barcode_EAN13.txt | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/dev/resources/iso-normes/barcode_EAN13.txt b/dev/resources/iso-normes/barcode_EAN13.txt index 69194625126..f4496327ee4 100644 --- a/dev/resources/iso-normes/barcode_EAN13.txt +++ b/dev/resources/iso-normes/barcode_EAN13.txt @@ -1,3 +1,7 @@ +Barcode EAN 13 + +FR +== Signification des chiffres. - 2 chiffres pour le code pays ou code systeme @@ -9,6 +13,24 @@ Cette regle subit de nombreuses entorses pour ameliorer l'usage des chiffres dis Voici la liste des codes pays ou systeme : + +EN +== +Meaning of the numbers. + +- 2 digits for the country code or system code +- 5 digits for the company identifier +- 5 digits for item identifier +- 1 digit for checksum + +This rule has been twisted many times to improve the use of the available numbers. +Here is the list of country codes or system: + + + +List +==== + 00 � 13 UCC (Etats-Unis et Canada) 20 � 29 Codification interne en magasin 30 � 37 GENCOD-EAN France @@ -104,4 +126,4 @@ Voici la liste des codes pays ou systeme : 978 - 979 Livres (ISBN) 980 Refus de remboursement 981 - 982 Coupons (monnaie courante) -99 Coupons \ No newline at end of file +99 Coupons From 337c3730df76e624e4663256790891cc2006b2be Mon Sep 17 00:00:00 2001 From: UT from dolibit <45215329+dolibit-ut@users.noreply.github.com> Date: Mon, 18 Jan 2021 16:19:50 +0100 Subject: [PATCH 4/5] Update Links on GPL.txt add [EN] https://www.gnu.org/licenses/quick-guide-gplv3.en.html --- dev/resources/licence/Links on GPL.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/resources/licence/Links on GPL.txt b/dev/resources/licence/Links on GPL.txt index 0fb3b63c851..d8a5f790458 100644 --- a/dev/resources/licence/Links on GPL.txt +++ b/dev/resources/licence/Links on GPL.txt @@ -1,5 +1,6 @@ * Page with license compatibility -https://www.gnu.org/licenses/quick-guide-gplv3.fr.html +[EN] https://www.gnu.org/licenses/quick-guide-gplv3.en.html +[FR] https://www.gnu.org/licenses/quick-guide-gplv3.fr.html * FAQ on GPL license https://www.fsf.org/licensing/licenses/gpl-faq.html From 494bb3ee5ca92f22f8a9d7540628f4c5dc16e10a Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 18 Jan 2021 16:39:36 +0100 Subject: [PATCH 5/5] Fix #16010 update fournisseur.product.class.php --- htdocs/fourn/class/fournisseur.product.class.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 0f9ee04c63e..7849df7f6bb 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -280,13 +280,10 @@ class ProductFournisseur extends Product } // Multicurrency - $multicurrency_buyprice = null; $multicurrency_unitBuyPrice = null; $fk_multicurrency = null; if (!empty($conf->multicurrency->enabled)) { if (empty($multicurrency_tx)) $multicurrency_tx = 1; - if (empty($multicurrency_buyprice)) $multicurrency_buyprice = 0; - if (empty($multicurrency_buyprice)) $multicurrency_buyprice = 0; if ($multicurrency_price_base_type == 'TTC') {