mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-17 03:51:06 +01:00
miglioria aggiunta impianti da plugin interventi
This commit is contained in:
parent
db9e73a666
commit
431649023b
@ -186,31 +186,6 @@ switch (post('op')) {
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Aggiungo impianto
|
|
||||||
case 'add_impianto':
|
|
||||||
$matricola = post('matricola');
|
|
||||||
$idanagrafica = post('idanagrafica');
|
|
||||||
$nome = post('nome');
|
|
||||||
$idtecnico = post('idtecnico');
|
|
||||||
|
|
||||||
if (!empty($matricola)) {
|
|
||||||
$dbo->query('INSERT INTO my_impianti(matricola, idanagrafica, nome, data, idtecnico) VALUES ('.prepare($matricola).', '.prepare($idanagrafica).', '.prepare($nome).', NOW(), '.prepare($idtecnico).')');
|
|
||||||
|
|
||||||
$id_impianto = $dbo->lastInsertedID();
|
|
||||||
|
|
||||||
$dbo->insert('my_impianti_interventi', [
|
|
||||||
'idintervento' => $id_record,
|
|
||||||
'idimpianto' => $id_impianto,
|
|
||||||
]);
|
|
||||||
|
|
||||||
flash()->info(tr('Aggiunto nuovo impianto!'));
|
|
||||||
|
|
||||||
$database->commitTransaction();
|
|
||||||
header('location: '.$rootdir.'/editor.php?id_module=3&id_record='.$id_record.'#tab_2');
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
// Eliminazione intervento
|
// Eliminazione intervento
|
||||||
case 'delete':
|
case 'delete':
|
||||||
|
@ -10,7 +10,7 @@ if ($source == 'Attività') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
?><form action="" method="post" id="add-form">
|
?><form action="" method="post" id="add-form">
|
||||||
<input type="hidden" name="op" value="<?php echo get('plugin') == 1 ? 'add_impianto' : 'add'; ?>">
|
<input type="hidden" name="op" value="add">
|
||||||
<input type="hidden" name="backto" value="record-edit">
|
<input type="hidden" name="backto" value="record-edit">
|
||||||
<input type="hidden" name="source" value="<?php echo $source; ?>">
|
<input type="hidden" name="source" value="<?php echo $source; ?>">
|
||||||
|
|
||||||
|
@ -176,13 +176,14 @@ echo '
|
|||||||
<input type="hidden" name="backto" value="record-edit">
|
<input type="hidden" name="backto" value="record-edit">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-12 col-md-6">
|
<div class="col-xs-12 col-md-6">
|
||||||
{[ "type": "select", "name": "matricole[]", "multiple": 1, "value": "'.implode(',', $impianti).'", "values": "query=SELECT my_impianti.id, CONCAT(matricola, \' - \', nome) AS descrizione, CONCAT(nomesede, IF(citta IS NULL OR citta = \'\', \'\', CONCAT(\' (\', citta, \')\'))) AS optgroup FROM my_impianti JOIN (SELECT id, nomesede, citta FROM an_sedi UNION SELECT 0 AS id, \'Sede legale\' AS nomesede, \'\' AS citta) AS t ON t.id = my_impianti.idsede WHERE idanagrafica='.prepare($record['idanagrafica']).' ORDER BY idsede ASC, matricola ASC", "extra": "'.$readonly.'" ]}
|
{[ "type": "select", "name": "matricole[]", "multiple": 1, "value": "'.implode(',', $impianti).'", "ajax-source": "impianti-cliente", "extra": "'.$readonly.'" ]}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br><br>
|
<br><br>
|
||||||
<button type="submit" class="btn btn-success" '.$disabled.'><i class="fa fa-check"></i> '.tr('Salva impianti').'</button>
|
<button type="submit" class="btn btn-success" '.$disabled.'><i class="fa fa-check"></i> '.tr('Salva impianti').'</button>
|
||||||
|
|
||||||
<button type="button" class="btn btn-primary" data-toggle="modal" data-title="'.tr('Aggiungi impianto').'" data-href="'.$rootdir.'/modules/my_impianti/add.php?id_module='.Modules::get('MyImpianti')['id'].'&id_record='.$id_record.'&source=Attività&plugin=1"><i class="fa fa-plus"></i> '.tr('Aggiungi impianto').'</button>
|
<button type="button" class="btn btn-primary" data-toggle="modal" data-title="'.tr('Aggiungi impianto').'" data-href="'.$rootdir.'/add.php?id_module='.Modules::get('MyImpianti')['id'].'&source=Attività&select=idimpianti&ajax=yes" data-target="#bs-popup2"><i class="fa fa-plus"></i> '.tr('Aggiungi impianto').'</button>
|
||||||
|
|
||||||
</form>';
|
</form>';
|
||||||
|
|
||||||
echo '
|
echo '
|
||||||
|
Loading…
x
Reference in New Issue
Block a user