From 38d28d33468f662723dc0e649ac808e079aa86eb Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Tue, 6 Nov 2012 16:48:34 -0500 Subject: [PATCH] SAAS-289: Remove all isSaaS checks --- .../controllers/PreferenceController.php | 49 ------- .../controllers/ScheduleController.php | 48 ------- .../forms/EmailServerPreferences.php | 6 +- .../application/forms/GeneralPreferences.php | 6 +- .../forms/LiveStreamingPreferences.php | 85 +----------- airtime_mvc/application/forms/Preferences.php | 12 +- .../application/forms/SupportSettings.php | 6 +- airtime_mvc/application/models/Preference.php | 10 +- airtime_mvc/application/models/Schedule.php | 127 ++---------------- .../application/views/helpers/IsSaas.php | 12 -- .../views/scripts/form/preferences.phtml | 7 - .../form/preferences_email_server.phtml | 103 -------------- .../scripts/form/preferences_livestream.phtml | 70 ---------- .../views/scripts/form/support-setting.phtml | 71 +--------- .../application/views/scripts/menu.phtml | 8 +- .../scripts/schedule/add-show-form.phtml | 8 -- 16 files changed, 17 insertions(+), 611 deletions(-) delete mode 100644 airtime_mvc/application/views/helpers/IsSaas.php diff --git a/airtime_mvc/application/controllers/PreferenceController.php b/airtime_mvc/application/controllers/PreferenceController.php index c1ffda4ad..0f4188443 100644 --- a/airtime_mvc/application/controllers/PreferenceController.php +++ b/airtime_mvc/application/controllers/PreferenceController.php @@ -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(); diff --git a/airtime_mvc/application/controllers/ScheduleController.php b/airtime_mvc/application/controllers/ScheduleController.php index d893b590f..73fc2d3fa 100644 --- a/airtime_mvc/application/controllers/ScheduleController.php +++ b/airtime_mvc/application/controllers/ScheduleController.php @@ -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(); diff --git a/airtime_mvc/application/forms/EmailServerPreferences.php b/airtime_mvc/application/forms/EmailServerPreferences.php index 601cfb319..43f953ce2 100644 --- a/airtime_mvc/application/forms/EmailServerPreferences.php +++ b/airtime_mvc/application/forms/EmailServerPreferences.php @@ -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 diff --git a/airtime_mvc/application/forms/GeneralPreferences.php b/airtime_mvc/application/forms/GeneralPreferences.php index 76144df05..3c76d1e71 100644 --- a/airtime_mvc/application/forms/GeneralPreferences.php +++ b/airtime_mvc/application/forms/GeneralPreferences.php @@ -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(); diff --git a/airtime_mvc/application/forms/LiveStreamingPreferences.php b/airtime_mvc/application/forms/LiveStreamingPreferences.php index e66976c8b..231bead32 100644 --- a/airtime_mvc/application/forms/LiveStreamingPreferences.php +++ b/airtime_mvc/application/forms/LiveStreamingPreferences.php @@ -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; } diff --git a/airtime_mvc/application/forms/Preferences.php b/airtime_mvc/application/forms/Preferences.php index 878abe7f9..3e1490966 100644 --- a/airtime_mvc/application/forms/Preferences.php +++ b/airtime_mvc/application/forms/Preferences.php @@ -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'); diff --git a/airtime_mvc/application/forms/SupportSettings.php b/airtime_mvc/application/forms/SupportSettings.php index cbd942970..0a9453c52 100644 --- a/airtime_mvc/application/forms/SupportSettings.php +++ b/airtime_mvc/application/forms/SupportSettings.php @@ -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))) ); diff --git a/airtime_mvc/application/models/Preference.php b/airtime_mvc/application/models/Preference.php index 115ea4aa0..6ea8ce13c 100644 --- a/airtime_mvc/application/models/Preference.php +++ b/airtime_mvc/application/models/Preference.php @@ -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"; } diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 3a03a4369..aceeb3849 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -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; diff --git a/airtime_mvc/application/views/helpers/IsSaas.php b/airtime_mvc/application/views/helpers/IsSaas.php deleted file mode 100644 index 0e8bc0cee..000000000 --- a/airtime_mvc/application/views/helpers/IsSaas.php +++ /dev/null @@ -1,12 +0,0 @@ -element->getSubform('preferences_general') ?> - isSaas) { ?> -

Email / Mail Server Settings

- - -

SoundCloud Settings