From 74345c4f2156175434a2447e3966c86ac8b553fe Mon Sep 17 00:00:00 2001 From: atm-greg Date: Mon, 19 Apr 2021 16:03:22 +0200 Subject: [PATCH 1/2] fix warehouse label field edition --- htdocs/product/stock/card.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index 6279b17d21a..1f53d3491fa 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -98,6 +98,7 @@ if (empty($reshook)) $object->ref = GETPOST("ref"); $object->fk_parent = GETPOST("fk_parent"); $object->libelle = GETPOST("libelle"); + $object->label = GETPOST("libelle"); $object->description = GETPOST("desc"); $object->statut = GETPOST("statut"); $object->lieu = GETPOST("lieu"); @@ -105,8 +106,8 @@ if (empty($reshook)) $object->zip = GETPOST("zipcode"); $object->town = GETPOST("town"); $object->country_id = GETPOST("country_id"); - $object->phone = GETPOST("phone"); - $object->fax = GETPOST("fax"); + $object->phone = GETPOST("phone"); + $object->fax = GETPOST("fax"); if (!empty($object->libelle)) { @@ -168,6 +169,7 @@ if (empty($reshook)) if ($object->fetch($id)) { $object->libelle = GETPOST("libelle"); + $object->label = GETPOST("libelle"); $object->fk_parent = GETPOST("fk_parent"); $object->description = GETPOST("desc"); $object->statut = GETPOST("statut"); @@ -176,8 +178,8 @@ if (empty($reshook)) $object->zip = GETPOST("zipcode"); $object->town = GETPOST("town"); $object->country_id = GETPOST("country_id"); - $object->phone = GETPOST("phone"); - $object->fax = GETPOST("fax"); + $object->phone = GETPOST("phone"); + $object->fax = GETPOST("fax"); // Fill array 'array_options' with data from add form $ret = $extrafields->setOptionalsFromPost(null, $object); From 3d3fb17da31e83aa78f8b32a738d9746bc91c5c5 Mon Sep 17 00:00:00 2001 From: atm-lena Date: Fri, 23 Apr 2021 15:41:43 +0200 Subject: [PATCH 2/2] Add parameter "option" to hook formattachOptions --- htdocs/core/class/html.formfile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 974bdce6d26..0bb30241062 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -268,7 +268,7 @@ class FormFile $out .= "\n\n"; } - $parameters = array('socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url'=>$url, 'perm'=>$perm); + $parameters = array('socid'=>(isset($GLOBALS['socid']) ? $GLOBALS['socid'] : ''), 'id'=>(isset($GLOBALS['id']) ? $GLOBALS['id'] : ''), 'url'=>$url, 'perm'=>$perm, 'options'=>$options); $res = $hookmanager->executeHooks('formattachOptions', $parameters, $object); if (empty($res)) {