Skip to content
Snippets Groups Projects
Commit 6f392704 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #2310 from FHenry/3.7

re-add index.html file
parents 0b661675 15dfd7c0
No related branches found
No related tags found
No related merge requests found
......@@ -73,7 +73,7 @@ $object = new Contrat($db);
$extrafields = new ExtraFields($db);
// Load object
if ($id > 0 || ! empty($ref)) {
if ($id > 0 || ! empty($ref) && $action!='add') {
$ret = $object->fetch($id, $ref);
if ($ret > 0)
$ret = $object->fetch_thirdparty();
......@@ -203,6 +203,13 @@ if ($action == 'add' && $user->rights->contrat->creer)
$error++;
}
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) {
$error ++;
$action = 'create';
}
if (! $error)
{
$object->socid = $socid;
......@@ -352,11 +359,6 @@ if ($action == 'add' && $user->rights->contrat->creer)
}
else
{
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) $error++;
$result = $object->create($user);
if ($result > 0)
{
......@@ -703,20 +705,19 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
// 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'));
if ($ret < 0) $error++;
if ($ret < 0)
$error ++;
if (! $error)
{
$result = $object->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
else if ($reshook < 0) $error++;
if (! $error) {
if ($error)
{
$result = $object->insertExtraFields();
if ($result < 0) {
$error ++;
}
} else if ($reshook < 0)
$error ++;
if ($error) {
$action = 'edit_extras';
setEventMessage($object->error,'errors');
}
......
......@@ -65,7 +65,7 @@ class DolGraph
var $bgcolorgrid=array(255,255,255); // array(R,G,B)
var $datacolor; // array(array(R,G,B),...)
private $_stringtoshow; // To store string to output graph into HTML page
protected $_stringtoshow; // To store string to output graph into HTML page
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment