From b1631ae1286499c2723d85e1ce7507f0d0c758db Mon Sep 17 00:00:00 2001 From: Thomas Zilio Date: Wed, 24 Jul 2019 11:13:48 +0200 Subject: [PATCH] Refresh UpdateHook --- modules/aggiornamenti/actions.php | 14 +++++--------- src/Update.php | 4 ++++ update/tables.php | 2 ++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/modules/aggiornamenti/actions.php b/modules/aggiornamenti/actions.php index 46f11f0a5..45d468e96 100644 --- a/modules/aggiornamenti/actions.php +++ b/modules/aggiornamenti/actions.php @@ -2,20 +2,16 @@ include_once __DIR__.'/../../core.php'; +use Modules\Aggiornamenti\UpdateHook; + $id = post('id'); switch (filter('op')) { case 'check': - $api = json_decode(get_remote_data('https://api.github.com/repos/devcode-it/openstamanager/releases'), true); + $result = UpdateHook::isAvailable(); + UpdateHook::update($result); - $version = ltrim($api[0]['tag_name'], 'v'); - $current = Update::getVersion(); - - if (version_compare($current, $version) < 0) { - echo $version; - } else { - echo 'none'; - } + echo $result; break; diff --git a/src/Update.php b/src/Update.php index 040586cc4..ec59e2d35 100644 --- a/src/Update.php +++ b/src/Update.php @@ -182,6 +182,10 @@ class Update // Normalizzazione di charset e collation self::normalizeDatabase($database->getDatabaseName()); + if (class_exists('\Modules\Aggiornamenti\UpdateHook')) { + \Modules\Aggiornamenti\UpdateHook::update(null); + } + return true; } diff --git a/update/tables.php b/update/tables.php index 78d403cc7..e6e28c0e7 100644 --- a/update/tables.php +++ b/update/tables.php @@ -39,6 +39,7 @@ return [ 'co_statidocumento', 'co_statipreventivi', 'co_tipidocumento', + 'co_tipi_scadenze', 'dt_aspettobeni', 'dt_causalet', 'dt_ddt', @@ -104,6 +105,7 @@ return [ 'zz_smtps', 'zz_tokens', 'zz_users', + 'zz_user_sedi', 'zz_views', 'zz_widgets', ];