From 75f5202f263d600a1df74104d1a59a0f3abf5adf Mon Sep 17 00:00:00 2001 From: Luca Date: Thu, 20 Jun 2019 17:35:16 +0200 Subject: [PATCH] Fix minori --- modules/ddt/init.php | 7 +++++++ src/Auth.php | 3 ++- update/2_4_10.sql | 3 +++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/ddt/init.php b/modules/ddt/init.php index f0d2da139..0dd77c3d6 100644 --- a/modules/ddt/init.php +++ b/modules/ddt/init.php @@ -4,6 +4,12 @@ include_once __DIR__.'/../../core.php'; use Modules\DDT\DDT; +if ($module['name'] == 'Ddt di vendita') { + $dir = 'entrata'; +} else { + $dir = 'uscita'; +} + if (isset($id_record)) { $ddt = DDT::with('tipo', 'stato')->find($id_record); @@ -26,4 +32,5 @@ if (isset($id_record)) { if (!in_array($record[$field_name], $user->idsedi)){ $record['flag_completato'] = 1; } + } diff --git a/src/Auth.php b/src/Auth.php index 7c4f57d8d..40faf26be 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -470,7 +470,8 @@ class Auth extends \Util\Singleton // Se l'utente non ha sedi, è come se ce le avesse tutte disponibili per retrocompatibilità if (empty($idsedi)){ - $idsedi = $database->fetchArray('SELECT id AS idsede FROM an_sedi WHERE idanagrafica='.prepare($results[0]['idanagrafica'])); + + $idsedi = $database->fetchArray('SELECT "0" AS idsede UNION SELECT id AS idsede FROM an_sedi WHERE idanagrafica='.prepare($results[0]['idanagrafica'])); } $this->user['idsedi'] = array_column( $idsedi, 'idsede' ); diff --git a/update/2_4_10.sql b/update/2_4_10.sql index aa1274d1b..4e6635222 100644 --- a/update/2_4_10.sql +++ b/update/2_4_10.sql @@ -108,3 +108,6 @@ CREATE TABLE `zz_user_sedi` ( UPDATE `zz_views` SET `query` = 'CONCAT_WS(co_movimenti_modelli.nome, co_movimenti_modelli.descrizione)' WHERE `zz_views`.`name` = 'Nome' AND `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Modelli prima nota'); UPDATE `co_movimenti_modelli` SET `nome` = `descrizione` WHERE `nome` = ''; + +-- Rimuovo le interruzioni di riga per descrizioni vuote +UPDATE `in_interventi` SET `descrizione` = REPLACE(`descrizione`, '\n', '') where `descrizione` LIKE '%\n'; \ No newline at end of file