Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
e0b71568b7
17 changed files with 44 additions and 38 deletions
|
@ -177,6 +177,8 @@ class AudiopreviewController extends Zend_Controller_Action
|
||||||
|
|
||||||
private function createElementMap($track)
|
private function createElementMap($track)
|
||||||
{
|
{
|
||||||
|
$baseUrl = Application_Common_OsPath::getBaseDir();
|
||||||
|
|
||||||
$elementMap = array( 'element_title' => isset($track['track_title'])?$track['track_title']:"",
|
$elementMap = array( 'element_title' => isset($track['track_title'])?$track['track_title']:"",
|
||||||
'element_artist' => isset($track['artist_name'])?$track['artist_name']:"",
|
'element_artist' => isset($track['artist_name'])?$track['artist_name']:"",
|
||||||
'element_id' => isset($track['id'])?$track['id']:"",
|
'element_id' => isset($track['id'])?$track['id']:"",
|
||||||
|
|
|
@ -117,6 +117,7 @@ class LocaleController extends Zend_Controller_Action
|
||||||
"Dynamic block is not previewable" => _("Dynamic block is not previewable"),
|
"Dynamic block is not previewable" => _("Dynamic block is not previewable"),
|
||||||
"Limit to: " => _("Limit to: "),
|
"Limit to: " => _("Limit to: "),
|
||||||
"Playlist saved" => _("Playlist saved"),
|
"Playlist saved" => _("Playlist saved"),
|
||||||
|
"Playlist shuffled" => _("Playlist shuffled"),
|
||||||
"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
|
"Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."
|
||||||
=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
|
=> _("Airtime is unsure about the status of this file. This can happen when the file is on a remote drive that is unaccessible or the file is in a directory that isn't 'watched' anymore."),
|
||||||
//listenerstat/listenerstat.js
|
//listenerstat/listenerstat.js
|
||||||
|
|
|
@ -13,7 +13,7 @@ class LoginController extends Zend_Controller_Action
|
||||||
|
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
|
|
||||||
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale'));
|
Application_Model_Locale::configureLocalization($request->getcookie('airtime_locale', 'en_CA'));
|
||||||
if (Zend_Auth::getInstance()->hasIdentity())
|
if (Zend_Auth::getInstance()->hasIdentity())
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -129,12 +129,7 @@ class UserController extends Zend_Controller_Action
|
||||||
$request = $this->getRequest();
|
$request = $this->getRequest();
|
||||||
$form = new Application_Form_EditUser();
|
$form = new Application_Form_EditUser();
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
$params = $request->getPost();
|
$formData = $request->getPost();
|
||||||
$postData = explode('&', $params['data']);
|
|
||||||
foreach($postData as $k=>$v) {
|
|
||||||
$v = explode('=', $v);
|
|
||||||
$formData[$v[0]] = urldecode($v[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
if (isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1
|
||||||
&& $formData['cu_login'] == 'admin') {
|
&& $formData['cu_login'] == 'admin') {
|
||||||
|
@ -157,12 +152,19 @@ class UserController extends Zend_Controller_Action
|
||||||
$user->setSkype($formData['cu_skype']);
|
$user->setSkype($formData['cu_skype']);
|
||||||
$user->setJabber($formData['cu_jabber']);
|
$user->setJabber($formData['cu_jabber']);
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
Application_Model_Preference::SetUserLocale($user->getId(), $formData['cu_locale']);
|
Application_Model_Preference::SetUserLocale($user->getId(), $formData['cu_locale']);
|
||||||
Application_Model_Preference::SetUserTimezone($user->getId(), $formData['cu_timezone']);
|
Application_Model_Preference::SetUserTimezone($user->getId(), $formData['cu_timezone']);
|
||||||
$this->view->successMessage = "<div class='success'>"._("User updated successfully!")."</div>";
|
|
||||||
|
//configure localization with new locale setting
|
||||||
|
Application_Model_Locale::configureLocalization($formData['cu_locale']);
|
||||||
|
//reinitialize form so language gets translated
|
||||||
|
$form = new Application_Form_EditUser();
|
||||||
|
|
||||||
|
$this->view->successMessage = "<div class='success'>"._("Settings updated successfully!")."</div>";
|
||||||
}
|
}
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
die(json_encode(array("locale"=>$formData['cu_locale'], "html"=>$this->view->render('user/edit-user.phtml'))));
|
$this->view->html = $this->view->render('user/edit-user.phtml');
|
||||||
}
|
}
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
$this->view->html = $this->view->render('user/edit-user.phtml');
|
$this->view->html = $this->view->render('user/edit-user.phtml');
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Application_Form_EditUser extends Zend_Form
|
||||||
$emailValidator = Application_Form_Helper_ValidationTypes::overrideEmailAddressValidator();
|
$emailValidator = Application_Form_Helper_ValidationTypes::overrideEmailAddressValidator();
|
||||||
|
|
||||||
$this->setDecorators(array(
|
$this->setDecorators(array(
|
||||||
array('ViewScript', array('viewScript' => 'form/edit-user.phtml'))));
|
array('ViewScript', array('viewScript' => 'form/edit-user.phtml', "currentUser" => $currentUser->getLogin()))));
|
||||||
$this->setAttrib('id', 'current-user-form');
|
$this->setAttrib('id', 'current-user-form');
|
||||||
|
|
||||||
$hidden = new Zend_Form_Element_Hidden('cu_user_id');
|
$hidden = new Zend_Form_Element_Hidden('cu_user_id');
|
||||||
|
|
|
@ -7,7 +7,7 @@ class Application_Form_RegisterAirtime extends Zend_Form
|
||||||
|
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setAction('/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();
|
||||||
|
|
|
@ -452,12 +452,12 @@ class Application_Model_Preference
|
||||||
if (is_null($timezone)) {
|
if (is_null($timezone)) {
|
||||||
$timezone = self::GetDefaultTimezone();
|
$timezone = self::GetDefaultTimezone();
|
||||||
}
|
}
|
||||||
self::setValue("user_".$userId."_timezone", $timezone, true, $userId);
|
self::setValue("user_timezone", $timezone, true, $userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetUserTimezone($id)
|
public static function GetUserTimezone($id)
|
||||||
{
|
{
|
||||||
return self::getValue("user_".$id."_timezone", true);
|
return self::getValue("user_timezone", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetTimezone()
|
public static function GetTimezone()
|
||||||
|
@ -484,7 +484,7 @@ class Application_Model_Preference
|
||||||
|
|
||||||
public static function GetUserLocale($id)
|
public static function GetUserLocale($id)
|
||||||
{
|
{
|
||||||
return self::getValue("user_".$id."_locale", true);
|
return self::getValue("user_locale", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function SetUserLocale($userId, $locale = null)
|
public static function SetUserLocale($userId, $locale = null)
|
||||||
|
@ -494,7 +494,7 @@ class Application_Model_Preference
|
||||||
if (is_null($locale)) {
|
if (is_null($locale)) {
|
||||||
$locale = self::GetDefaultLocale();
|
$locale = self::GetDefaultLocale();
|
||||||
}
|
}
|
||||||
self::setValue("user_".$userId."_locale", $locale, true, $userId);
|
self::setValue("user_locale", $locale, true, $userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function GetLocale()
|
public static function GetLocale()
|
||||||
|
|
|
@ -270,11 +270,7 @@ class Application_Model_ShowBuilder
|
||||||
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_out']);
|
$cue_out = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_out']);
|
||||||
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_in']);
|
$cue_in = Application_Common_DateHelper::calculateLengthInSeconds($p_item['cue_in']);
|
||||||
|
|
||||||
if ($cue_out == 0 && $cue_in == 0) {
|
|
||||||
$run_time = Application_Common_DateHelper::calculateLengthInSeconds($p_item['file_length']);
|
|
||||||
} else {
|
|
||||||
$run_time = $cue_out-$cue_in;
|
$run_time = $cue_out-$cue_in;
|
||||||
}
|
|
||||||
|
|
||||||
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
|
$formatter = new LengthFormatter(Application_Common_DateHelper::ConvertMSToHHMMSSmm($run_time*1000));
|
||||||
$row['runtime'] = $formatter->format();
|
$row['runtime'] = $formatter->format();
|
||||||
|
|
|
@ -129,9 +129,15 @@ class Application_Model_StoredFile
|
||||||
|
|
||||||
# Translate metadata attributes from media monitor (MDATA_KEY_*)
|
# Translate metadata attributes from media monitor (MDATA_KEY_*)
|
||||||
# to their counterparts in constants.php (usually the column names)
|
# to their counterparts in constants.php (usually the column names)
|
||||||
|
$track_length = $p_md['MDATA_KEY_DURATION'];
|
||||||
|
$track_length_in_sec = Application_Common_DateHelper::calculateLengthInSeconds($track_length);
|
||||||
foreach ($p_md as $mdConst => $mdValue) {
|
foreach ($p_md as $mdConst => $mdValue) {
|
||||||
if (defined($mdConst)) {
|
if (defined($mdConst)) {
|
||||||
|
if ($mdConst == "MDATA_KEY_CUE_OUT" && $mdValue == '0.0') {
|
||||||
|
$mdValue = $track_length_in_sec;
|
||||||
|
}
|
||||||
$dbMd[constant($mdConst)] = $mdValue;
|
$dbMd[constant($mdConst)] = $mdValue;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Logging::warn("using metadata that is not defined.
|
Logging::warn("using metadata that is not defined.
|
||||||
[$mdConst] => [$mdValue]");
|
[$mdConst] => [$mdValue]");
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
|
<h2><? echo sprintf(_("%s's Settings"), $this->currentUser) ?></h2>
|
||||||
<div id="current-user-container">
|
<div id="current-user-container">
|
||||||
<form id="current-user-form" class="edit-user-global" enctype="application/x-www-form-urlencoded">
|
<form id="current-user-form" class="edit-user-global" method="post" enctype="application/x-www-form-urlencoded">
|
||||||
<dl class="zend_form">
|
<dl class="zend_form">
|
||||||
<?php echo $this->element->getElement('cu_user_id') ?>
|
<?php echo $this->element->getElement('cu_user_id') ?>
|
||||||
<dt id="cu-username-label">
|
<dt id="cu-username-label">
|
||||||
|
@ -142,7 +143,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
<button id="cu_save_user" type="button" class="btn btn-small right-floated">Save</button>
|
<button type="submit" id="cu_save_user" class="btn btn-small right-floated">Save</button>
|
||||||
</dl>
|
</dl>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
|
@ -1,5 +1,4 @@
|
||||||
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong edit-current-user">
|
<div class="ui-widget ui-widget-content block-shadow clearfix padded-strong edit-current-user">
|
||||||
<h2><? echo _("Edit User") ?></h2>
|
|
||||||
<?php echo $this->successMessage ?>
|
<?php echo $this->successMessage ?>
|
||||||
<?php echo $this->form?>
|
<?php echo $this->form?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -322,7 +322,7 @@ INSERT INTO cc_stream_setting (keyname, value, type) VALUES ('s3_channels', 'ste
|
||||||
-- added in 2.3
|
-- added in 2.3
|
||||||
INSERT INTO cc_pref("keystr", "valstr") VALUES('locale', 'en_CA');
|
INSERT INTO cc_pref("keystr", "valstr") VALUES('locale', 'en_CA');
|
||||||
|
|
||||||
INSERT INTO cc_pref("subjid", "keystr", "valstr") VALUES(1, 'user_1_locale', 'en_CA');
|
INSERT INTO cc_pref("subjid", "keystr", "valstr") VALUES(1, 'user_locale', 'en_CA');
|
||||||
|
|
||||||
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('zh_CN', 'Chinese');
|
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('zh_CN', 'Chinese');
|
||||||
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English');
|
INSERT INTO cc_locale (locale_code, locale_lang) VALUES ('en_CA', 'English');
|
||||||
|
|
|
@ -462,14 +462,7 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#cu_save_user').live('click', function() {
|
$('#cu_save_user').live('click', function() {
|
||||||
var data = $('#current-user-form').serialize();
|
$.cookie("airtime_locale", $('#cu_locale').val(), {path: '/'});
|
||||||
$.post(baseUrl+'/user/edit-user', {format: 'json', data: data}, function(data) {
|
|
||||||
var json = $.parseJSON(data);
|
|
||||||
$('.edit-current-user').parent().empty().append(json.html);
|
|
||||||
$.cookie("airtime_locale", json.locale, {path: '/'});
|
|
||||||
setCurrentUserPseudoPassword();
|
|
||||||
setTimeout(removeSuccessMsg, 5000);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// When the 'Listen' button is clicked we set the width
|
// When the 'Listen' button is clicked we set the width
|
||||||
|
|
|
@ -641,7 +641,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
|
|
||||||
$pl.on("click", 'button[id="playlist_shuffle_button"]', function(){
|
$pl.on("click", 'button[id="playlist_shuffle_button"]', function(){
|
||||||
obj_id = $('input[id="obj_id"]').val();
|
obj_id = $('input[id="obj_id"]').val();
|
||||||
url = "/Playlist/shuffle";
|
url = baseUrl+"/Playlist/shuffle";
|
||||||
enableLoadingIcon();
|
enableLoadingIcon();
|
||||||
$.post(url, {format: "json", obj_id: obj_id}, function(data){
|
$.post(url, {format: "json", obj_id: obj_id}, function(data){
|
||||||
var json = $.parseJSON(data)
|
var json = $.parseJSON(data)
|
||||||
|
@ -651,7 +651,7 @@ var AIRTIME = (function(AIRTIME){
|
||||||
}
|
}
|
||||||
AIRTIME.playlist.fnOpenPlaylist(json);
|
AIRTIME.playlist.fnOpenPlaylist(json);
|
||||||
if (json.result == "0") {
|
if (json.result == "0") {
|
||||||
$pl.find('.success').text('Playlist shuffled');
|
$pl.find('.success').text($.i18n._('Playlist shuffled'));
|
||||||
$pl.find('.success').show();
|
$pl.find('.success').show();
|
||||||
}
|
}
|
||||||
disableLoadingIcon();
|
disableLoadingIcon();
|
||||||
|
|
|
@ -2,3 +2,9 @@ $(window).load(function(){
|
||||||
$("#username").focus();
|
$("#username").focus();
|
||||||
$("#locale").val($.cookie("airtime_locale"));
|
$("#locale").val($.cookie("airtime_locale"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("#submit").click(function() {
|
||||||
|
$.cookie("airtime_locale", $("#locale").val(), {path: '/'});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
@ -171,7 +171,7 @@ AIRTIME = (function(AIRTIME) {
|
||||||
schedTable.fnDraw();
|
schedTable.fnDraw();
|
||||||
|
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
url : "/usersettings/set-now-playing-screen-settings",
|
url : baseUrl+"/usersettings/set-now-playing-screen-settings",
|
||||||
type : "POST",
|
type : "POST",
|
||||||
data : {
|
data : {
|
||||||
settings : {
|
settings : {
|
||||||
|
@ -197,7 +197,7 @@ AIRTIME = (function(AIRTIME) {
|
||||||
schedTable.fnDraw();
|
schedTable.fnDraw();
|
||||||
|
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
url : "/usersettings/set-now-playing-screen-settings",
|
url : baseUrl+"/usersettings/set-now-playing-screen-settings",
|
||||||
type : "POST",
|
type : "POST",
|
||||||
data : {
|
data : {
|
||||||
settings : {
|
settings : {
|
||||||
|
@ -271,7 +271,7 @@ AIRTIME = (function(AIRTIME) {
|
||||||
$.ajax( {
|
$.ajax( {
|
||||||
"dataType" : "json",
|
"dataType" : "json",
|
||||||
"type" : "GET",
|
"type" : "GET",
|
||||||
"url" : "/showbuilder/check-builder-feed",
|
"url" : baseUrl+"/showbuilder/check-builder-feed",
|
||||||
"data" : data,
|
"data" : data,
|
||||||
"success" : function(json) {
|
"success" : function(json) {
|
||||||
if (json.update === true) {
|
if (json.update === true) {
|
||||||
|
|
|
@ -340,7 +340,7 @@ class AirtimeInstall
|
||||||
if ($result < 1) {
|
if ($result < 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$sql = "INSERT INTO cc_pref (subjid, keystr, valstr) VALUES (1, 'user_1_timezone', '$defaultTimezone')";
|
$sql = "INSERT INTO cc_pref (subjid, keystr, valstr) VALUES (1, 'user_timezone', '$defaultTimezone')";
|
||||||
$result = $con->exec($sql);
|
$result = $con->exec($sql);
|
||||||
if ($result < 1) {
|
if ($result < 1) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue