From 51c563f80b0a4a02752a7e598fa19eefc7b1bba7 Mon Sep 17 00:00:00 2001 From: Yuchen Wang Date: Mon, 14 Nov 2011 17:52:50 -0500 Subject: [PATCH] CC-2950: Tell users if they are running an out-of-date version or not 1. changed the behavior so that the tooltip comes up on hover 2. changed stat server link to "http://stat.sourcefabric.org/airtime_latest_version" 3. only updates the db if version returned by stat server is valid --- airtime_mvc/application/models/Preference.php | 5 ++--- airtime_mvc/public/js/airtime/dashboard/versiontooltip.js | 1 - utils/phone_home_stat.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 5c88db72c..66002fe72 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -528,10 +528,9 @@ class Application_Model_Preference public static function SetLatestVersion($version){ $pattern = "/^[0-9]+\.[0-9]+\.[0-9]+/"; - if(!preg_match($pattern, $version)) { - $version = self::GetAirtimeVersion(); + if(preg_match($pattern, $version)) { + self::SetValue("latest_version", $version); } - self::SetValue("latest_version", $version); } public static function SetUploadToSoundcloudOption($upload) { diff --git a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js index 02660c019..0f014a5db 100644 --- a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js +++ b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js @@ -29,7 +29,6 @@ function setupVersionQtip(){ button: true } }, - show: 'click', /* Show on click */ hide: false, /* Don't hide on mouseout */ position: { my: "top right", diff --git a/utils/phone_home_stat.php b/utils/phone_home_stat.php index 929325f97..fd1f90b81 100644 --- a/utils/phone_home_stat.php +++ b/utils/phone_home_stat.php @@ -76,7 +76,7 @@ if(Application_Model_Preference::GetSupportFeedback() == '1'){ // Get latest version from stat server and store to db if(Application_Model_Preference::GetPlanLevel() == 'disabled'){ - $url = 'http://stat-dev.sourcefabric.org/airtime_latest_version'; + $url = 'http://stat.sourcefabric.org/airtime_latest_version'; $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);