mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-01-24 12:51:05 +01:00
Fix rimozione referente in sede
This commit is contained in:
parent
d674dfb2aa
commit
195edf22b4
@ -90,7 +90,10 @@ switch ($operazione) {
|
||||
'enable_newsletter' => empty($opt_out_newsletter),
|
||||
], ['id' => $id_record]);
|
||||
|
||||
$referenti = $dbo->fetchArray('SELECT id FROM an_referenti WHERE idsede = '.$id_record);
|
||||
$id_referenti = (array) post('id_referenti');
|
||||
$refs = array_diff($referenti, $id_referenti);
|
||||
|
||||
foreach ($id_referenti as $id_referente) {
|
||||
$dbo->update('an_referenti', [
|
||||
'idsede' => $id_record,
|
||||
@ -99,6 +102,14 @@ switch ($operazione) {
|
||||
]);
|
||||
}
|
||||
|
||||
foreach ($refs as $ref) {
|
||||
$dbo->update('an_referenti', [
|
||||
'idsede' => 0,
|
||||
], [
|
||||
'id' => $ref,
|
||||
]);
|
||||
}
|
||||
|
||||
flash()->info(tr('Salvataggio completato!'));
|
||||
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user