Merge branch '2.3.x' into 2.3.x-saas
This commit is contained in:
commit
7c327e4c75
|
@ -4,10 +4,6 @@ class LocaleController extends Zend_Controller_Action
|
||||||
{
|
{
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$ajaxContext = $this->_helper->getHelper("AjaxContext");
|
|
||||||
$ajaxContext->addActionContext("general-translation-table", "json")
|
|
||||||
->addActionContext("datatables-translation-table", "json")
|
|
||||||
->initContext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function datatablesTranslationTableAction()
|
public function datatablesTranslationTableAction()
|
||||||
|
@ -26,7 +22,7 @@ class LocaleController extends Zend_Controller_Action
|
||||||
$locale.".txt")
|
$locale.".txt")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function generalTranslationTableAction()
|
public function generalTranslationTableAction()
|
||||||
{
|
{
|
||||||
$translations = array (
|
$translations = array (
|
||||||
|
|
|
@ -110,7 +110,7 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
|
||||||
{
|
{
|
||||||
$controller = strtolower($request->getControllerName());
|
$controller = strtolower($request->getControllerName());
|
||||||
|
|
||||||
if (in_array($controller, array("api", "auth"))) {
|
if (in_array($controller, array("api", "auth", "locale"))) {
|
||||||
|
|
||||||
$this->setRoleName("G");
|
$this->setRoleName("G");
|
||||||
} elseif (!Zend_Auth::getInstance()->hasIdentity()) {
|
} elseif (!Zend_Auth::getInstance()->hasIdentity()) {
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setAction(Application_Common_OsPath::getBaseDir().'/Showbuilder');
|
$this->setAction(Application_Common_OsPath::getBaseDir().'Showbuilder');
|
||||||
$this->setMethod('post');
|
$this->setMethod('post');
|
||||||
|
|
||||||
$country_list = Application_Model_Preference::GetCountryList();
|
$country_list = Application_Model_Preference::GetCountryList();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
$(window).load(function(){
|
$(window).load(function(){
|
||||||
$("#username").focus();
|
$("#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() {
|
$(document).ready(function() {
|
||||||
|
|
|
@ -154,6 +154,7 @@ $(document).ready(function() {
|
||||||
$.post(url, {format: "json", data: data}, function(data){
|
$.post(url, {format: "json", data: data}, function(data){
|
||||||
var json = $.parseJSON(data);
|
var json = $.parseJSON(data);
|
||||||
$('#content').empty().append(json.html);
|
$('#content').empty().append(json.html);
|
||||||
|
$.cookie("default_airtime_locale", $('#locale').val(), {path: '/'});
|
||||||
setTimeout(removeSuccessMsg, 5000);
|
setTimeout(removeSuccessMsg, 5000);
|
||||||
showErrorSections();
|
showErrorSections();
|
||||||
});
|
});
|
||||||
|
|
|
@ -217,7 +217,7 @@ class PypoFetch(Thread):
|
||||||
self.set_bootstrap_variables()
|
self.set_bootstrap_variables()
|
||||||
#get the most up to date schedule, which will #initiate the process
|
#get the most up to date schedule, which will #initiate the process
|
||||||
#of making sure Liquidsoap is playing the schedule
|
#of making sure Liquidsoap is playing the schedule
|
||||||
self.manual_schedule_fetch()
|
self.persistent_manual_schedule_fetch(max_attempts=5)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.logger.error(str(e))
|
self.logger.error(str(e))
|
||||||
|
|
||||||
|
@ -488,10 +488,20 @@ class PypoFetch(Thread):
|
||||||
self.process_schedule(self.schedule_data)
|
self.process_schedule(self.schedule_data)
|
||||||
return success
|
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):
|
def main(self):
|
||||||
# Bootstrap: since we are just starting up, we need to grab the
|
# Bootstrap: since we are just starting up, we need to grab the
|
||||||
# most recent schedule. After that we can just wait for updates.
|
# 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:
|
if success:
|
||||||
self.logger.info("Bootstrap schedule received: %s", self.schedule_data)
|
self.logger.info("Bootstrap schedule received: %s", self.schedule_data)
|
||||||
self.set_bootstrap_variables()
|
self.set_bootstrap_variables()
|
||||||
|
@ -519,7 +529,7 @@ class PypoFetch(Thread):
|
||||||
self.handle_message(message)
|
self.handle_message(message)
|
||||||
except Empty, e:
|
except Empty, e:
|
||||||
self.logger.info("Queue timeout. Fetching schedule manually")
|
self.logger.info("Queue timeout. Fetching schedule manually")
|
||||||
self.manual_schedule_fetch()
|
self.persistent_manual_schedule_fetch(max_attempts=5)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
import traceback
|
import traceback
|
||||||
top = traceback.format_exc()
|
top = traceback.format_exc()
|
||||||
|
|
Loading…
Reference in New Issue