Fix bug on invoice extrafield type date
This commit is contained in:
parent
30ad2f1609
commit
b9f7d4c302
@ -655,15 +655,11 @@ else if ($action == 'add' && $user->rights->facture->creer)
|
||||
$db->begin();
|
||||
|
||||
$error=0;
|
||||
|
||||
// Get extra fields
|
||||
foreach($_POST as $key => $value)
|
||||
{
|
||||
if (preg_match("/^options_/",$key))
|
||||
{
|
||||
$object->array_options[$key]=GETPOST($key);
|
||||
}
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
|
||||
|
||||
|
||||
// Replacement invoice
|
||||
if ($_POST['type'] == 1)
|
||||
|
||||
@ -75,6 +75,8 @@ if (empty($conf->global->MEMBER_ENABLE_PUBLIC))
|
||||
exit;
|
||||
}
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
|
||||
|
||||
/**
|
||||
* Show header for new member
|
||||
@ -245,11 +247,10 @@ if ($action == 'add')
|
||||
$adh->morphy = $_POST["morphy"];
|
||||
$adh->birth = $birthday;
|
||||
|
||||
foreach($_POST as $key => $value){
|
||||
if (preg_match("/^options_/",$key)){
|
||||
$adh->array_options[$key]=$_POST[$key];
|
||||
}
|
||||
}
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$extralabels=$extrafields->fetch_name_optionals_label($adh->table_element);
|
||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$adh);
|
||||
|
||||
$result=$adh->create($user->id);
|
||||
if ($result > 0)
|
||||
@ -360,7 +361,6 @@ if ($action == 'added')
|
||||
$form = new Form($db);
|
||||
$formcompany = new FormCompany($db);
|
||||
$adht = new AdherentType($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$extrafields->fetch_name_optionals_label('adherent'); // fetch optionals attributes and labels
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user