commit
6f39270450
@ -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');
|
||||
}
|
||||
|
||||
0
htdocs/contrat/class/index.html
Normal file
0
htdocs/contrat/class/index.html
Normal file
@ -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
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user