diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 506b0c6fa8d..aab95264a57 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -189,9 +189,11 @@ if (empty($reshook)) if ($action == 'update_extras') { $object->fetch($id); + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); if ($ret < 0) $error++; if (! $error) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 380edc5a472..02c1b0e65bb 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -1228,9 +1228,11 @@ if (empty($reshook)) } else if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); if ($ret < 0) $error++; if (! $error) { diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 21975439872..2cb899fcfe6 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1268,9 +1268,11 @@ if (empty($reshook)) if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 5681b0c339c..969f4d532cb 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -2112,9 +2112,11 @@ if (empty($reshook)) if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from add form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); if ($ret < 0) $error++; if (! $error) { diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index f869c01aa53..43d28c9abbd 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -444,9 +444,11 @@ if (empty($reshook)) } else if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); if ($ret < 0) $error++; if (! $error) { diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index e27bbfb7655..3b7ab5ae49b 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -880,7 +880,7 @@ if (empty($reshook)) // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); if ($ret < 0) $error++; if (! $error) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 82d6c746640..27b70e1b8cf 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -155,9 +155,11 @@ if (empty($reshook)) if ($action == 'update_extras') { - // Fill array 'array_options' with data from update form + $object->oldcopy = dol_clone($object); + + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 0141fc1dea5..3b7a2d74818 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -180,9 +180,11 @@ if (empty($reshook)) if ($action == 'update_extras') { - // Fill array 'array_options' with data from update form + $object->oldcopy = dol_clone($object); + + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index bb90442a110..dd5db880bc9 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -286,9 +286,11 @@ if (empty($reshook)) if ($action == 'update_extras') { - // Fill array 'array_options' with data from update form + $object->oldcopy = dol_clone($object); + + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 3eddb02c28b..9b623d21279 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -741,9 +741,11 @@ if (empty($reshook)) if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute', 'none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 6f06a6778fd..c6f0c8bb446 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -114,9 +114,11 @@ if (empty($reshook)) if ($action == 'update_extras') { $object->fetch($id); + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 15148cbcc2a..f87b4c9bd25 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -945,9 +945,11 @@ if (empty($reshook)) if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from add form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute', 'none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index cfba614492e..cc6fb29fa5a 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1255,9 +1255,11 @@ if (empty($reshook)) } if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from add form $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels,$object,GETPOST('attribute', 'none')); if ($ret < 0) $error++; if (!$error) diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php index b2218508ef6..06c602df330 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/livraison/card.php @@ -193,9 +193,11 @@ elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled)) // Update extrafields if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/product/stock/productlot_card.php b/htdocs/product/stock/productlot_card.php index 8e639c90108..f269e260b25 100644 --- a/htdocs/product/stock/productlot_card.php +++ b/htdocs/product/stock/productlot_card.php @@ -122,9 +122,11 @@ if (empty($reshook)) if ($action == 'update_extras') { - // Fill array 'array_options' with data from update form + $object->oldcopy = dol_clone($object); + + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); if ($ret < 0) $error++; if (! $error) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index ed8e6c74c6e..55c598fdd84 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -327,6 +327,8 @@ if (empty($reshook)) if ($action == 'update_extras') { $object->fetch($socid); + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none')); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index c4f5c5c6ba9..8d8e46a6ae9 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -927,9 +927,11 @@ if (empty($reshook)) } else if ($action == 'update_extras') { + $object->oldcopy = dol_clone($object); + // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); - $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); + $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute', 'none')); if ($ret < 0) $error++; if (! $error)