From fb85b1a240bfa2caa19bad98338b714423af2ec6 Mon Sep 17 00:00:00 2001 From: Luca Date: Tue, 28 Apr 2020 11:38:29 +0200 Subject: [PATCH] Scelta canale per aggiornamenti stable o anche pre-release --- modules/aggiornamenti/src/UpdateHook.php | 11 +++++++---- update/2_4_13.sql | 1 + update/2_4_15.sql | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/aggiornamenti/src/UpdateHook.php b/modules/aggiornamenti/src/UpdateHook.php index 0fa89ce83..3edf264ab 100755 --- a/modules/aggiornamenti/src/UpdateHook.php +++ b/modules/aggiornamenti/src/UpdateHook.php @@ -49,11 +49,14 @@ class UpdateHook extends CachedManager { $api = self::getAPI(); - $version = ltrim($api['tag_name'], 'v'); - $current = Update::getVersion(); + if(!$api['prerelease'] or setting('Abilita canale pre-release per aggiornamenti')){ - if (version_compare($current, $version) < 0) { - return $version; + $version = ltrim($api['tag_name'], 'v'); + $current = Update::getVersion(); + + if (version_compare($current, $version) < 0) { + return $version; + } } return false; diff --git a/update/2_4_13.sql b/update/2_4_13.sql index 42dacf6dd..b1af48f8f 100755 --- a/update/2_4_13.sql +++ b/update/2_4_13.sql @@ -163,6 +163,7 @@ ALTER TABLE `zz_settings` CHANGE `help` `help` TEXT; UPDATE `zz_settings` SET `help` = '

Impostare la maschera senza indicare l''anno per evitare il reset del contatore.

' WHERE `zz_settings`.`nome` = 'Formato codice preventivi'; +-- Fix nome hook Aggiornamenti UPDATE `zz_hooks` SET `name` = 'Aggiornamenti' WHERE `class` = 'Modules\\Aggiornamenti\\UpdateHook'; -- Colonne aggiuntive articoli diff --git a/update/2_4_15.sql b/update/2_4_15.sql index 9425ee4de..648e2c3d7 100644 --- a/update/2_4_15.sql +++ b/update/2_4_15.sql @@ -15,4 +15,8 @@ INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `format -- Ore preavviso rinnovo con decimali per frazioni ore -ALTER TABLE `co_contratti` CHANGE `ore_preavviso_rinnovo` `ore_preavviso_rinnovo` DECIMAL(15,6) NULL DEFAULT NULL; \ No newline at end of file +ALTER TABLE `co_contratti` CHANGE `ore_preavviso_rinnovo` `ore_preavviso_rinnovo` DECIMAL(15,6) NULL DEFAULT NULL; + + +-- Canale aggiornamenti stable/pre-release +INSERT INTO `zz_settings` (`id`, `nome`, `valore`, `tipo`, `editable`, `sezione`, `order`, `help`) VALUES (NULL, 'Abilita canale pre-release per aggiornamenti', '0', 'boolean', '1', 'Generali', NULL, "Consente di recuperare dal canale di pre-release gli aggiornamenti NON stabili del gestionale."); \ No newline at end of file