diff --git a/airtime_mvc/application/controllers/LocaleController.php b/airtime_mvc/application/controllers/LocaleController.php index d689417be..efdecff80 100644 --- a/airtime_mvc/application/controllers/LocaleController.php +++ b/airtime_mvc/application/controllers/LocaleController.php @@ -4,10 +4,6 @@ class LocaleController extends Zend_Controller_Action { public function init() { - $ajaxContext = $this->_helper->getHelper("AjaxContext"); - $ajaxContext->addActionContext("general-translation-table", "json") - ->addActionContext("datatables-translation-table", "json") - ->initContext(); } public function datatablesTranslationTableAction() @@ -26,7 +22,7 @@ class LocaleController extends Zend_Controller_Action $locale.".txt") ); } - + public function generalTranslationTableAction() { $translations = array ( diff --git a/airtime_mvc/application/controllers/plugins/Acl_plugin.php b/airtime_mvc/application/controllers/plugins/Acl_plugin.php index 4cadba9db..44555e533 100644 --- a/airtime_mvc/application/controllers/plugins/Acl_plugin.php +++ b/airtime_mvc/application/controllers/plugins/Acl_plugin.php @@ -110,7 +110,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract { $controller = strtolower($request->getControllerName()); - if (in_array($controller, array("api", "auth"))) { + if (in_array($controller, array("api", "auth", "locale"))) { $this->setRoleName("G"); } elseif (!Zend_Auth::getInstance()->hasIdentity()) { diff --git a/airtime_mvc/application/forms/RegisterAirtime.php b/airtime_mvc/application/forms/RegisterAirtime.php index d1557612a..2da7083c8 100644 --- a/airtime_mvc/application/forms/RegisterAirtime.php +++ b/airtime_mvc/application/forms/RegisterAirtime.php @@ -7,7 +7,7 @@ class Application_Form_RegisterAirtime extends Zend_Form public function init() { - $this->setAction(Application_Common_OsPath::getBaseDir().'/Showbuilder'); + $this->setAction(Application_Common_OsPath::getBaseDir().'Showbuilder'); $this->setMethod('post'); $country_list = Application_Model_Preference::GetCountryList(); diff --git a/airtime_mvc/public/js/airtime/login/login.js b/airtime_mvc/public/js/airtime/login/login.js index a37210b35..f21043c31 100644 --- a/airtime_mvc/public/js/airtime/login/login.js +++ b/airtime_mvc/public/js/airtime/login/login.js @@ -1,6 +1,6 @@ $(window).load(function(){ $("#username").focus(); - $("#locale").val($.cookie("airtime_locale")!== null?$.cookie("airtime_locale"):'en_CA'); + $("#locale").val($.cookie("airtime_locale")!== null?$.cookie("airtime_locale"):$.cookie("default_airtime_locale")); }); $(document).ready(function() { diff --git a/airtime_mvc/public/js/airtime/preferences/preferences.js b/airtime_mvc/public/js/airtime/preferences/preferences.js index 0c50762b0..69a858a55 100644 --- a/airtime_mvc/public/js/airtime/preferences/preferences.js +++ b/airtime_mvc/public/js/airtime/preferences/preferences.js @@ -154,6 +154,7 @@ $(document).ready(function() { $.post(url, {format: "json", data: data}, function(data){ var json = $.parseJSON(data); $('#content').empty().append(json.html); + $.cookie("default_airtime_locale", $('#locale').val(), {path: '/'}); setTimeout(removeSuccessMsg, 5000); showErrorSections(); }); diff --git a/python_apps/pypo/pypofetch.py b/python_apps/pypo/pypofetch.py index ec3ef11ce..b690ace04 100644 --- a/python_apps/pypo/pypofetch.py +++ b/python_apps/pypo/pypofetch.py @@ -217,7 +217,7 @@ class PypoFetch(Thread): self.set_bootstrap_variables() #get the most up to date schedule, which will #initiate the process #of making sure Liquidsoap is playing the schedule - self.manual_schedule_fetch() + self.persistent_manual_schedule_fetch(max_attempts=5) except Exception, e: self.logger.error(str(e)) @@ -488,10 +488,20 @@ class PypoFetch(Thread): self.process_schedule(self.schedule_data) return success + def persistent_manual_schedule_fetch(self, max_attempts=1): + success = False + num_attempts = 0 + while not success and num_attempts < max_attempts: + success = self.manual_schedule_fetch() + num_attempts += 1 + + return success + + def main(self): # Bootstrap: since we are just starting up, we need to grab the # most recent schedule. After that we can just wait for updates. - success = self.manual_schedule_fetch() + success = self.persistent_manual_schedule_fetch(max_attempts=5) if success: self.logger.info("Bootstrap schedule received: %s", self.schedule_data) self.set_bootstrap_variables() @@ -519,7 +529,7 @@ class PypoFetch(Thread): self.handle_message(message) except Empty, e: self.logger.info("Queue timeout. Fetching schedule manually") - self.manual_schedule_fetch() + self.persistent_manual_schedule_fetch(max_attempts=5) except Exception, e: import traceback top = traceback.format_exc()