diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index e528308e8..509abecf7 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -526,6 +526,19 @@ class Application_Model_Preference self::SetValue("latest_version", $version); } } + + public static function GetLatestLink(){ + $link = self::GetValue("latest_link"); + if($link == null || strlen($link) == 0) { + return ""; + } else { + return $link; + } + } + + public static function SetLatestLink($link){ + self::SetValue("latest_link", $link); + } public static function SetUploadToSoundcloudOption($upload) { self::SetValue("soundcloud_upload_option", $upload); diff --git a/airtime_mvc/application/views/helpers/VersionNotify.php b/airtime_mvc/application/views/helpers/VersionNotify.php index 655843f0e..430f7f2ed 100644 --- a/airtime_mvc/application/views/helpers/VersionNotify.php +++ b/airtime_mvc/application/views/helpers/VersionNotify.php @@ -19,6 +19,7 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract{ // retrieve and validate current and latest versions, $current = Application_Model_Preference::GetAirtimeVersion(); $latest = Application_Model_Preference::GetLatestVersion(); + $link = Application_Model_Preference::GetLatestLink(); $pattern = "/^([0-9]+)\.([0-9]+)\.[0-9]+/"; preg_match($pattern, $current, $curMatch); preg_match($pattern, $latest, $latestMatch); @@ -50,6 +51,7 @@ class Airtime_View_Helper_VersionNotify extends Zend_View_Helper_Abstract{ $result = "
" . " " . " " + . " " . ""; return $result; } diff --git a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js index e428cc7f3..6087bb6a2 100644 --- a/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js +++ b/airtime_mvc/public/js/airtime/dashboard/versiontooltip.js @@ -40,6 +40,13 @@ function getLatestVersion() { return $("#version-latest").html(); } +/** + * Returns the download link to latest release in HTML + */ +function getLatestLink() { + return "" + getLatestVersion() + ""; +} + /** * Returns true if current version is up to date */ @@ -51,13 +58,6 @@ function isUpToDate() { return (diff == 0 && current == latest) || diff < 0; } -/** - * Returns the download link to latest release in HTML - */ -function getLatestLink() { - return "" + getLatestVersion() + ""; -} - /** * Sets up the tooltip for version notification */ diff --git a/utils/phone_home_stat.php b/utils/phone_home_stat.php index fd1f90b81..24a975d06 100644 --- a/utils/phone_home_stat.php +++ b/utils/phone_home_stat.php @@ -82,8 +82,10 @@ if(Application_Model_Preference::GetPlanLevel() == 'disabled'){ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_URL, $url); $result = curl_exec($ch); + $resultArray = explode("\n", $result); - Application_Model_Preference::SetLatestVersion($result); + Application_Model_Preference::SetLatestVersion($resultArray[0]); + Application_Model_Preference::SetLatestLink($resultArray[1]); } /**