Merge branch '2.1.x' of dev.sourcefabric.org:airtime into 2.1.x

This commit is contained in:
denise 2012-06-15 14:42:37 -04:00
commit 87faf47c94
8 changed files with 151 additions and 72 deletions

View file

@ -814,6 +814,12 @@ class ApiController extends Zend_Controller_Action
Application_Model_Preference::SetSourceSwitchStatus($sourcename, "off");
Application_Model_LiveLog::SetEndTime($sourcename == 'scheduled_play'?'S':'L',
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);
}

View file

@ -215,6 +215,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetLiveSteamMasterPassword($values["master_password"]);
Application_Model_Preference::SetDefaultTransitionFade($values["transition_fade"]);
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
if (!$isSaas) {
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
@ -265,7 +266,7 @@ class PreferenceController extends Zend_Controller_Action
}
$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->enable_stream_conf = Application_Model_Preference::GetEnableStreamConf();

View file

@ -49,6 +49,7 @@ class Application_Form_AddUser extends Zend_Form
$email->setLabel('Email:');
$email->setAttrib('class', 'input_text');
$email->addFilter('StringTrim');
$email->setRequired(true);
$email->addValidator('EmailAddress');
$this->addElement($email);

View file

@ -15,13 +15,20 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$defaultFade = '00.000000';
}
// automatic switch off
// automatic trasition on source disconnection
$auto_transition = new Zend_Form_Element_Checkbox("auto_transition");
$auto_transition->setLabel("Auto Switch Off")
->setValue(Application_Model_Preference::GetAutoTransition())
->setDecorators(array('ViewHelper'));
$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
$transition_fade = new Zend_Form_Element_Text("transition_fade");
$transition_fade->setLabel("Switch Transition Fade (s)")

View file

@ -877,6 +877,14 @@ class Application_Model_Preference
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) {
self::SetValue("enable_system_email", $upload);
}

View file

@ -17,6 +17,22 @@
</ul>
<?php endif; ?>
</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">
<label class="optional" for="transition_fade"><?php echo $this->element->getElement('transition_fade')->getLabel() ?> :
</label>