From 71057a387ac324848c4f4b8ddc45ff1a531b81ce Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Sun, 1 Mar 2020 16:04:59 +0100 Subject: [PATCH] =?UTF-8?q?[9.2.23]=20Mise=20=C3=A0=20jour=20auto=20WIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 3 +++ core/core.php | 8 ++++---- core/module/config/config.php | 6 ++++++ core/module/config/view/index/index.php | 2 +- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index e2071a21..71ba1e7d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,9 @@ Modifications : - Module Form : Opion permettant d'ajouter le premier mail dans le formulaire au message de notification (Reply To) afin de répondre directement au message. - Configuration du site : bouton affichant le numéro de la version en ligne. - Galerie : position du champ de tri des images. + - Mise à jour en ligne : + - Délais entre deux vérification porté à une semaine. + - Réinitialisation du compte de vérification lors de l'activation de l'option. ## version 9.2.22 - Modifications : diff --git a/core/core.php b/core/core.php index 89cc61fc..0571e5b9 100644 --- a/core/core.php +++ b/core/core.php @@ -2582,10 +2582,10 @@ class layout extends common { $rightItems .= '
  • ' . template::ico('brush') . '
  • '; $rightItems .= '
  • ' . template::ico('cog-alt') . '
  • '; // Mise à jour automatique - $lastAutoUpdate = mktime(0, 0, 0); - if( $this->getData(['config','autoUpdate']) && - $lastAutoUpdate > $this->getData(['core','lastAutoUpdate']) + 86400 ) { - $this->setData(['core','lastAutoUpdate',$lastAutoUpdate]); + $lastAutoUpdate = mktime(0, 0, 0); + if( $this->getData(['config','autoUpdate']) === true && + $lastAutoUpdate > $this->getData(['core','lastAutoUpdate']) + 604800 ) { + $this->setData(['core','lastAutoUpdate',$lastAutoUpdate]); if ( helper::checkNewVersion(common::ZWII_UPDATE_CHANNEL) ) { $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; } diff --git a/core/module/config/config.php b/core/module/config/config.php index e85634ae..099ac0b0 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -282,6 +282,12 @@ class config extends common { public function index() { // Soumission du formulaire if($this->isPost()) { + // Basculement en mise à jour auto + // Remise à 0 du compteur + if ($this->getData(['config','autoUpdate']) === false && + $this->getInput('configAutoUpdate', helper::FILTER_BOOLEAN) === true) { + $this->setData(['core','lastAutoUpdate',0]); + } $this->setData([ 'config', [ diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index 3e62c23d..25316283 100755 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -176,7 +176,7 @@ ]); ?> $this->getData(['config', 'autoUpdate']), - 'help' => 'Vérifie une fois par jour l\'existence d\'une mise à jour.' + 'help' => 'Vérification de l\'existence d\'une mise à jour en ligne une fois par semaine.' ]); ?> $this->getData(['config', 'autoBackup']),