SAAS-289: Remove all isSaaS checks
This commit is contained in:
parent
3f7d8a0c7f
commit
38d28d3346
|
@ -22,8 +22,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
|
||||
$request = $this->getRequest();
|
||||
$baseUrl = $request->getBaseUrl();
|
||||
|
||||
|
@ -42,17 +40,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
|
||||
Application_Model_Preference::SetWeekStartDay($values["preferences_general"]["weekStartDay"]);
|
||||
|
||||
if (!$isSaas) {
|
||||
Application_Model_Preference::SetEnableSystemEmail($values["preferences_email_server"]["enableSystemEmail"]);
|
||||
Application_Model_Preference::SetSystemEmail($values["preferences_email_server"]["systemEmail"]);
|
||||
Application_Model_Preference::SetMailServerConfigured($values["preferences_email_server"]["configureMailServer"]);
|
||||
Application_Model_Preference::SetMailServer($values["preferences_email_server"]["mailServer"]);
|
||||
Application_Model_Preference::SetMailServerEmailAddress($values["preferences_email_server"]["email"]);
|
||||
Application_Model_Preference::SetMailServerPassword($values["preferences_email_server"]["ms_password"]);
|
||||
Application_Model_Preference::SetMailServerPort($values["preferences_email_server"]["port"]);
|
||||
Application_Model_Preference::SetMailServerRequiresAuth($values["preferences_email_server"]["msRequiresAuth"]);
|
||||
}
|
||||
|
||||
Application_Model_Preference::SetUploadToSoundcloudOption($values["preferences_soundcloud"]["UploadToSoundcloudOption"]);
|
||||
Application_Model_Preference::SetSoundCloudDownloadbleOption($values["preferences_soundcloud"]["SoundCloudDownloadbleOption"]);
|
||||
Application_Model_Preference::SetSoundCloudUser($values["preferences_soundcloud"]["SoundCloudUser"]);
|
||||
|
@ -154,8 +141,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
|
||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
|
||||
// get current settings
|
||||
$temp = Application_Model_StreamSetting::getStreamSetting();
|
||||
$setting = array();
|
||||
|
@ -207,10 +192,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
$error = false;
|
||||
|
||||
if ($form->isValid($values)) {
|
||||
if (!$isSaas) {
|
||||
$values['output_sound_device'] = $form->getValue('output_sound_device');
|
||||
$values['output_sound_device_type'] = $form->getValue('output_sound_device_type');
|
||||
}
|
||||
|
||||
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
|
||||
$values['streamFormat'] = $form->getValue('streamFormat');
|
||||
|
@ -225,36 +206,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
|
||||
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
|
||||
|
||||
if (!$isSaas) {
|
||||
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
|
||||
$master_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["master_harbor_input_port"]."/".$values["master_harbor_input_mount_point"];
|
||||
if (empty($values["master_harbor_input_port"]) || empty($values["master_harbor_input_mount_point"])) {
|
||||
Application_Model_Preference::SetMasterDJSourceConnectionURL('N/A');
|
||||
} else {
|
||||
Application_Model_Preference::SetMasterDJSourceConnectionURL($master_connection_url);
|
||||
}
|
||||
} else {
|
||||
Application_Model_Preference::SetMasterDJSourceConnectionURL($values["master_dj_connection_url"]);
|
||||
}
|
||||
|
||||
if (!Application_Model_Preference::GetLiveDjConnectionUrlOverride()) {
|
||||
$live_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["dj_harbor_input_port"]."/".$values["dj_harbor_input_mount_point"];
|
||||
if (empty($values["dj_harbor_input_port"]) || empty($values["dj_harbor_input_mount_point"])) {
|
||||
Application_Model_Preference::SetLiveDJSourceConnectionURL('N/A');
|
||||
} else {
|
||||
Application_Model_Preference::SetLiveDJSourceConnectionURL($live_connection_url);
|
||||
}
|
||||
} else {
|
||||
Application_Model_Preference::SetLiveDJSourceConnectionURL($values["live_dj_connection_url"]);
|
||||
}
|
||||
|
||||
// extra info that goes into cc_stream_setting
|
||||
Application_Model_StreamSetting::setMasterLiveStreamPort($values["master_harbor_input_port"]);
|
||||
Application_Model_StreamSetting::setMasterLiveStreamMountPoint($values["master_harbor_input_mount_point"]);
|
||||
Application_Model_StreamSetting::setDjLiveStreamPort($values["dj_harbor_input_port"]);
|
||||
Application_Model_StreamSetting::setDjLiveStreamMountPoint($values["dj_harbor_input_mount_point"]);
|
||||
}
|
||||
|
||||
// store stream update timestamp
|
||||
Application_Model_Preference::SetStreamUpdateTimestamp();
|
||||
|
||||
|
|
|
@ -526,8 +526,6 @@ class ScheduleController extends Zend_Controller_Action
|
|||
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
|
||||
$user = new Application_Model_User($userInfo->id);
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
|
||||
$showInstanceId = $this->_getParam('id');
|
||||
|
||||
$this->view->action = "edit-show";
|
||||
|
@ -632,52 +630,6 @@ class ScheduleController extends Zend_Controller_Action
|
|||
|
||||
$formLive->populate($show->getLiveStreamInfo());
|
||||
|
||||
if (!$isSaas) {
|
||||
$formRecord = new Application_Form_AddShowRR();
|
||||
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
|
||||
$formRebroadcast = new Application_Form_AddShowRebroadcastDates();
|
||||
|
||||
$formRecord->removeDecorator('DtDdWrapper');
|
||||
$formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
|
||||
$formRebroadcast->removeDecorator('DtDdWrapper');
|
||||
|
||||
$this->view->rr = $formRecord;
|
||||
$this->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
|
||||
$this->view->rebroadcast = $formRebroadcast;
|
||||
|
||||
$formRecord->populate(array('add_show_record' => $show->isRecorded(),
|
||||
'add_show_rebroadcast' => $show->isRebroadcast()));
|
||||
|
||||
$formRecord->getElement('add_show_record')->setOptions(array('disabled' => true));
|
||||
|
||||
|
||||
|
||||
$rebroadcastsRelative = $show->getRebroadcastsRelative();
|
||||
$rebroadcastFormValues = array();
|
||||
$i = 1;
|
||||
foreach ($rebroadcastsRelative as $rebroadcast) {
|
||||
$rebroadcastFormValues["add_show_rebroadcast_date_$i"] = $rebroadcast['day_offset'];
|
||||
$rebroadcastFormValues["add_show_rebroadcast_time_$i"] = Application_Common_DateHelper::removeSecondsFromTime($rebroadcast['start_time']);
|
||||
$i++;
|
||||
}
|
||||
$formRebroadcast->populate($rebroadcastFormValues);
|
||||
|
||||
$rebroadcastsAbsolute = $show->getRebroadcastsAbsolute();
|
||||
$rebroadcastAbsoluteFormValues = array();
|
||||
$i = 1;
|
||||
foreach ($rebroadcastsAbsolute as $rebroadcast) {
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_date_absolute_$i"] = $rebroadcast['start_date'];
|
||||
$rebroadcastAbsoluteFormValues["add_show_rebroadcast_time_absolute_$i"] = $rebroadcast['start_time'];
|
||||
$i++;
|
||||
}
|
||||
$formAbsoluteRebroadcast->populate($rebroadcastAbsoluteFormValues);
|
||||
if (!$isAdminOrPM) {
|
||||
$formRecord->disable();
|
||||
$formAbsoluteRebroadcast->disable();
|
||||
$formRebroadcast->disable();
|
||||
}
|
||||
}
|
||||
|
||||
if (!$isAdminOrPM) {
|
||||
$formWhat->disable();
|
||||
$formWho->disable();
|
||||
|
|
|
@ -4,15 +4,11 @@ require_once 'customvalidators/PasswordNotEmpty.php';
|
|||
|
||||
class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
|
||||
{
|
||||
private $isSaas;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$this->isSaas = $isSaas;
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_email_server.phtml', "isSaas" => $isSaas))
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_email_server.phtml'))
|
||||
));
|
||||
|
||||
// Enable system emails
|
||||
|
|
|
@ -2,15 +2,11 @@
|
|||
|
||||
class Application_Form_GeneralPreferences extends Zend_Form_SubForm
|
||||
{
|
||||
private $isSaas;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$this->isSaas = $isSaas;
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml', "isSaas" => $isSaas))
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_general.phtml'))
|
||||
));
|
||||
|
||||
$defaultFade = Application_Model_Preference::GetDefaultFade();
|
||||
|
|
|
@ -9,7 +9,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true";
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$defaultFade = Application_Model_Preference::GetDefaultTransitionFade();
|
||||
if ($defaultFade == "") {
|
||||
$defaultFade = '00.000000';
|
||||
|
@ -81,45 +80,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($live_dj_connection_url);
|
||||
|
||||
//liquidsoap harbor.input port
|
||||
if (!$isSaas) {
|
||||
$m_port = Application_Model_StreamSetting::getMasterLiveStreamPort();
|
||||
$master_dj_port = new Zend_Form_Element_Text('master_harbor_input_port');
|
||||
$master_dj_port->setLabel("Master Source Port")
|
||||
->setValue($m_port)
|
||||
->setValidators(array(new Zend_Validate_Between(array('min'=>1024, 'max'=>49151))))
|
||||
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>'Only numbers are allowed.')))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_dj_port);
|
||||
|
||||
$m_mount = Application_Model_StreamSetting::getMasterLiveStreamMountPoint();
|
||||
$master_dj_mount = new Zend_Form_Element_Text('master_harbor_input_mount_point');
|
||||
$master_dj_mount->setLabel("Master Source Mount Point")
|
||||
->setValue($m_mount)
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered'))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($master_dj_mount);
|
||||
|
||||
//liquidsoap harbor.input port
|
||||
$l_port = Application_Model_StreamSetting::getDjLiveStreamPort();
|
||||
$live_dj_port = new Zend_Form_Element_Text('dj_harbor_input_port');
|
||||
$live_dj_port->setLabel("Show Source Port")
|
||||
->setValue($l_port)
|
||||
->setValidators(array(new Zend_Validate_Between(array('min'=>1024, 'max'=>49151))))
|
||||
->addValidator('regex', false, array('pattern'=>'/^[0-9]+$/', 'messages'=>array('regexNotMatch'=>'Only numbers are allowed.')))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($live_dj_port);
|
||||
|
||||
$l_mount = Application_Model_StreamSetting::getDjLiveStreamMountPoint();
|
||||
$live_dj_mount = new Zend_Form_Element_Text('dj_harbor_input_mount_point');
|
||||
$live_dj_mount->setLabel("Show Source Mount Point")
|
||||
->setValue($l_mount)
|
||||
->setValidators(array(
|
||||
array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered'))))
|
||||
->setDecorators(array('ViewHelper'));
|
||||
$this->addElement($live_dj_mount);
|
||||
}
|
||||
// demo only code
|
||||
if (!$isStreamConfigable) {
|
||||
$elements = $this->getElements();
|
||||
|
@ -135,61 +95,18 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
|
|||
{
|
||||
global $CC_CONFIG;
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
|
||||
$master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL();
|
||||
$live_dj_connection_url = Application_Model_Preference::GetLiveDJSourceConnectionURL();
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url, 'isSaas' => $isSaas, 'isDemo' => $isDemo))
|
||||
array('ViewScript', array('viewScript' => 'form/preferences_livestream.phtml', 'master_dj_connection_url'=>$master_dj_connection_url, 'live_dj_connection_url'=>$live_dj_connection_url, 'isDemo' => $isDemo))
|
||||
));
|
||||
}
|
||||
|
||||
public function isValid($data)
|
||||
{
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$isValid = parent::isValid($data);
|
||||
if (!$isSaas) {
|
||||
$master_harbor_input_port = $data['master_harbor_input_port'];
|
||||
$dj_harbor_input_port = $data['dj_harbor_input_port'];
|
||||
|
||||
if ($master_harbor_input_port == $dj_harbor_input_port && $master_harbor_input_port != "") {
|
||||
$element = $this->getElement("dj_harbor_input_port");
|
||||
$element->addError("You cannot use same port as Master DJ port.");
|
||||
}
|
||||
if ($master_harbor_input_port != "") {
|
||||
if (is_numeric($master_harbor_input_port)) {
|
||||
if ($master_harbor_input_port != Application_Model_StreamSetting::getMasterLiveStreamPort()) {
|
||||
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
$res = socket_bind($sock, 0, $master_harbor_input_port);
|
||||
if (!$res) {
|
||||
$element = $this->getElement("master_harbor_input_port");
|
||||
$element->addError("Port '$master_harbor_input_port' is not available.");
|
||||
$isValid = false;
|
||||
}
|
||||
socket_close($sock);
|
||||
}
|
||||
} else {
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
if ($dj_harbor_input_port != "") {
|
||||
if (is_numeric($dj_harbor_input_port)) {
|
||||
if ($dj_harbor_input_port != Application_Model_StreamSetting::getDjLiveStreamPort()) {
|
||||
$sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
$res = socket_bind($sock, 0, $dj_harbor_input_port);
|
||||
if (!$res) {
|
||||
$element = $this->getElement("dj_harbor_input_port");
|
||||
$element->addError("Port '$dj_harbor_input_port' is not available.");
|
||||
$isValid = false;
|
||||
}
|
||||
socket_close($sock);
|
||||
}
|
||||
} else {
|
||||
$isValid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $isValid;
|
||||
}
|
||||
|
|
|
@ -2,28 +2,18 @@
|
|||
|
||||
class Application_Form_Preferences extends Zend_Form
|
||||
{
|
||||
private $isSaas;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->setAction('/Preference');
|
||||
$this->setMethod('post');
|
||||
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$this->isSaas = $isSaas;
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/preferences.phtml', "isSaas" => $this->isSaas))
|
||||
array('ViewScript', array('viewScript' => 'form/preferences.phtml'))
|
||||
));
|
||||
|
||||
$general_pref = new Application_Form_GeneralPreferences();
|
||||
$this->addSubForm($general_pref, 'preferences_general');
|
||||
|
||||
if (!$isSaas) {
|
||||
$email_pref = new Application_Form_EmailServerPreferences();
|
||||
$this->addSubForm($email_pref, 'preferences_email_server');
|
||||
}
|
||||
|
||||
$soundcloud_pref = new Application_Form_SoundcloudPreferences();
|
||||
$this->addSubForm($soundcloud_pref, 'preferences_soundcloud');
|
||||
|
||||
|
|
|
@ -4,16 +4,12 @@ require_once 'customfilters/ImageSize.php';
|
|||
|
||||
class Application_Form_SupportSettings extends Zend_Form
|
||||
{
|
||||
private $isSass;
|
||||
|
||||
public function init()
|
||||
{
|
||||
$country_list = Application_Model_Preference::GetCountryList();
|
||||
$isSass = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
$this->isSass = $isSass;
|
||||
|
||||
$this->setDecorators(array(
|
||||
array('ViewScript', array('viewScript' => 'form/support-setting.phtml', "isSaas" => $isSass)),
|
||||
array('ViewScript', array('viewScript' => 'form/support-setting.phtml')),
|
||||
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
|
||||
);
|
||||
|
||||
|
|
|
@ -525,11 +525,7 @@ class Application_Model_Preference
|
|||
$outputArray['NUM_OF_PAST_SHOWS'] = Application_Model_ShowInstance::GetShowInstanceCount(gmdate("Y-m-d H:i:s"));
|
||||
$outputArray['UNIQUE_ID'] = self::GetUniqueId();
|
||||
$outputArray['SAAS'] = self::GetPlanLevel();
|
||||
if ($outputArray['SAAS'] != 'disabled') {
|
||||
$outputArray['TRIAL_END_DATE'] = self::GetTrialEndingDate();
|
||||
} else {
|
||||
$outputArray['TRIAL_END_DATE'] = NULL;
|
||||
}
|
||||
$outputArray['TRIAL_END_DATE'] = self::GetTrialEndingDate();
|
||||
$outputArray['INSTALL_METHOD'] = self::GetInstallMethod();
|
||||
$outputArray['NUM_OF_STREAMS'] = self::GetNumOfStreams();
|
||||
$outputArray['STREAM_INFO'] = Application_Model_StreamSetting::getStreamInfoForDataCollection();
|
||||
|
@ -555,9 +551,7 @@ class Application_Model_Preference
|
|||
$outputString .= $key." : FALSE\n";
|
||||
}
|
||||
} elseif ($key == "SAAS") {
|
||||
if (strcmp($out, 'disabled')!=0) {
|
||||
$outputString .= $key.' : '.$out."\n";
|
||||
}
|
||||
$outputString .= $key.' : '.$out."\n";
|
||||
} else {
|
||||
$outputString .= $key.' : '.$out."\n";
|
||||
}
|
||||
|
|
|
@ -883,8 +883,6 @@ SQL;
|
|||
|
||||
public static function createNewFormSections($p_view)
|
||||
{
|
||||
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
|
||||
|
||||
$formWhat = new Application_Form_AddShowWhat();
|
||||
$formWho = new Application_Form_AddShowWho();
|
||||
$formWhen = new Application_Form_AddShowWhen();
|
||||
|
@ -916,19 +914,6 @@ SQL;
|
|||
|
||||
$formRepeats->populate(array('add_show_end_date' => date("Y-m-d")));
|
||||
|
||||
if (!$isSaas) {
|
||||
$formRecord = new Application_Form_AddShowRR();
|
||||
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
|
||||
$formRebroadcast = new Application_Form_AddShowRebroadcastDates();
|
||||
|
||||
$formRecord->removeDecorator('DtDdWrapper');
|
||||
$formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
|
||||
$formRebroadcast->removeDecorator('DtDdWrapper');
|
||||
|
||||
$p_view->rr = $formRecord;
|
||||
$p_view->absoluteRebroadcast = $formAbsoluteRebroadcast;
|
||||
$p_view->rebroadcast = $formRebroadcast;
|
||||
}
|
||||
$p_view->addNewShow = true;
|
||||
}
|
||||
|
||||
|
@ -939,8 +924,6 @@ SQL;
|
|||
* 2.1 deadline looming, this is OK for now. -Martin */
|
||||
public static function updateShowInstance($data, $controller)
|
||||
{
|
||||
$isSaas = (Application_Model_Preference::GetPlanLevel() != 'disabled');
|
||||
|
||||
$formWhat = new Application_Form_AddShowWhat();
|
||||
$formWhen = new Application_Form_AddShowWhen();
|
||||
$formRepeats = new Application_Form_AddShowRepeats();
|
||||
|
@ -955,15 +938,6 @@ SQL;
|
|||
$formStyle->removeDecorator('DtDdWrapper');
|
||||
$formLive->removeDecorator('DtDdWrapper');
|
||||
|
||||
if (!$isSaas) {
|
||||
$formRecord = new Application_Form_AddShowRR();
|
||||
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
|
||||
$formRebroadcast = new Application_Form_AddShowRebroadcastDates();
|
||||
|
||||
$formRecord->removeDecorator('DtDdWrapper');
|
||||
$formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
|
||||
$formRebroadcast->removeDecorator('DtDdWrapper');
|
||||
}
|
||||
$when = $formWhen->isValid($data);
|
||||
|
||||
if ($when && $formWhen->checkReliantFields($data, true, null, true)) {
|
||||
|
@ -997,15 +971,6 @@ SQL;
|
|||
$controller->view->who = $formWho;
|
||||
$controller->view->style = $formStyle;
|
||||
$controller->view->live = $formLive;
|
||||
if (!$isSaas) {
|
||||
$controller->view->rr = $formRecord;
|
||||
$controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
|
||||
$controller->view->rebroadcast = $formRebroadcast;
|
||||
|
||||
//$formRecord->disable();
|
||||
//$formAbsoluteRebroadcast->disable();
|
||||
//$formRebroadcast->disable();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1026,7 +991,6 @@ SQL;
|
|||
$user = new Application_Model_User($userInfo->id);
|
||||
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
|
||||
|
||||
$isSaas = (Application_Model_Preference::GetPlanLevel() != 'disabled');
|
||||
$record = false;
|
||||
|
||||
$formWhat = new Application_Form_AddShowWhat();
|
||||
|
@ -1072,97 +1036,27 @@ SQL;
|
|||
|
||||
$data["add_show_duration"] = $hValue.":".$mValue;
|
||||
|
||||
if (!$isSaas) {
|
||||
$formRecord = new Application_Form_AddShowRR();
|
||||
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
|
||||
$formRebroadcast = new Application_Form_AddShowRebroadcastDates();
|
||||
|
||||
$formRecord->removeDecorator('DtDdWrapper');
|
||||
$formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
|
||||
$formRebroadcast->removeDecorator('DtDdWrapper');
|
||||
|
||||
|
||||
$record = $formRecord->isValid($data);
|
||||
}
|
||||
|
||||
if ($data["add_show_repeats"]) {
|
||||
$repeats = $formRepeats->isValid($data);
|
||||
if ($repeats) {
|
||||
$repeats = $formRepeats->checkReliantFields($data);
|
||||
}
|
||||
if (!$isSaas) {
|
||||
$formAbsoluteRebroadcast->reset();
|
||||
//make it valid, results don't matter anyways.
|
||||
$rebroadAb = 1;
|
||||
|
||||
if ($data["add_show_rebroadcast"]) {
|
||||
$rebroad = $formRebroadcast->isValid($data);
|
||||
if ($rebroad) {
|
||||
$rebroad = $formRebroadcast->checkReliantFields($data);
|
||||
}
|
||||
} else {
|
||||
$rebroad = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$repeats = 1;
|
||||
if (!$isSaas) {
|
||||
$formRebroadcast->reset();
|
||||
//make it valid, results don't matter anyways.
|
||||
$rebroad = 1;
|
||||
|
||||
if ($data["add_show_rebroadcast"]) {
|
||||
$rebroadAb = $formAbsoluteRebroadcast->isValid($data);
|
||||
if ($rebroadAb) {
|
||||
$rebroadAb = $formAbsoluteRebroadcast->checkReliantFields($data);
|
||||
}
|
||||
} else {
|
||||
$rebroadAb = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$who = $formWho->isValid($data);
|
||||
$style = $formStyle->isValid($data);
|
||||
if ($what && $when && $repeats && $who && $style && $live) {
|
||||
if (!$isSaas) {
|
||||
if ($record && $rebroadAb && $rebroad) {
|
||||
if ($isAdminOrPM) {
|
||||
Application_Model_Show::create($data);
|
||||
}
|
||||
|
||||
//send back a new form for the user.
|
||||
Application_Model_Schedule::createNewFormSections($controller->view);
|
||||
|
||||
//$controller->view->newForm = $controller->view->render('schedule/add-show-form.phtml');
|
||||
return true;
|
||||
} else {
|
||||
$controller->view->what = $formWhat;
|
||||
$controller->view->when = $formWhen;
|
||||
$controller->view->repeats = $formRepeats;
|
||||
$controller->view->who = $formWho;
|
||||
$controller->view->style = $formStyle;
|
||||
$controller->view->rr = $formRecord;
|
||||
$controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
|
||||
$controller->view->rebroadcast = $formRebroadcast;
|
||||
$controller->view->live = $formLive;
|
||||
//$controller->view->addNewShow = !$editShow;
|
||||
|
||||
//$controller->view->form = $controller->view->render('schedule/add-show-form.phtml');
|
||||
return false;
|
||||
|
||||
}
|
||||
} else {
|
||||
if ($isAdminOrPM) {
|
||||
Application_Model_Show::create($data);
|
||||
}
|
||||
|
||||
//send back a new form for the user.
|
||||
Application_Model_Schedule::createNewFormSections($controller->view);
|
||||
|
||||
//$controller->view->newForm = $controller->view->render('schedule/add-show-form.phtml');
|
||||
return true;
|
||||
if ($isAdminOrPM) {
|
||||
Application_Model_Show::create($data);
|
||||
}
|
||||
|
||||
//send back a new form for the user.
|
||||
Application_Model_Schedule::createNewFormSections($controller->view);
|
||||
|
||||
//$controller->view->newForm = $controller->view->render('schedule/add-show-form.phtml');
|
||||
return true;
|
||||
} else {
|
||||
$controller->view->what = $formWhat;
|
||||
$controller->view->when = $formWhen;
|
||||
|
@ -1171,11 +1065,6 @@ SQL;
|
|||
$controller->view->style = $formStyle;
|
||||
$controller->view->live = $formLive;
|
||||
|
||||
if (!$isSaas) {
|
||||
$controller->view->rr = $formRecord;
|
||||
$controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
|
||||
$controller->view->rebroadcast = $formRebroadcast;
|
||||
}
|
||||
//$controller->view->addNewShow = !$editShow;
|
||||
//$controller->view->form = $controller->view->render('schedule/add-show-form.phtml');
|
||||
return false;
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<?php
|
||||
|
||||
class Airtime_View_Helper_IsSaas extends Zend_View_Helper_Abstract{
|
||||
public function isSaas(){
|
||||
$plan = Application_Model_Preference::GetPlanLevel();
|
||||
if($plan == 'disabled'){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,13 +2,6 @@
|
|||
|
||||
<?php echo $this->element->getSubform('preferences_general') ?>
|
||||
|
||||
<?php if (!$this->isSaas) { ?>
|
||||
<h3 class="collapsible-header" id="email-server-heading"><span class="arrow-icon"></span>Email / Mail Server Settings</h3>
|
||||
<div class="collapsible-content" id="email-server-settings" style="display: none;">
|
||||
<?php echo $this->element->getSubform('preferences_email_server') ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<h3 class="collapsible-header" id="soundcloud-heading"><span class="arrow-icon"></span>SoundCloud Settings</h3>
|
||||
|
||||
<div class="collapsible-content" id="soundcloud-settings" style="display: none;">
|
||||
|
|
|
@ -1,108 +1,5 @@
|
|||
<fieldset class="padded">
|
||||
<dl class="zend_form">
|
||||
<!-- Enable System Email option -->
|
||||
<?php if( !$this->isSaas ){?>
|
||||
|
||||
<dd id="enableSystemEmail-element" class="block-display">
|
||||
<label class="required" for="timezone">
|
||||
<?php echo $this->element->getElement('enableSystemEmail') ?>
|
||||
<strong><?php echo $this->element->getElement('enableSystemEmail')->getLabel() ?></strong>
|
||||
</label>
|
||||
<?php if($this->element->getElement('enableSystemEmail')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('enableSystemEmail')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
|
||||
<!-- System Email option -->
|
||||
<dt id="systemEmail-label" class="block-display">
|
||||
<label class="required" for="timezone"><?php echo $this->element->getElement('systemEmail')->getLabel() ?>:
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="systemEmail-element" class="block-display">
|
||||
<?php echo $this->element->getElement('systemEmail') ?>
|
||||
<?php if($this->element->getElement('systemEmail')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('systemEmail')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<br />
|
||||
<dd id="configureMailServer-element" class="block-display">
|
||||
<label class="required" for="configureMailServer">
|
||||
<?php echo $this->element->getElement('configureMailServer') ?>
|
||||
<strong><?php echo $this->element->getElement('configureMailServer')->getLabel() ?></strong>
|
||||
</label>
|
||||
</dd>
|
||||
|
||||
<dt id="mailServer-label" class="block-display">
|
||||
<label class="required" for="mailServer"><?php echo $this->element->getElement('mailServer')->getLabel() ?>
|
||||
<span class="info-text-small">(Required)</span>:
|
||||
</label>
|
||||
|
||||
<label class="required" for="msRequiresAuth">
|
||||
<?php echo $this->element->getElement('msRequiresAuth') ?>
|
||||
<?php echo $this->element->getElement('msRequiresAuth')->getLabel() ?>
|
||||
</label>
|
||||
</dt>
|
||||
|
||||
<dd id="mailServer-element" class="block-display">
|
||||
<?php echo $this->element->getElement('mailServer') ?>
|
||||
<?php if($this->element->getElement('mailServer')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('mailServer')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
|
||||
<dt id="port-label" class="block-display">
|
||||
<label class="required" for="port"><?php echo $this->element->getElement('port')->getLabel() ?>:
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="port-element" class="block-display">
|
||||
<?php echo $this->element->getElement('port') ?>
|
||||
</dd>
|
||||
|
||||
<dt id="email-label" class="block-display">
|
||||
<label class="required" for="email"><?php echo $this->element->getElement('email')->getLabel() ?>
|
||||
<span class="info-text-small">(Required)</span>:
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="email-element" class="block-display">
|
||||
<?php echo $this->element->getElement('email') ?>
|
||||
<?php if($this->element->getElement('email')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('email')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
|
||||
<dt id="password-label" class="block-display">
|
||||
<label class="required" for="password"><?php echo $this->element->getElement('ms_password')->getLabel() ?>
|
||||
<span class="info-text-small">(Required)</span>:
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="password-element" class="block-display">
|
||||
<?php echo $this->element->getElement('ms_password') ?>
|
||||
<?php if($this->element->getElement('ms_password')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('ms_password')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
</dl>
|
||||
</fieldset>
|
||||
|
|
|
@ -76,92 +76,22 @@
|
|||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php if( !$this->isSaas ){?>
|
||||
<dt id="master_harbor_input_port-label">
|
||||
<label class="optional" for="master_harbor_input_port"><?php echo $this->element->getElement('master_harbor_input_port')->getLabel() ?> :
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="master_harbor_input_port-element">
|
||||
<?php echo $this->element->getElement('master_harbor_input_port') ?>
|
||||
<?php if($this->element->getElement('master_harbor_input_port')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('master_harbor_input_port')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="master_harbor_input_mount_point-label">
|
||||
<label class="optional" for="master_harbor_input_mount_point"><?php echo $this->element->getElement('master_harbor_input_mount_point')->getLabel() ?> :
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="master_harbor_input_mount_point-element">
|
||||
<?php echo $this->element->getElement('master_harbor_input_mount_point') ?>
|
||||
<?php if($this->element->getElement('master_harbor_input_mount_point')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('master_harbor_input_mount_point')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php } ?>
|
||||
<dt id="master_dj_connection_url-label">
|
||||
<label class="optional" for="master_dj_connection_url" style="white-space: nowrap">Master Source Connection URL:
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="master_dj_connection_url-element">
|
||||
<span id="stream_url"><?php echo $this->element->getElement('master_dj_connection_url')->setValue($this->master_dj_connection_url) ?></span>
|
||||
<?php if( !$this->isSaas && !$this->isDemo){?>
|
||||
<a href=# id="connection_url_override" style="font-size: 12px;">Override</a>
|
||||
<span class="override_help_icon">
|
||||
</span><br>
|
||||
<?php } ?>
|
||||
<div id="master_dj_connection_url_actions" style="display:none">
|
||||
<a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a>
|
||||
</div>
|
||||
</dd>
|
||||
<?php if( !$this->isSaas ){?>
|
||||
<dt id="dj_harbor_input_port-label">
|
||||
<label class="optional" for="dj_harbor_input_port"><?php echo $this->element->getElement('dj_harbor_input_port')->getLabel() ?> :
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="dj_harbor_input_port-element">
|
||||
<?php echo $this->element->getElement('dj_harbor_input_port') ?>
|
||||
<?php if($this->element->getElement('dj_harbor_input_port')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('dj_harbor_input_port')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dt id="dj_harbor_input_mount_point-label">
|
||||
<label class="optional" for="dj_harbor_input_mount_point"><?php echo $this->element->getElement('dj_harbor_input_mount_point')->getLabel() ?> :
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="dj_harbor_input_mount_point-element">
|
||||
<?php echo $this->element->getElement('dj_harbor_input_mount_point') ?>
|
||||
<?php if($this->element->getElement('dj_harbor_input_mount_point')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('dj_harbor_input_mount_point')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<?php } ?>
|
||||
<dt id="live_dj_connection_url-label">
|
||||
<label class="optional" for="live_dj_connection_url" style="white-space: nowrap">Show Source Connection URL:
|
||||
</label>
|
||||
</dt>
|
||||
<dd id="live_dj_connection_url-element">
|
||||
<span id="stream_url"><?php echo $this->element->getElement('live_dj_connection_url')->setValue($this->live_dj_connection_url) ?></span>
|
||||
<?php if( !$this->isSaas && !$this->isDemo ){?>
|
||||
<a href=# id="connection_url_override" style="font-size: 12px;">Override</a>
|
||||
<span class="override_help_icon">
|
||||
</span><br>
|
||||
<?php } ?>
|
||||
<div id="live_dj_connection_url_actions" style="display:none">
|
||||
<a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a>
|
||||
</div>
|
||||
|
|
|
@ -1,45 +1,5 @@
|
|||
<fieldset class="padded">
|
||||
<?php if( !$this->isSaas ){?>
|
||||
<dl class="zend_form">
|
||||
<dd id="SupportFeedback-element" style="width:90%;">
|
||||
<div class="info-text">
|
||||
Help Airtime improve by letting Sourcefabric know how you are using it. This information
|
||||
will be collected regularly in order to enhance your user experience.<br />
|
||||
Click the "Send support feedback" box and we'll make sure the features you use are
|
||||
constantly improving.
|
||||
</div>
|
||||
<label class="optional" for="SupportFeedback">
|
||||
<?php echo $this->element->getElement('SupportFeedback') ?>
|
||||
<strong><?php echo $this->element->getElement('SupportFeedback')->getLabel() ?></strong>
|
||||
</label>
|
||||
<?php if($this->element->getElement('SupportFeedback')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('SupportFeedback')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
<dd id="publicize-element" style="width:90%;">
|
||||
<div class="info-text">Click the box below to promote your station on
|
||||
<a id="link_to_whos_using" href="http://www.sourcefabric.org/en/airtime/whosusing/" onclick="window.open(this.href); return false">Sourcefabric.org</a>.
|
||||
</div>
|
||||
<label class="optional" for="Publicise">
|
||||
<?php echo $this->element->getElement('Publicise') ?>
|
||||
<strong><?php echo $this->element->getElement('Publicise')->getLabel() ?></strong>
|
||||
</label>
|
||||
<?php if($this->element->getElement('Publicise')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('Publicise')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="info-text" style="clear: both;padding: 4px 0 4px 15px;">(In order to promote your station, "Send support feedback" must be enabled).<br /><br /></div>
|
||||
<?php }?>
|
||||
<dl id="public-info" style="display:<?php echo !$this->isSaas?"none":"block"?>;">
|
||||
<dl id="public-info" style="display:<?php echo "block"?>;">
|
||||
<dt id="stationName-label" class="block-display">
|
||||
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?>
|
||||
<span class="info-text-small">(Required)</span>:
|
||||
|
@ -154,33 +114,4 @@
|
|||
<?php endif; ?>
|
||||
</dd>
|
||||
</dl>
|
||||
<?php if( !$this->isSaas ){?>
|
||||
<div id="show_what_sending" style="display: block;">
|
||||
<fieldset class="display_field toggle closed">
|
||||
<legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Show me what I am sending </legend>
|
||||
<dl>
|
||||
<?php echo $this->element->getElement('SendInfo') ?>
|
||||
</dl>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<br>
|
||||
<?php if(!$this->element->getView()->privacyChecked){?>
|
||||
<label class="optional" for="Privacy">
|
||||
<?php echo $this->element->getElement('Privacy') ?>
|
||||
<?php echo $this->element->getElement('Privacy')->getLabel() ?>
|
||||
</label>
|
||||
<?php if($this->element->getElement('Privacy')->hasErrors()) : ?>
|
||||
<ul class='errors'>
|
||||
<?php foreach($this->element->getElement('Privacy')->getMessages() as $error): ?>
|
||||
<li><?php echo $error; ?></li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?php }else{?>
|
||||
<a id="link_to_terms_and_condition" href="http://www.sourcefabric.org/en/about/policy/" onclick="window.open(this.href); return false;">Sourcefabric Privacy Policy</a>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</fieldset>
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
<?php
|
||||
$isSaas = true;
|
||||
if(Application_Model_Preference::GetPlanLevel() == "disabled"){
|
||||
$isSaas = false;
|
||||
}
|
||||
?>
|
||||
<ul id="nav">
|
||||
<?php foreach ($this->container as $page) : ?>
|
||||
<?php if($this->navigation()->accept($page)) : ?>
|
||||
|
@ -14,7 +8,7 @@
|
|||
</a>
|
||||
<ul class="sub">
|
||||
<?php foreach ($page->getPages() as $sub) :
|
||||
if($isSaas && $sub->getId() == "manage_folder"){
|
||||
if($sub->getId() == "manage_folder"){
|
||||
continue;
|
||||
} ?>
|
||||
<li>
|
||||
|
|
|
@ -20,14 +20,6 @@
|
|||
<div id="live-stream-override" class="collapsible-content">
|
||||
<?php echo $this->live; ?>
|
||||
</div>
|
||||
<?php if(!$this->isSaas()){?>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Record & Rebroadcast</h3>
|
||||
<div id="schedule-record-rebroadcast" class="collapsible-content">
|
||||
<?php echo $this->rr; ?>
|
||||
<?php echo $this->absoluteRebroadcast; ?>
|
||||
<?php echo $this->rebroadcast; ?>
|
||||
</div>
|
||||
<?php }?>
|
||||
<h3 class="collapsible-header"><span class="arrow-icon"></span>Who</h3>
|
||||
<div id="schedule-show-who" class="collapsible-content">
|
||||
<?php echo $this->who; ?>
|
||||
|
|
Loading…
Reference in New Issue