diff --git a/airtime_mvc/application/controllers/DashboardController.php b/airtime_mvc/application/controllers/DashboardController.php
index 8b918137d..afdb26f33 100644
--- a/airtime_mvc/application/controllers/DashboardController.php
+++ b/airtime_mvc/application/controllers/DashboardController.php
@@ -35,7 +35,7 @@ class DashboardController extends Zend_Controller_Action
public function aboutAction()
{
- // action body
+ $this->view->airtime_version = Application_Model_Preference::GetAirtimeVersion();
}
}
diff --git a/airtime_mvc/application/controllers/UserController.php b/airtime_mvc/application/controllers/UserController.php
index b84a0dede..37404931c 100644
--- a/airtime_mvc/application/controllers/UserController.php
+++ b/airtime_mvc/application/controllers/UserController.php
@@ -63,6 +63,7 @@ class UserController extends Zend_Controller_Action
public function getHostsAction()
{
$search = $this->_getParam('term');
+ $res = Application_Model_User::getHosts($search);
$this->view->hosts = Application_Model_User::getHosts($search);
}
diff --git a/airtime_mvc/application/forms/AddShowWho.php b/airtime_mvc/application/forms/AddShowWho.php
index 360a5abea..22dd109eb 100644
--- a/airtime_mvc/application/forms/AddShowWho.php
+++ b/airtime_mvc/application/forms/AddShowWho.php
@@ -16,7 +16,7 @@ class Application_Form_AddShowWho extends Zend_Form_SubForm
$hosts = Application_Model_User::getHosts();
foreach ($hosts as $host) {
- $options[$host['value']] = $host['label'];
+ $options[$host['index']] = $host['label'];
}
//Add hosts selection
diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php
index e856681f0..82b29e387 100644
--- a/airtime_mvc/application/models/Preference.php
+++ b/airtime_mvc/application/models/Preference.php
@@ -526,6 +526,24 @@ 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 "http://www.sourcefabric.org/en/airtime/download/";
+ } else {
+ return $link;
+ }
+ }
+
+ public static function SetLatestLink($link){
+ $pattern = "#^(http|https|ftp)://" .
+ "([a-zA-Z0-9]+\.)*[a-zA-Z0-9]+" .
+ "(/[a-zA-Z0-9\-\.\_\~\:\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+)*/?$#";
+ if(preg_match($pattern, $link)) {
+ self::SetValue("latest_link", $link);
+ }
+ }
public static function SetUploadToSoundcloudOption($upload) {
self::SetValue("soundcloud_upload_option", $upload);
@@ -559,19 +577,24 @@ class Application_Model_Preference
/* User specific preferences start */
/**
- * Sets the time scale preference (day/week/month) in Calendar.
+ * Sets the time scale preference (agendaDay/agendaWeek/month) in Calendar.
*
* @param $timeScale new time scale
*/
- public static function SetCalendarTimeScale($timeScale) {
- return self::SetValue("calendar_time_scale", $timeScale, true /* user specific */);
+ public static function SetCalendarTimeScale($timeScale) {
+ self::SetValue("calendar_time_scale", $timeScale, true /* user specific */);
}
/**
* Retrieves the time scale preference for the current user.
+ * Defaults to month if no entry exists
*/
public static function GetCalendarTimeScale() {
- return self::GetValue("calendar_time_scale", true /* user specific */);
+ $val = self::GetValue("calendar_time_scale", true /* user specific */);
+ if(strlen($val) == 0) {
+ $val = "month";
+ }
+ return $val;
}
/**
@@ -580,14 +603,19 @@ class Application_Model_Preference
* @param $numEntries new number of entries to show
*/
public static function SetLibraryNumEntries($numEntries) {
- return self::SetValue("library_num_entries", $numEntries, true /* user specific */);
+ self::SetValue("library_num_entries", $numEntries, true /* user specific */);
}
/**
* Retrieves the number of entries to show preference in library under Playlist Builder.
+ * Defaults to 10 if no entry exists
*/
public static function GetLibraryNumEntries() {
- return self::GetValue("library_num_entries", true /* user specific */);
+ $val = self::GetValue("library_num_entries", true /* user specific */);
+ if(strlen($val) == 0) {
+ $val = "10";
+ }
+ return $val;
}
/**
@@ -595,15 +623,20 @@ class Application_Model_Preference
*
* @param $timeInterval new time interval
*/
- public static function SetCalendarTimeInterval($timeInterval) {
- return self::SetValue("calendar_time_interval", $timeInterval, true /* user specific */);
+ public static function SetCalendarTimeInterval($timeInterval) {
+ self::SetValue("calendar_time_interval", $timeInterval, true /* user specific */);
}
/**
* Retrieves the time interval preference for the current user.
+ * Defaults to 30 min if no entry exists
*/
public static function GetCalendarTimeInterval() {
- return self::GetValue("calendar_time_interval", true /* user specific */);
+ $val = self::GetValue("calendar_time_interval", true /* user specific */);
+ if(strlen($val) == 0) {
+ $val = "30";
+ }
+ return $val;
}
/* User specific preferences end */
diff --git a/airtime_mvc/application/models/User.php b/airtime_mvc/application/models/User.php
index 6f0ec13c7..81548f013 100644
--- a/airtime_mvc/application/models/User.php
+++ b/airtime_mvc/application/models/User.php
@@ -163,7 +163,7 @@ class Application_Model_User {
$sql;
- $sql_gen = "SELECT id AS value, login AS label FROM cc_subjs ";
+ $sql_gen = "SELECT login AS value, login AS label, id as index FROM cc_subjs ";
$sql = $sql_gen;
if(is_array($type)) {
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 = "
" . $diff . "
"
. "" . $current . "
"
. "" . $latest . "
"
+ . "" . $link . "
"
. "";
return $result;
}
diff --git a/airtime_mvc/application/views/scripts/dashboard/about.phtml b/airtime_mvc/application/views/scripts/dashboard/about.phtml
index 6a551c1e4..bdedfcfd2 100644
--- a/airtime_mvc/application/views/scripts/dashboard/about.phtml
+++ b/airtime_mvc/application/views/scripts/dashboard/about.phtml
@@ -1,7 +1,7 @@
About
-Airtime , the open radio software for scheduling and remote station management.
+Airtime airtime_version ?>, the open radio software for scheduling and remote station management.
© 2011 Sourcefabric o.p.s 2011. Airtime is distributed under the GNU GPL v.3
diff --git a/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml b/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml
index 5417b35a6..020be44a9 100644
--- a/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml
+++ b/airtime_mvc/application/views/scripts/form/stream-setting-form.phtml
@@ -1,7 +1,7 @@
stream_number;
?>
-
+
stream_number != '1'?'style="display: none;':''?> id="=$s_name?>-config">