From 4c5d9f2742cc46bd064b51e68337662c486777a3 Mon Sep 17 00:00:00 2001 From: Thomas905 Date: Thu, 18 Jan 2024 13:56:46 +0100 Subject: [PATCH] add action update_extras to don card --- htdocs/don/card.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/htdocs/don/card.php b/htdocs/don/card.php index ae0e510d135..af3ea6525f2 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -308,6 +308,30 @@ if (empty($reshook)) { $object->setProject($projectid); } + if ($action == 'update_extras') { + $object->fetch($id); + + $object->oldcopy = dol_clone($object); + + // Fill array 'array_options' with data from update form + $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml')); + + if ($ret < 0) { + $error++; + } + + if (!$error) { + $result = $object->insertExtraFields('DON_MODIFY'); + if ($result < 0) { + setEventMessages($object->error, $object->errors, 'errors'); + $error++; + } + } + + if ($error) { + $action = 'edit_extras'; + } + } // Actions to build doc include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';