Merge pull request #2310 from FHenry/3.7

re-add index.html file
This commit is contained in:
Laurent Destailleur 2015-03-11 02:29:29 +01:00
commit 6f39270450
3 changed files with 20 additions and 19 deletions

View File

@ -73,7 +73,7 @@ $object = new Contrat($db);
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
// Load object // Load object
if ($id > 0 || ! empty($ref)) { if ($id > 0 || ! empty($ref) && $action!='add') {
$ret = $object->fetch($id, $ref); $ret = $object->fetch($id, $ref);
if ($ret > 0) if ($ret > 0)
$ret = $object->fetch_thirdparty(); $ret = $object->fetch_thirdparty();
@ -203,6 +203,13 @@ if ($action == 'add' && $user->rights->contrat->creer)
$error++; $error++;
} }
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) {
$error ++;
$action = 'create';
}
if (! $error) if (! $error)
{ {
$object->socid = $socid; $object->socid = $socid;
@ -352,11 +359,6 @@ if ($action == 'add' && $user->rights->contrat->creer)
} }
else else
{ {
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
if ($ret < 0) $error++;
$result = $object->create($user); $result = $object->create($user);
if ($result > 0) 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 // 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'));
if ($ret < 0) $error++; if ($ret < 0)
$error ++;
if (! $error) if (! $error) {
{
$result = $object->insertExtraFields();
if ($result < 0)
{
$error++;
}
}
else if ($reshook < 0) $error++;
if ($error) $result = $object->insertExtraFields();
{ if ($result < 0) {
$error ++;
}
} else if ($reshook < 0)
$error ++;
if ($error) {
$action = 'edit_extras'; $action = 'edit_extras';
setEventMessage($object->error,'errors'); setEventMessage($object->error,'errors');
} }

View File

View File

@ -65,7 +65,7 @@ class DolGraph
var $bgcolorgrid=array(255,255,255); // array(R,G,B) var $bgcolorgrid=array(255,255,255); // array(R,G,B)
var $datacolor; // array(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
/** /**