1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-28 00:30:45 +01:00

Fix aggiunta referente

This commit is contained in:
MatteoPistorello 2022-02-09 11:48:01 +01:00
parent a9429eb4b9
commit c06e8f725e

View File

@ -24,6 +24,8 @@ $operazione = filter('op');
switch ($operazione) { switch ($operazione) {
case 'addreferente': case 'addreferente':
if (!empty(post('nome'))) { if (!empty(post('nome'))) {
$opt_out_newsletter = post('disable_newsletter');
$dbo->insert('an_referenti', [ $dbo->insert('an_referenti', [
'idanagrafica' => $id_parent, 'idanagrafica' => $id_parent,
'nome' => post('nome'), 'nome' => post('nome'),
@ -31,6 +33,7 @@ switch ($operazione) {
'telefono' => post('telefono'), 'telefono' => post('telefono'),
'email' => post('email'), 'email' => post('email'),
'idsede' => post('idsede'), 'idsede' => post('idsede'),
'enable_newsletter' => empty($opt_out_newsletter),
]); ]);
$id_record = $dbo->lastInsertedID(); $id_record = $dbo->lastInsertedID();
@ -55,7 +58,6 @@ switch ($operazione) {
'telefono' => post('telefono'), 'telefono' => post('telefono'),
'email' => post('email'), 'email' => post('email'),
'idsede' => post('idsede'), 'idsede' => post('idsede'),
'enable_newsletter' => empty($opt_out_newsletter), 'enable_newsletter' => empty($opt_out_newsletter),
], ['id' => $id_record]); ], ['id' => $id_record]);