2018-10-17 18:28:15 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
include_once __DIR__.'/../../core.php';
|
|
|
|
|
|
|
|
$operazione = filter('op');
|
|
|
|
|
2018-10-25 16:57:39 +02:00
|
|
|
switch ($operazione) {
|
2018-10-17 18:28:15 +02:00
|
|
|
case 'edit_revision':
|
2018-10-25 16:57:39 +02:00
|
|
|
|
2018-10-17 18:28:15 +02:00
|
|
|
$master_revision = post('master_revision');
|
|
|
|
$id_record = post('idrevisione');
|
|
|
|
//Tolgo il flag default_revision da tutte le revisioni e dal record_principale
|
2018-10-25 16:57:39 +02:00
|
|
|
$dbo->query('UPDATE co_preventivi SET default_revision=0 WHERE master_revision='.prepare($master_revision));
|
|
|
|
$dbo->query('UPDATE co_preventivi SET default_revision=1 WHERE id='.prepare($id_record));
|
|
|
|
|
2018-10-17 18:28:15 +02:00
|
|
|
flash()->info(tr('Revisione aggiornata!'));
|
|
|
|
break;
|
2018-10-25 16:57:39 +02:00
|
|
|
|
2018-10-17 18:28:15 +02:00
|
|
|
case 'delete_revision':
|
2018-10-25 16:57:39 +02:00
|
|
|
|
2018-10-17 18:28:15 +02:00
|
|
|
$idrevisione = post('idrevisione');
|
2018-10-25 16:57:39 +02:00
|
|
|
$dbo->query('DELETE FROM co_preventivi WHERE id='.prepare($idrevisione));
|
|
|
|
|
2018-10-17 18:28:15 +02:00
|
|
|
flash()->info(tr('Revisione eliminata!'));
|
|
|
|
break;
|
2018-10-25 16:57:39 +02:00
|
|
|
}
|