Skip to content

Commit be05121

Browse files
committed
feat: gestione deleted_at sugli utenti per nascondere utenti eliminati dalla lista, close #1533
1 parent cd1ecf8 commit be05121

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

modules/utenti/actions.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172

173173
$dbo->update('zz_users', [
174174
'enabled' => 0,
175+
'deleted_at' => Carbon\Carbon::now(),
175176
], ['id' => $id_utente]);
176177

177178
flash()->info(tr('Utente disabilitato!'));

modules/utenti/edit.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche_lang`.`id_record` = `an_tipianagrafiche`.`id` AND `an_tipianagrafiche_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).')
5454
WHERE
5555
`zz_users`.`idgruppo` = '.prepare($record['id']).'
56+
AND `zz_users`.`deleted_at` IS NULL
5657
GROUP BY
5758
`zz_users`.`id`');
5859

update/2_10.sql

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,8 @@ INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`
220220

221221
INSERT INTO `zz_settings_lang` (`id`, `id_lang`, `id_record`, `title`, `help`) VALUES
222222
(NULL, '1', (SELECT `id` FROM `zz_settings` WHERE `nome` = 'Genera barcode automaticamente'), 'Genera barcode automaticamente', ''),
223-
(NULL, '2', (SELECT `id` FROM `zz_settings` WHERE `nome` = 'Genera barcode automaticamente'), 'Generate barcode automatically', '');
223+
(NULL, '2', (SELECT `id` FROM `zz_settings` WHERE `nome` = 'Genera barcode automaticamente'), 'Generate barcode automatically', '');
224+
225+
-- #1533 - Gestione eliminazione utenti
226+
ALTER TABLE `zz_users`
227+
ADD `deleted_at` DATE NULL DEFAULT NULL;

0 commit comments

Comments
 (0)