Merge branch '2.1.x' into devel
This commit is contained in:
commit
b0e93005e5
9 changed files with 152 additions and 73 deletions
|
@ -814,6 +814,12 @@ class ApiController extends Zend_Controller_Action
|
||||||
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off");
|
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off");
|
||||||
Application_Model_LiveLog::SetEndTime($sourcename == 'scheduled_play'?'S':'L',
|
Application_Model_LiveLog::SetEndTime($sourcename == 'scheduled_play'?'S':'L',
|
||||||
new DateTime("now", new DateTimeZone('UTC')));
|
new DateTime("now", new DateTimeZone('UTC')));
|
||||||
|
}elseif($status == "true" && Application_Model_Preference::GetAutoSwitch()){
|
||||||
|
$data = array("sourcename"=>$sourcename, "status"=>"on");
|
||||||
|
Application_Model_RabbitMq::SendMessageToPypo("switch_source", $data);
|
||||||
|
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "on");
|
||||||
|
Application_Model_LiveLog::SetNewLogTime($sourcename == 'scheduled_play'?'S':'L',
|
||||||
|
new DateTime("now", new DateTimeZone('UTC')));
|
||||||
}
|
}
|
||||||
Application_Model_Preference::SetSourceStatus($sourcename, $status);
|
Application_Model_Preference::SetSourceStatus($sourcename, $status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,6 +225,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]);
|
Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]);
|
||||||
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
|
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
|
||||||
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
||||||
|
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
|
||||||
|
|
||||||
if (!$isSaas) {
|
if (!$isSaas) {
|
||||||
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
|
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
|
||||||
|
@ -275,7 +276,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
}
|
}
|
||||||
|
|
||||||
$live_stream_subform->updateVariables();
|
$live_stream_subform->updateVariables();
|
||||||
$this->view->confirm_pypo_restart_text = "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings).";
|
$this->view->confirm_pypo_restart_text = "If you change the username or password values for an enabled stream the playout engine will be rebooted and your listeners will hear silence for 5-10 seconds. Changing the following fields will NOT cause a reboot: Stream Label (Global Settings), and Switch Transition Fade(s), Master Username, and Master Password (Input Stream Settings). If Airtime is recording, and if the change causes a playout engine restart, the recording will be interrupted.";
|
||||||
|
|
||||||
$this->view->num_stream = $num_of_stream;
|
$this->view->num_stream = $num_of_stream;
|
||||||
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
$this->view->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();
|
||||||
|
|
|
@ -49,6 +49,7 @@ class Application_Form_AddUser extends Zend_Form
|
||||||
$email->setLabel('Email:');
|
$email->setLabel('Email:');
|
||||||
$email->setAttrib('class', 'input_text');
|
$email->setAttrib('class', 'input_text');
|
||||||
$email->addFilter('StringTrim');
|
$email->addFilter('StringTrim');
|
||||||
|
$email->setRequired(true);
|
||||||
$email->addValidator('EmailAddress');
|
$email->addValidator('EmailAddress');
|
||||||
$this->addElement($email);
|
$this->addElement($email);
|
||||||
|
|
||||||
|
|
|
@ -15,13 +15,20 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
||||||
$defaultFade = '00.000000';
|
$defaultFade = '00.000000';
|
||||||
}
|
}
|
||||||
|
|
||||||
// automatic switch off
|
// automatic trasition on source disconnection
|
||||||
$auto_transition = new Zend_Form_Element_Checkbox("auto_transition");
|
$auto_transition = new Zend_Form_Element_Checkbox("auto_transition");
|
||||||
$auto_transition->setLabel("Auto Switch Off")
|
$auto_transition->setLabel("Auto Switch Off")
|
||||||
->setValue(Application_Model_Preference::GetAutoTransition())
|
->setValue(Application_Model_Preference::GetAutoTransition())
|
||||||
->setDecorators(array('ViewHelper'));
|
->setDecorators(array('ViewHelper'));
|
||||||
$this->addElement($auto_transition);
|
$this->addElement($auto_transition);
|
||||||
|
|
||||||
|
// automatic switch on upon source connection
|
||||||
|
$auto_switch = new Zend_Form_Element_Checkbox("auto_switch");
|
||||||
|
$auto_switch->setLabel("Auto Switch On")
|
||||||
|
->setValue(Application_Model_Preference::GetAutoSwitch())
|
||||||
|
->setDecorators(array('ViewHelper'));
|
||||||
|
$this->addElement($auto_switch);
|
||||||
|
|
||||||
// Default transition fade
|
// Default transition fade
|
||||||
$transition_fade = new Zend_Form_Element_Text("transition_fade");
|
$transition_fade = new Zend_Form_Element_Text("transition_fade");
|
||||||
$transition_fade->setLabel("Switch Transition Fade (s)")
|
$transition_fade->setLabel("Switch Transition Fade (s)")
|
||||||
|
|
|
@ -877,6 +877,14 @@ class Application_Model_Preference
|
||||||
return self::GetValue("auto_transition");
|
return self::GetValue("auto_transition");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function SetAutoSwitch($value){
|
||||||
|
self::SetValue("auto_switch", $value, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function GetAutoSwitch(){
|
||||||
|
return self::GetValue("auto_switch");
|
||||||
|
}
|
||||||
|
|
||||||
public static function SetEnableSystemEmail($upload) {
|
public static function SetEnableSystemEmail($upload) {
|
||||||
self::SetValue("enable_system_email", $upload);
|
self::SetValue("enable_system_email", $upload);
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ class Application_Model_User {
|
||||||
|
|
||||||
public function setEmail($email){
|
public function setEmail($email){
|
||||||
$user = $this->_userInstance;
|
$user = $this->_userInstance;
|
||||||
$user->setDbEmail($email);
|
$user->setDbEmail(strtolower($email));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setCellPhone($cellPhone){
|
public function setCellPhone($cellPhone){
|
||||||
|
|
|
@ -17,6 +17,22 @@
|
||||||
</ul>
|
</ul>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt id="auto_switch-label">
|
||||||
|
<label class="optional" for="auto_transition"><?php echo $this->element->getElement('auto_switch')->getLabel() ?> :
|
||||||
|
<span class="icecast_metadata_help_icon" id="auto_switch_help">
|
||||||
|
</span>
|
||||||
|
</label>
|
||||||
|
</dt>
|
||||||
|
<dd id="auto_switch-element">
|
||||||
|
<?php echo $this->element->getElement('auto_switch') ?>
|
||||||
|
<?php if($this->element->getElement('auto_switch')->hasErrors()) : ?>
|
||||||
|
<ul class='errors'>
|
||||||
|
<?php foreach($this->element->getElement('auto_switch')->getMessages() as $error): ?>
|
||||||
|
<li><?php echo $error; ?></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<?php endif; ?>
|
||||||
|
</dd>
|
||||||
<dt id="transition_fade-label">
|
<dt id="transition_fade-label">
|
||||||
<label class="optional" for="transition_fade"><?php echo $this->element->getElement('transition_fade')->getLabel() ?> :
|
<label class="optional" for="transition_fade"><?php echo $this->element->getElement('transition_fade')->getLabel() ?> :
|
||||||
</label>
|
</label>
|
||||||
|
|
|
@ -311,6 +311,27 @@ $(document).ready(function() {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$("#auto_switch_help").qtip({
|
||||||
|
content: {
|
||||||
|
text: "Check this box to automatically switch on Master/Show source upon source disconnection."
|
||||||
|
},
|
||||||
|
hide: {
|
||||||
|
delay: 500,
|
||||||
|
fixed: true
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
border: {
|
||||||
|
width: 0,
|
||||||
|
radius: 4
|
||||||
|
},
|
||||||
|
classes: "ui-tooltip-dark ui-tooltip-rounded"
|
||||||
|
},
|
||||||
|
position: {
|
||||||
|
my: "left bottom",
|
||||||
|
at: "right center"
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
$(".stream_username_help_icon").qtip({
|
$(".stream_username_help_icon").qtip({
|
||||||
content: {
|
content: {
|
||||||
text: "If your live streaming client does not ask for a username, this field should be 'source'."
|
text: "If your live streaming client does not ask for a username, this field should be 'source'."
|
||||||
|
|
|
@ -12,7 +12,7 @@ function startDpSelect(dateText, inst) {
|
||||||
date = new Date(time[0], time[1] - 1, time[2]);
|
date = new Date(time[0], time[1] - 1, time[2]);
|
||||||
|
|
||||||
if (inst.input)
|
if (inst.input)
|
||||||
inst.input.trigger('change');
|
inst.input.trigger('input');
|
||||||
}
|
}
|
||||||
|
|
||||||
function endDpSelect(dateText, inst) {
|
function endDpSelect(dateText, inst) {
|
||||||
|
@ -22,7 +22,7 @@ function endDpSelect(dateText, inst) {
|
||||||
date = new Date(time[0], time[1] - 1, time[2]);
|
date = new Date(time[0], time[1] - 1, time[2]);
|
||||||
|
|
||||||
if (inst.input)
|
if (inst.input)
|
||||||
inst.input.trigger('change');
|
inst.input.trigger('input');
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDateInput(el, onSelect) {
|
function createDateInput(el, onSelect) {
|
||||||
|
@ -83,6 +83,14 @@ function beginEditShow(data){
|
||||||
openAddShowForm();
|
openAddShowForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onStartTimeSelect(){
|
||||||
|
$("#add_show_start_time").trigger('input');
|
||||||
|
}
|
||||||
|
|
||||||
|
function onEndTimeSelect(){
|
||||||
|
$("#add_show_end_time").trigger('input');
|
||||||
|
}
|
||||||
|
|
||||||
function setAddShowEvents() {
|
function setAddShowEvents() {
|
||||||
|
|
||||||
var form = $("#add-show-form");
|
var form = $("#add-show-form");
|
||||||
|
@ -255,12 +263,14 @@ function setAddShowEvents() {
|
||||||
createDateInput(form.find("#add_show_end_date_no_repeat"), endDpSelect);
|
createDateInput(form.find("#add_show_end_date_no_repeat"), endDpSelect);
|
||||||
createDateInput(form.find("#add_show_end_date"), endDpSelect);
|
createDateInput(form.find("#add_show_end_date"), endDpSelect);
|
||||||
|
|
||||||
form.find("#add_show_start_time").timepicker({
|
$("#add_show_start_time").timepicker({
|
||||||
amPmText: ['', ''],
|
amPmText: ['', ''],
|
||||||
defaultTime: '00:00'
|
defaultTime: '00:00',
|
||||||
|
onSelect: onStartTimeSelect
|
||||||
});
|
});
|
||||||
form.find("#add_show_end_time").timepicker({
|
$("#add_show_end_time").timepicker({
|
||||||
amPmText: ['', '']
|
amPmText: ['', ''],
|
||||||
|
onSelect: onEndTimeSelect
|
||||||
});
|
});
|
||||||
|
|
||||||
form.find('input[name^="add_show_rebroadcast_date_absolute"]').datepicker({
|
form.find('input[name^="add_show_rebroadcast_date_absolute"]').datepicker({
|
||||||
|
@ -438,10 +448,15 @@ function setAddShowEvents() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var regDate = new RegExp(/^[0-9]{4}-[0-1][0-9]-[0-3][0-9]/);
|
||||||
|
var regTime = new RegExp(/^[0-2][0-9]:[0-5][0-9]/);
|
||||||
|
|
||||||
// when start date/time changes, set end date/time to start date/time+1 hr
|
// when start date/time changes, set end date/time to start date/time+1 hr
|
||||||
$('#add_show_start_date, #add_show_start_time').change(function(){
|
$('#add_show_start_date, #add_show_start_time').bind('input', 'change', function(){
|
||||||
var startDateString = $('#add_show_start_date').val();
|
var startDateString = $('#add_show_start_date').val();
|
||||||
var startTimeString = $('#add_show_start_time').val();
|
var startTimeString = $('#add_show_start_time').val();
|
||||||
|
|
||||||
|
if(regDate.test(startDateString) && regTime.test(startTimeString)){
|
||||||
var startDate = startDateString.split('-');
|
var startDate = startDateString.split('-');
|
||||||
var startTime = startTimeString.split(':');
|
var startTime = startTimeString.split(':');
|
||||||
var startDateTime = new Date(startDate[0], parseInt(startDate[1], 10)-1, startDate[2], startTime[0], startTime[1], 0, 0);
|
var startDateTime = new Date(startDate[0], parseInt(startDate[1], 10)-1, startDate[2], startTime[0], startTime[1], 0, 0);
|
||||||
|
@ -476,18 +491,21 @@ function setAddShowEvents() {
|
||||||
var startDateTimeString = startDateString + " " + startTimeString;
|
var startDateTimeString = startDateString + " " + startTimeString;
|
||||||
var endDateTimeString = $('#add_show_end_date_no_repeat').val() + " " + $('#add_show_end_time').val();
|
var endDateTimeString = $('#add_show_end_date_no_repeat').val() + " " + $('#add_show_end_time').val();
|
||||||
calculateDuration(startDateTimeString, endDateTimeString);
|
calculateDuration(startDateTimeString, endDateTimeString);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// when end date/time changes, check if the changed date is in past of start date/time
|
// when end date/time changes, check if the changed date is in past of start date/time
|
||||||
$('#add_show_end_date_no_repeat, #add_show_end_time').change(function(){
|
$('#add_show_end_date_no_repeat, #add_show_end_time').bind('input', 'change', function(){
|
||||||
|
var endDateString = $('#add_show_end_date_no_repeat').val();
|
||||||
|
var endTimeString = $('#add_show_end_time').val()
|
||||||
|
|
||||||
|
if(regDate.test(endDateString) && regTime.test(endTimeString)){
|
||||||
var startDateString = $('#add_show_start_date').val();
|
var startDateString = $('#add_show_start_date').val();
|
||||||
var startTimeString = $('#add_show_start_time').val();
|
var startTimeString = $('#add_show_start_time').val();
|
||||||
var startDate = startDateString.split('-');
|
var startDate = startDateString.split('-');
|
||||||
var startTime = startTimeString.split(':');
|
var startTime = startTimeString.split(':');
|
||||||
var startDateTime = new Date(startDate[0], parseInt(startDate[1], 10)-1, startDate[2], startTime[0], startTime[1], 0, 0);
|
var startDateTime = new Date(startDate[0], parseInt(startDate[1], 10)-1, startDate[2], startTime[0], startTime[1], 0, 0);
|
||||||
|
|
||||||
var endDateString = $('#add_show_end_date_no_repeat').val();
|
|
||||||
var endTimeString = $('#add_show_end_time').val()
|
|
||||||
var endDate = endDateString.split('-');
|
var endDate = endDateString.split('-');
|
||||||
var endTime = endTimeString.split(':');
|
var endTime = endTimeString.split(':');
|
||||||
var endDateTime = new Date(endDate[0], parseInt(endDate[1], 10)-1, endDate[2], endTime[0], endTime[1], 0, 0);
|
var endDateTime = new Date(endDate[0], parseInt(endDate[1], 10)-1, endDate[2], endTime[0], endTime[1], 0, 0);
|
||||||
|
@ -504,6 +522,7 @@ function setAddShowEvents() {
|
||||||
var startDateTimeString = startDateString + " " + startTimeString;
|
var startDateTimeString = startDateString + " " + startTimeString;
|
||||||
var endDateTimeString = endDateString + " " + endTimeString;
|
var endDateTimeString = endDateString + " " + endTimeString;
|
||||||
calculateDuration(startDateTimeString, endDateTimeString);
|
calculateDuration(startDateTimeString, endDateTimeString);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if($('#cb_custom_auth').attr('checked')){
|
if($('#cb_custom_auth').attr('checked')){
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue