From 8cdb251ca5038bc2959d68b3f41991926fc18719 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Tue, 2 Jul 2019 10:13:26 +0200 Subject: [PATCH 1/8] 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 6b43c325c74923158dc71a8c8a39f86a0f2adcf5 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Tue, 2 Jul 2019 10:53:47 +0200 Subject: [PATCH 2/8] Fix wrong column for filters on invoice template list --- htdocs/compta/facture/invoicetemplate_list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index 306106d4889..0e09cb72ab1 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -264,7 +264,7 @@ if ($search_month_date_when > 0) if ($search_year_date_when > 0 && empty($search_day_date_when)) $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when,$search_month_date_when,false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when,$search_month_date_when,false))."'"; else if ($search_year_date_when > 0 && ! empty($search_day_date_when)) - $sql.= " AND f.date_date_when_reglement BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'"; + $sql.= " AND f.date_when BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month_date_when, $search_day_date_when, $search_year_date_when))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month_date_when, $search_day_date_when, $search_year_date_when))."'"; else $sql.= " AND date_format(f.date_when, '%m') = '".$db->escape($search_month_date_when)."'"; } From a75a2ae8e45a730e9a74ac9944acb43aac4c4ee2 Mon Sep 17 00:00:00 2001 From: John Botella Date: Tue, 2 Jul 2019 15:44:42 +0200 Subject: [PATCH 3/8] 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 9d50c672088b16a6208358e4f1e890ca3ab0eaab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 2 Jul 2019 18:06:51 +0200 Subject: [PATCH 4/8] FIX option EXPORT_LABEL_FOR_SELECT to restore compatibility in export --- htdocs/core/extrafieldsinexport.inc.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/htdocs/core/extrafieldsinexport.inc.php b/htdocs/core/extrafieldsinexport.inc.php index 13b2d1ae520..78dbba9934e 100644 --- a/htdocs/core/extrafieldsinexport.inc.php +++ b/htdocs/core/extrafieldsinexport.inc.php @@ -34,6 +34,15 @@ if ($resql) // This can fail when class is used on old database (during migra case 'boolean': $typeFilter="Boolean"; break; + case 'select': + if (! empty($conf->global->EXPORT_LABEL_FOR_SELECT)) + { + $tmpparam=unserialize($obj->param); // $tmpparam may be array with 'options' = array(key1=>val1, key2=>val2 ...) + if ($tmpparam['options'] && is_array($tmpparam['options'])) { + $typeFilter="Select:".$obj->param; + } + } + break; case 'sellist': $tmp=''; $tmpparam=unserialize($obj->param); // $tmp ay be array 'options' => array 'c_currencies:code_iso:code_iso' => null From 433835860c2cbf470b9421d75f035a2567c33aee Mon Sep 17 00:00:00 2001 From: Ferran Marcet Date: Wed, 3 Jul 2019 13:12:41 +0200 Subject: [PATCH 5/8] FIX: When saving an action it didn't save the label based on the type of event if the label is empty and the type is customized --- htdocs/comm/action/card.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 470a90c355f..8989807a645 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -7,6 +7,7 @@ * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2015 Alexandre Spangaro + * Copyright (C) 2019 Ferran Marcet * * 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 @@ -246,7 +247,10 @@ if ($action == 'add') { $object->label = $langs->transnoentitiesnoconv("Action".$object->type_code)."\n"; } - else $object->label = $cactioncomm->libelle; + else { + $cactioncomm->fetch($object->type_code); + $object->label = $cactioncomm->label; + } } } $object->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0; From 3e53a06b2ef93b487dbb4b18ffb3b4c82292ad40 Mon Sep 17 00:00:00 2001 From: "atm-florian.m" Date: Wed, 3 Jul 2019 16:17:47 +0200 Subject: [PATCH 6/8] minor spelling issues --- htdocs/fourn/commande/dispatch.php | 4 ++-- htdocs/langs/fr_FR/stocks.lang | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php index 77fd4b1aa69..dd6fd76a46a 100644 --- a/htdocs/fourn/commande/dispatch.php +++ b/htdocs/fourn/commande/dispatch.php @@ -245,7 +245,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) // We ask to move a qty if (GETPOST($qty) != 0) { if (! (GETPOST($ent, 'int') > 0)) { - dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed'); + dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.'); $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline); setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors'); $error ++; @@ -282,7 +282,7 @@ if ($action == 'dispatch' && $user->rights->fournisseur->commande->receptionner) // We ask to move a qty if (GETPOST($qty) > 0) { if (! (GETPOST($ent, 'int') > 0)) { - dol_syslog('No dispatch for line ' . $key . ' as no warehouse choosed'); + dol_syslog('No dispatch for line ' . $key . ' as no warehouse was chosen.'); $text = $langs->transnoentities('Warehouse') . ', ' . $langs->transnoentities('Line') . ' ' . ($numline) . '-' . ($reg[1] + 1); setEventMessages($langs->trans('ErrorFieldRequired', $text), null, 'errors'); $error ++; diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index 5898f7384e5..df9f738f4d8 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -65,7 +65,7 @@ RuleForStockManagementIncrease=Règle de gestion des incrémentations de stock ( DeStockOnBill=Décrémenter les stocks physiques sur validation des factures/avoirs clients DeStockOnValidateOrder=Décrémenterr les stocks physiques sur validation des commandes clients DeStockOnShipment=Décrémenter les stocks physiques sur validation des expéditions -DeStockOnShipmentOnClosing=Décrémenter les stocks phisiques au classement "clôturée" de l'expédition +DeStockOnShipmentOnClosing=Décrémenter les stocks physiques au classement "clôturée" de l'expédition ReStockOnBill=Incrémenter les stocks physiques sur validation des factures/avoirs fournisseurs ReStockOnValidateOrder=Incrémenter les stocks physiques sur approbation des commandes fournisseurs ReStockOnDispatchOrder=Incrémenter les stocks physiques sur ventilation manuelle dans les entrepôts, après réception de la marchandise From 2f5b9ccb22b9bcd3cce64d3a234bdf3e945b6d1e Mon Sep 17 00:00:00 2001 From: atm-greg Date: Wed, 3 Jul 2019 17:00:18 +0200 Subject: [PATCH 7/8] 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 8/8] 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, ...) {