From 9736fd7debb47ea5a4d855d75d002cc5b94a972a Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 27 Feb 2012 17:28:06 -0500 Subject: [PATCH] CC-3334: Upgrade notification reports there is an upgrade when user has a later version than the official released version - I've updated the comment to read the difference between 1.9.5 and version 3.0.0 is calculated as 105 - I've also updated the checking logic to make the first outdated anything below 20 and the second outdated between 20 and 29. --- airtime_mvc/application/views/helpers/VersionNotify.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/views/helpers/VersionNotify.php b/airtime_mvc/application/views/helpers/VersionNotify.php index a488c6e9b..b356d843c 100644 --- a/airtime_mvc/application/views/helpers/VersionNotify.php +++ b/airtime_mvc/application/views/helpers/VersionNotify.php @@ -27,7 +27,7 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract{ } // Calculate the version difference; - // Example: if current = 1.9.5 and latest = 3.0.0, diff = 115 + // Example: if current = 1.9.5 and latest = 3.0.0, diff = 105 // Note: algorithm assumes the number after 1st dot never goes above 9 $versionDifference = (intval($latestExploded[0]) * 100 + intval($latestExploded[1]) *10 + intval($latestExploded[2])) - (intval($currentExploded[0]) * 100 + intval($currentExploded[1] *10 + intval($currentExploded[2]))); @@ -36,10 +36,10 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract{ if($versionDifference <= 0) { // current version is up to date or newer $class = "uptodate"; - } else if($versionDifference <= 20) { + } else if($versionDifference < 20) { // 2 or less major versions back $class = "update"; - } else if($versionDifference == 30) { + } else if($versionDifference < 30) { // 3 major versions back $class = "update2"; } else {