From 8cdb251ca5038bc2959d68b3f41991926fc18719 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 2 Jul 2019 10:13:26 +0200 Subject: [PATCH 1/4] FIX product_use_units was set to 0 each time a conf in block other was set --- htdocs/product/admin/product.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php index 334640e87d3..4c58591e987 100644 --- a/htdocs/product/admin/product.php +++ b/htdocs/product/admin/product.php @@ -245,12 +245,12 @@ if ($action == 'set') if (! $res > 0) $error++; } -if ($action == 'other') -{ - $value = GETPOST('activate_units', 'alpha'); - $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity); - if (! $res > 0) $error++; -} +//if ($action == 'other') +//{ +// $value = GETPOST('activate_units', 'alpha'); +// $res = dolibarr_set_const($db, "PRODUCT_USE_UNITS", $value, 'chaine', 0, '', $conf->entity); +// if (! $res > 0) $error++; +//} if ($action) { From a75a2ae8e45a730e9a74ac9944acb43aac4c4ee2 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 2 Jul 2019 15:44:42 +0200 Subject: [PATCH 2/4] Fix missing hidden input and short label --- htdocs/admin/dict.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index d160793b735..6bffb7fe535 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -1889,6 +1889,9 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') { print ''; } + else{ + print ''; + } print ''; } elseif ($fieldlist[$field] == 'price' || preg_match('/^amount/i',$fieldlist[$field])) { @@ -1951,7 +1954,13 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } else { - if ($fieldlist[$field]=='sortorder') $fieldlist[$field]='position'; + + $fieldValue = isset($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''; + + if ($fieldlist[$field]=='sortorder') + { + $fieldlist[$field]='position'; + } $classtd=''; $class=''; if ($fieldlist[$field]=='code') $classtd='width100'; @@ -1972,7 +1981,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } if ($tabname == MAIN_DB_PREFIX.'c_payment_term') { $langs->load("bills"); - $transkey="PaymentCondition".strtoupper($obj->code); + $transkey="PaymentConditionShort".strtoupper($obj->code); } if ($transkey && $langs->trans($transkey) != $transkey) { @@ -1982,8 +1991,11 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='') } if (! $transfound) { - print ''; + print ''; } + else{ + print ''; + } print ''; } } From 2f5b9ccb22b9bcd3cce64d3a234bdf3e945b6d1e Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 3 Jul 2019 17:00:18 +0200 Subject: [PATCH 3/4] fix case objecttmp is an invoice --- htdocs/core/class/html.form.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fe8a812a8a2..a8d96ed4b34 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5558,7 +5558,8 @@ class Form if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode='company'; $confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT - $fieldstoshow='t.ref'; + if (DOL_VERSION < 10 && $objecttmp->element == 'facture') $fieldstoshow = 't.facnumber'; + else $fieldstoshow='t.ref'; if (! empty($objecttmp->fields)) // For object that declare it, it is better to use declared fields ( like societe, contact, ...) { $tmpfieldstoshow=''; From 63c93be94e0a28be0cb05fb08ecc3c76c2f2e7cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 4 Jul 2019 12:20:34 +0200 Subject: [PATCH 4/4] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a8d96ed4b34..a462f40ebdc 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5558,7 +5558,7 @@ class Form if ($prefixforautocompletemode == 'societe') $prefixforautocompletemode='company'; $confkeyforautocompletemode=strtoupper($prefixforautocompletemode).'_USE_SEARCH_TO_SELECT'; // For example COMPANY_USE_SEARCH_TO_SELECT - if (DOL_VERSION < 10 && $objecttmp->element == 'facture') $fieldstoshow = 't.facnumber'; + if (((float) DOL_VERSION) < 10 && $objecttmp->element == 'facture') $fieldstoshow = 't.facnumber'; else $fieldstoshow='t.ref'; if (! empty($objecttmp->fields)) // For object that declare it, it is better to use declared fields ( like societe, contact, ...) {