Bugfix plugin sedi e referenti

This commit is contained in:
Thomas Zilio 2020-03-06 16:27:02 +01:00
parent fc3ca2b145
commit 9580b3a7cd
4 changed files with 13 additions and 10 deletions

View File

@ -8,6 +8,9 @@ echo '
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="addreferente">
<!-- Fix creazione da Anagrafica -->
<input type="hidden" name="id_record" value="">
<div class="row">
<div class="col-md-6">
{[ "type": "text", "label": "'.tr('Nominativo').'", "name": "nome", "required": 1 ]}

View File

@ -6,7 +6,6 @@ $operazione = filter('op');
switch ($operazione) {
case 'addsede':
if (!empty(post('nomesede'))) {
$dbo->insert('an_sedi', [
'idanagrafica' => $id_parent,
@ -37,8 +36,7 @@ switch ($operazione) {
break;
case 'updatesede':
$id = filter('id');
$array = [
$dbo->update('an_sedi', [
'nomesede' => post('nomesede'),
'indirizzo' => post('indirizzo'),
'codice_destinatario' => post('codice_destinatario'),
@ -58,9 +56,7 @@ switch ($operazione) {
'gaddress' => post('gaddress'),
'lat' => post('lat'),
'lng' => post('lng'),
];
$dbo->update('an_sedi', $array, ['id' => $id]);
], ['id' => $id_record]);
flash()->info(tr('Salvataggio completato!'));

View File

@ -8,11 +8,15 @@ echo '
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="addsede">
<!-- Fix creazione da Anagrafica -->
<input type="hidden" name="id_record" value="">
<div class="row">
<div class="col-md-12">
{[ "type": "text", "label": "'.tr('Nome sede').'", "name": "nomesede", "required": 1 ]}
</div>
</div>
<div class="row">
<div class="col-md-6">
{[ "type": "text", "label": "'.tr('Indirizzo').'", "name": "indirizzo", "required": 0 ]}

View File

@ -15,7 +15,7 @@ echo '
<form action="" method="post" role="form" id="form_sedi">
<input type="hidden" name="id_plugin" value="'.$id_plugin.'">
<input type="hidden" name="id_parent" value="'.$id_parent.'">
<input type="hidden" name="id" value="'.$record['id'].'">
<input type="hidden" name="id_record" value="'.$record['id'].'">
<input type="hidden" name="backto" value="record-edit">
<input type="hidden" name="op" value="updatesede">