Fix oldcopy must be saved before update_extras
This commit is contained in:
parent
787a137509
commit
0a79550f43
@ -189,9 +189,11 @@ if (empty($reshook))
|
|||||||
if ($action == 'update_extras') {
|
if ($action == 'update_extras') {
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1228,9 +1228,11 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'update_extras') {
|
else if ($action == 'update_extras') {
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1268,9 +1268,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -2112,9 +2112,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
|
|
||||||
if ($action == 'update_extras') {
|
if ($action == 'update_extras') {
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
|
|||||||
@ -444,9 +444,11 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
else if ($action == 'update_extras')
|
else if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
|
|||||||
@ -880,7 +880,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error) {
|
if (! $error) {
|
||||||
|
|||||||
@ -155,9 +155,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'update_extras')
|
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);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -180,9 +180,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'update_extras')
|
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);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -286,9 +286,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'update_extras')
|
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);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -741,9 +741,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -114,9 +114,11 @@ if (empty($reshook))
|
|||||||
if ($action == 'update_extras') {
|
if ($action == 'update_extras') {
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
|
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -945,9 +945,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -1255,9 +1255,11 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
if ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from add form
|
// Fill array 'array_options' with data from add form
|
||||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (!$error)
|
if (!$error)
|
||||||
|
|||||||
@ -193,9 +193,11 @@ elseif ($action == 'set_incoterms' && !empty($conf->incoterm->enabled))
|
|||||||
// Update extrafields
|
// Update extrafields
|
||||||
if ($action == 'update_extras')
|
if ($action == 'update_extras')
|
||||||
{
|
{
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -122,9 +122,11 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($action == 'update_extras')
|
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);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
@ -327,6 +327,8 @@ if (empty($reshook))
|
|||||||
if ($action == 'update_extras') {
|
if ($action == 'update_extras') {
|
||||||
$object->fetch($socid);
|
$object->fetch($socid);
|
||||||
|
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
|
$ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute','none'));
|
||||||
|
|||||||
@ -927,9 +927,11 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
|
|
||||||
else if ($action == 'update_extras') {
|
else if ($action == 'update_extras') {
|
||||||
|
$object->oldcopy = dol_clone($object);
|
||||||
|
|
||||||
// Fill array 'array_options' with data from update form
|
// Fill array 'array_options' with data from update form
|
||||||
$extralabels = $extrafields->fetch_name_optionals_label($object->table_element);
|
$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 ($ret < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user