From 30957f2363591f40d741ffcd8dbb1d300930bff2 Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Thu, 25 Jul 2019 18:05:47 +0200 Subject: [PATCH] Personalizzazione scadenze --- add.php | 1 + editor.php | 1 + lib/functions.js | 4 + modules/fatture/buttons.php | 3 +- modules/fatture/fe/document-fe.php | 4 - modules/fatture/fe/row-fe.php | 4 - modules/fatture/variables.php | 2 +- modules/scadenzario/actions.php | 43 +++++++-- modules/scadenzario/edit.php | 145 +++++++++++++++++++---------- modules/utenti/actions.php | 5 +- modules/utenti/components/base.php | 2 +- modules/utenti/user.php | 2 +- modules/viste/edit.php | 4 - src/Auth.php | 2 +- update/2_4_11.sql | 7 +- 15 files changed, 154 insertions(+), 75 deletions(-) diff --git a/add.php b/add.php index 3af3e16c9..fd89dcdb9 100644 --- a/add.php +++ b/add.php @@ -64,6 +64,7 @@ $(document).ready(function(){ last.after($("#custom_fields_bottom-add").html()); start_superselect(); + start_datepickers(); }); '; diff --git a/editor.php b/editor.php index e9ab6eeba..1cb5c1e91 100755 --- a/editor.php +++ b/editor.php @@ -268,6 +268,7 @@ if (empty($record) || !$has_access) { last.after($("#custom_fields_bottom-edit").html()); start_superselect(); + start_datepickers(); }); '; diff --git a/lib/functions.js b/lib/functions.js index 08b2f4a6d..3ad4f2ba3 100644 --- a/lib/functions.js +++ b/lib/functions.js @@ -1786,3 +1786,7 @@ function submitAjax(form, data = {}, callback = null, errorCallback = null) { function removeHash() { history.replaceState(null, null, ' '); } + +function replaceAll(str, find, replace) { + return str.replace(new RegExp(find, "g"), replace); +} diff --git a/modules/fatture/buttons.php b/modules/fatture/buttons.php index b78658898..7425466ec 100644 --- a/modules/fatture/buttons.php +++ b/modules/fatture/buttons.php @@ -77,10 +77,9 @@ if (!empty($record['is_fiscale'])) { } if ($record['stato'] == 'Pagato') { -echo ' + echo ' '; - } } diff --git a/modules/fatture/fe/document-fe.php b/modules/fatture/fe/document-fe.php index 1cb021e57..7238023bf 100644 --- a/modules/fatture/fe/document-fe.php +++ b/modules/fatture/fe/document-fe.php @@ -145,10 +145,6 @@ echo ' echo ' '; + ?> diff --git a/modules/utenti/actions.php b/modules/utenti/actions.php index 7f9a1b483..32883802e 100644 --- a/modules/utenti/actions.php +++ b/modules/utenti/actions.php @@ -49,8 +49,9 @@ switch (filter('op')) { $utente->email = $email; $cambia_password = filter('change_password'); - if (!empty($cambia_password)) - $utente->password = $password; + if (!empty($cambia_password)) { + $utente->password = $password; + } } else { $utente = User::build($username, $email, $password); } diff --git a/modules/utenti/components/base.php b/modules/utenti/components/base.php index bef281b50..28a4597b4 100644 --- a/modules/utenti/components/base.php +++ b/modules/utenti/components/base.php @@ -7,7 +7,7 @@ $_SESSION['superselect']['idanagrafica'] = $utente['id_anagrafica']; echo '
- {[ "type": "text", "label": "'.tr('Username').'", "name": "username", "required": 1, "value": "'.$utente['username'].'", "validation": "username||'.($utente['id']?:0).'" ]} + {[ "type": "text", "label": "'.tr('Username').'", "name": "username", "required": 1, "value": "'.$utente['username'].'", "validation": "username||'.($utente['id'] ?: 0).'" ]}
'; diff --git a/modules/utenti/user.php b/modules/utenti/user.php index db41d710d..573605210 100644 --- a/modules/utenti/user.php +++ b/modules/utenti/user.php @@ -42,7 +42,7 @@ if (!empty($user)) { echo '
- {[ "type": "checkbox", "label": "' . tr('Cambia password') . '", "name": "change_password", "value": "1" ]} + {[ "type": "checkbox", "label": "'.tr('Cambia password').'", "name": "change_password", "value": "1" ]}
diff --git a/modules/viste/edit.php b/modules/viste/edit.php index e7a3add1a..8dd7db235 100644 --- a/modules/viste/edit.php +++ b/modules/viste/edit.php @@ -130,9 +130,5 @@ function testQuery(){ } }) } - -function replaceAll(str, find, replace) { - return str.replace(new RegExp(find, "g"), replace); -} '; } diff --git a/src/Auth.php b/src/Auth.php index b6679fab4..61ee0d9de 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -466,7 +466,7 @@ class Auth extends \Util\Singleton if (!empty($results)) { $this->user = User::with('group')->find($user_id); - if(!API::isAPIRequest() && !empty($this->user->reset_token)) { + if (!API::isAPIRequest() && !empty($this->user->reset_token)) { $this->user->reset_token = null; $this->user->save(); } diff --git a/update/2_4_11.sql b/update/2_4_11.sql index 925828088..3eff3fda8 100644 --- a/update/2_4_11.sql +++ b/update/2_4_11.sql @@ -182,4 +182,9 @@ HAVING 2=2 ORDER BY `scadenza` ASC' WHERE `name` = 'Scadenzario'; -- Aggiunte impostazione Autocomple web form -INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Autocompletamento form', 'on', 'list[on,off]', '1', 'Generali', '', NULL); \ No newline at end of file +INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Autocompletamento form', 'on', 'list[on,off]', '1', 'Generali', '', NULL); + +-- Data concordata per le scadenza +ALTER TABLE `co_scadenziario` ADD `data_concordata` DATE; + +UPDATE `zz_views` SET `query` = 'IF(pagato = da_pagare, ''#38CD4E'', IF(data_concordata IS NOT NULL AND data_concordata > NOW(), '' #CC9837'', IF(scadenza < NOW(), ''#CC4D37'', '''')))' WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Scadenzario') AND `name` = '_bg_';