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

This commit is contained in:
James 2012-11-08 17:27:28 -05:00
commit 33b2520c14
21 changed files with 40 additions and 146 deletions

View file

@ -22,8 +22,6 @@ class PreferenceController extends Zend_Controller_Action
{ {
global $CC_CONFIG; global $CC_CONFIG;
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$request = $this->getRequest(); $request = $this->getRequest();
$baseUrl = $request->getBaseUrl(); $baseUrl = $request->getBaseUrl();
@ -42,7 +40,6 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]); Application_Model_Preference::SetTimezone($values["preferences_general"]["timezone"]);
Application_Model_Preference::SetWeekStartDay($values["preferences_general"]["weekStartDay"]); Application_Model_Preference::SetWeekStartDay($values["preferences_general"]["weekStartDay"]);
if (!$isSaas) {
Application_Model_Preference::SetEnableSystemEmail($values["preferences_email_server"]["enableSystemEmail"]); Application_Model_Preference::SetEnableSystemEmail($values["preferences_email_server"]["enableSystemEmail"]);
Application_Model_Preference::SetSystemEmail($values["preferences_email_server"]["systemEmail"]); Application_Model_Preference::SetSystemEmail($values["preferences_email_server"]["systemEmail"]);
Application_Model_Preference::SetMailServerConfigured($values["preferences_email_server"]["configureMailServer"]); Application_Model_Preference::SetMailServerConfigured($values["preferences_email_server"]["configureMailServer"]);
@ -51,7 +48,6 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetMailServerPassword($values["preferences_email_server"]["ms_password"]); Application_Model_Preference::SetMailServerPassword($values["preferences_email_server"]["ms_password"]);
Application_Model_Preference::SetMailServerPort($values["preferences_email_server"]["port"]); Application_Model_Preference::SetMailServerPort($values["preferences_email_server"]["port"]);
Application_Model_Preference::SetMailServerRequiresAuth($values["preferences_email_server"]["msRequiresAuth"]); Application_Model_Preference::SetMailServerRequiresAuth($values["preferences_email_server"]["msRequiresAuth"]);
}
Application_Model_Preference::SetAutoUploadRecordedShowToSoundcloud($values["preferences_soundcloud"]["UseSoundCloud"]); Application_Model_Preference::SetAutoUploadRecordedShowToSoundcloud($values["preferences_soundcloud"]["UseSoundCloud"]);
Application_Model_Preference::SetUploadToSoundcloudOption($values["preferences_soundcloud"]["UploadToSoundcloudOption"]); Application_Model_Preference::SetUploadToSoundcloudOption($values["preferences_soundcloud"]["UploadToSoundcloudOption"]);
@ -79,13 +75,12 @@ class PreferenceController extends Zend_Controller_Action
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js?'.$CC_CONFIG['airtime_version'],'text/javascript');
$this->view->statusMsg = ""; $this->view->statusMsg = "";
$isSass = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$form = new Application_Form_SupportSettings(); $form = new Application_Form_SupportSettings();
if ($request->isPost()) { if ($request->isPost()) {
$values = $request->getPost(); $values = $request->getPost();
if ($form->isValid($values)) { if ($form->isValid($values)) {
if (!$isSass && $values["Publicise"] != 1) { if ($values["Publicise"] != 1) {
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]); Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
Application_Model_Preference::SetPublicise($values["Publicise"]); Application_Model_Preference::SetPublicise($values["Publicise"]);
if (isset($values["Privacy"])) { if (isset($values["Privacy"])) {
@ -96,10 +91,8 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetPhone($values["Phone"]); Application_Model_Preference::SetPhone($values["Phone"]);
Application_Model_Preference::SetEmail($values["Email"]); Application_Model_Preference::SetEmail($values["Email"]);
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]); Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
if (!$isSass) {
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]); Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
Application_Model_Preference::SetPublicise($values["Publicise"]); Application_Model_Preference::SetPublicise($values["Publicise"]);
}
$form->Logo->receive(); $form->Logo->receive();
$imagePath = $form->Logo->getFileName(); $imagePath = $form->Logo->getFileName();
@ -108,7 +101,7 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetStationCity($values["City"]); Application_Model_Preference::SetStationCity($values["City"]);
Application_Model_Preference::SetStationDescription($values["Description"]); Application_Model_Preference::SetStationDescription($values["Description"]);
Application_Model_Preference::SetStationLogo($imagePath); Application_Model_Preference::SetStationLogo($imagePath);
if (!$isSass && isset($values["Privacy"])) { if (isset($values["Privacy"])) {
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]); Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
} }
} }
@ -155,7 +148,6 @@ class PreferenceController extends Zend_Controller_Action
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/streamsetting.js?'.$CC_CONFIG['airtime_version'],'text/javascript'); $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 // get current settings
$temp = Application_Model_StreamSetting::getStreamSetting(); $temp = Application_Model_StreamSetting::getStreamSetting();
@ -208,10 +200,8 @@ class PreferenceController extends Zend_Controller_Action
$error = false; $error = false;
if ($form->isValid($values)) { if ($form->isValid($values)) {
if (!$isSaas) {
$values['output_sound_device'] = $form->getValue('output_sound_device'); $values['output_sound_device'] = $form->getValue('output_sound_device');
$values['output_sound_device_type'] = $form->getValue('output_sound_device_type'); $values['output_sound_device_type'] = $form->getValue('output_sound_device_type');
}
$values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata'); $values['icecast_vorbis_metadata'] = $form->getValue('icecast_vorbis_metadata');
$values['streamFormat'] = $form->getValue('streamFormat'); $values['streamFormat'] = $form->getValue('streamFormat');
@ -226,7 +216,6 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_Preference::SetAutoTransition($values["auto_transition"]); Application_Model_Preference::SetAutoTransition($values["auto_transition"]);
Application_Model_Preference::SetAutoSwitch($values["auto_switch"]); Application_Model_Preference::SetAutoSwitch($values["auto_switch"]);
if (!$isSaas) {
if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) { if (!Application_Model_Preference::GetMasterDjConnectionUrlOverride()) {
$master_connection_url = "http://".$_SERVER['SERVER_NAME'].":".$values["master_harbor_input_port"]."/".$values["master_harbor_input_mount_point"]; $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"])) { if (empty($values["master_harbor_input_port"]) || empty($values["master_harbor_input_mount_point"])) {
@ -254,7 +243,6 @@ class PreferenceController extends Zend_Controller_Action
Application_Model_StreamSetting::setMasterLiveStreamMountPoint($values["master_harbor_input_mount_point"]); Application_Model_StreamSetting::setMasterLiveStreamMountPoint($values["master_harbor_input_mount_point"]);
Application_Model_StreamSetting::setDjLiveStreamPort($values["dj_harbor_input_port"]); Application_Model_StreamSetting::setDjLiveStreamPort($values["dj_harbor_input_port"]);
Application_Model_StreamSetting::setDjLiveStreamMountPoint($values["dj_harbor_input_mount_point"]); Application_Model_StreamSetting::setDjLiveStreamMountPoint($values["dj_harbor_input_mount_point"]);
}
// store stream update timestamp // store stream update timestamp
Application_Model_Preference::SetStreamUpdateTimestamp(); Application_Model_Preference::SetStreamUpdateTimestamp();

View file

@ -526,8 +526,6 @@ class ScheduleController extends Zend_Controller_Action
$userInfo = Zend_Auth::getInstance()->getStorage()->read(); $userInfo = Zend_Auth::getInstance()->getStorage()->read();
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$showInstanceId = $this->_getParam('id'); $showInstanceId = $this->_getParam('id');
$this->view->action = "edit-show"; $this->view->action = "edit-show";
@ -632,7 +630,6 @@ class ScheduleController extends Zend_Controller_Action
$formLive->populate($show->getLiveStreamInfo()); $formLive->populate($show->getLiveStreamInfo());
if (!$isSaas) {
$formRecord = new Application_Form_AddShowRR(); $formRecord = new Application_Form_AddShowRR();
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
$formRebroadcast = new Application_Form_AddShowRebroadcastDates(); $formRebroadcast = new Application_Form_AddShowRebroadcastDates();
@ -676,7 +673,6 @@ class ScheduleController extends Zend_Controller_Action
$formAbsoluteRebroadcast->disable(); $formAbsoluteRebroadcast->disable();
$formRebroadcast->disable(); $formRebroadcast->disable();
} }
}
if (!$isAdminOrPM) { if (!$isAdminOrPM) {
$formWhat->disable(); $formWhat->disable();

View file

@ -4,15 +4,12 @@ require_once 'customvalidators/PasswordNotEmpty.php';
class Application_Form_EmailServerPreferences extends Zend_Form_SubForm class Application_Form_EmailServerPreferences extends Zend_Form_SubForm
{ {
private $isSaas;
public function init() public function init()
{ {
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$this->isSaas = $isSaas;
$this->setDecorators(array( $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 // Enable system emails

View file

@ -2,15 +2,12 @@
class Application_Form_GeneralPreferences extends Zend_Form_SubForm class Application_Form_GeneralPreferences extends Zend_Form_SubForm
{ {
private $isSaas;
public function init() public function init()
{ {
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$this->isSaas = $isSaas;
$this->setDecorators(array( $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(); $defaultFade = Application_Model_Preference::GetDefaultFade();

View file

@ -9,7 +9,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1; $isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
$isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true"; $isStreamConfigable = Application_Model_Preference::GetEnableStreamConf() == "true";
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$defaultFade = Application_Model_Preference::GetDefaultTransitionFade(); $defaultFade = Application_Model_Preference::GetDefaultTransitionFade();
if ($defaultFade == "") { if ($defaultFade == "") {
$defaultFade = '00.000000'; $defaultFade = '00.000000';
@ -82,7 +81,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$this->addElement($live_dj_connection_url); $this->addElement($live_dj_connection_url);
//liquidsoap harbor.input port //liquidsoap harbor.input port
if (!$isSaas) {
$m_port = Application_Model_StreamSetting::getMasterLiveStreamPort(); $m_port = Application_Model_StreamSetting::getMasterLiveStreamPort();
$master_dj_port = new Zend_Form_Element_Text('master_harbor_input_port'); $master_dj_port = new Zend_Form_Element_Text('master_harbor_input_port');
$master_dj_port->setLabel("Master Source Port") $master_dj_port->setLabel("Master Source Port")
@ -119,7 +117,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered')))) array('regex', false, array('/^[^ &<>]+$/', 'messages' => 'Invalid character entered'))))
->setDecorators(array('ViewHelper')); ->setDecorators(array('ViewHelper'));
$this->addElement($live_dj_mount); $this->addElement($live_dj_mount);
}
// demo only code // demo only code
if (!$isStreamConfigable) { if (!$isStreamConfigable) {
$elements = $this->getElements(); $elements = $this->getElements();
@ -135,21 +132,18 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
{ {
global $CC_CONFIG; global $CC_CONFIG;
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1; $isDemo = isset($CC_CONFIG['demo']) && $CC_CONFIG['demo'] == 1;
$master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL(); $master_dj_connection_url = Application_Model_Preference::GetMasterDJSourceConnectionURL();
$live_dj_connection_url = Application_Model_Preference::GetLiveDJSourceConnectionURL(); $live_dj_connection_url = Application_Model_Preference::GetLiveDJSourceConnectionURL();
$this->setDecorators(array( $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) public function isValid($data)
{ {
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$isValid = parent::isValid($data); $isValid = parent::isValid($data);
if (!$isSaas) {
$master_harbor_input_port = $data['master_harbor_input_port']; $master_harbor_input_port = $data['master_harbor_input_port'];
$dj_harbor_input_port = $data['dj_harbor_input_port']; $dj_harbor_input_port = $data['dj_harbor_input_port'];
@ -189,7 +183,6 @@ class Application_Form_LiveStreamingPreferences extends Zend_Form_SubForm
$isValid = false; $isValid = false;
} }
} }
}
return $isValid; return $isValid;
} }

View file

@ -2,27 +2,22 @@
class Application_Form_Preferences extends Zend_Form class Application_Form_Preferences extends Zend_Form
{ {
private $isSaas;
public function init() public function init()
{ {
$this->setAction('/Preference'); $this->setAction('/Preference');
$this->setMethod('post'); $this->setMethod('post');
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$this->isSaas = $isSaas;
$this->setDecorators(array( $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(); $general_pref = new Application_Form_GeneralPreferences();
$this->addSubForm($general_pref, 'preferences_general'); $this->addSubForm($general_pref, 'preferences_general');
if (!$isSaas) {
$email_pref = new Application_Form_EmailServerPreferences(); $email_pref = new Application_Form_EmailServerPreferences();
$this->addSubForm($email_pref, 'preferences_email_server'); $this->addSubForm($email_pref, 'preferences_email_server');
}
$soundcloud_pref = new Application_Form_SoundcloudPreferences(); $soundcloud_pref = new Application_Form_SoundcloudPreferences();
$this->addSubForm($soundcloud_pref, 'preferences_soundcloud'); $this->addSubForm($soundcloud_pref, 'preferences_soundcloud');

View file

@ -4,16 +4,13 @@ require_once 'customfilters/ImageSize.php';
class Application_Form_SupportSettings extends Zend_Form class Application_Form_SupportSettings extends Zend_Form
{ {
private $isSass;
public function init() public function init()
{ {
$country_list = Application_Model_Preference::GetCountryList(); $country_list = Application_Model_Preference::GetCountryList();
$isSass = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$this->isSass = $isSass;
$this->setDecorators(array( $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))) array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
); );
@ -109,7 +106,6 @@ class Application_Form_SupportSettings extends Zend_Form
$upload->setAttrib('accept', 'image/*'); $upload->setAttrib('accept', 'image/*');
$this->addElement($upload); $this->addElement($upload);
if (!$isSass) {
//enable support feedback //enable support feedback
$this->addElement('checkbox', 'SupportFeedback', array( $this->addElement('checkbox', 'SupportFeedback', array(
'label' => 'Send support feedback', 'label' => 'Send support feedback',
@ -150,7 +146,6 @@ class Application_Form_SupportSettings extends Zend_Form
$checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.") $checkboxPrivacy->setLabel("By checking this box, I agree to Sourcefabric's <a id=\"link_to_privacy\" href=\"http://www.sourcefabric.org/en/about/policy/\" onclick=\"window.open(this.href); return false;\">privacy policy</a>.")
->setDecorators(array('ViewHelper')); ->setDecorators(array('ViewHelper'));
$this->addElement($checkboxPrivacy); $this->addElement($checkboxPrivacy);
}
// submit button // submit button
$submit = new Zend_Form_Element_Submit("submit"); $submit = new Zend_Form_Element_Submit("submit");
@ -165,7 +160,6 @@ class Application_Form_SupportSettings extends Zend_Form
public function isValid ($data) public function isValid ($data)
{ {
$isValid = parent::isValid($data); $isValid = parent::isValid($data);
if (!$this->isSass) {
if ($data['Publicise'] != 1) { if ($data['Publicise'] != 1) {
$isValid = true; $isValid = true;
} }
@ -176,7 +170,6 @@ class Application_Form_SupportSettings extends Zend_Form
$isValid = false; $isValid = false;
} }
} }
}
return $isValid; return $isValid;
} }

View file

@ -883,8 +883,6 @@ SQL;
public static function createNewFormSections($p_view) public static function createNewFormSections($p_view)
{ {
$isSaas = Application_Model_Preference::GetPlanLevel() == 'disabled'?false:true;
$formWhat = new Application_Form_AddShowWhat(); $formWhat = new Application_Form_AddShowWhat();
$formWho = new Application_Form_AddShowWho(); $formWho = new Application_Form_AddShowWho();
$formWhen = new Application_Form_AddShowWhen(); $formWhen = new Application_Form_AddShowWhen();
@ -916,7 +914,6 @@ SQL;
$formRepeats->populate(array('add_show_end_date' => date("Y-m-d"))); $formRepeats->populate(array('add_show_end_date' => date("Y-m-d")));
if (!$isSaas) {
$formRecord = new Application_Form_AddShowRR(); $formRecord = new Application_Form_AddShowRR();
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
$formRebroadcast = new Application_Form_AddShowRebroadcastDates(); $formRebroadcast = new Application_Form_AddShowRebroadcastDates();
@ -928,7 +925,6 @@ SQL;
$p_view->rr = $formRecord; $p_view->rr = $formRecord;
$p_view->absoluteRebroadcast = $formAbsoluteRebroadcast; $p_view->absoluteRebroadcast = $formAbsoluteRebroadcast;
$p_view->rebroadcast = $formRebroadcast; $p_view->rebroadcast = $formRebroadcast;
}
$p_view->addNewShow = true; $p_view->addNewShow = true;
} }
@ -939,8 +935,6 @@ SQL;
* 2.1 deadline looming, this is OK for now. -Martin */ * 2.1 deadline looming, this is OK for now. -Martin */
public static function updateShowInstance($data, $controller) public static function updateShowInstance($data, $controller)
{ {
$isSaas = (Application_Model_Preference::GetPlanLevel() != 'disabled');
$formWhat = new Application_Form_AddShowWhat(); $formWhat = new Application_Form_AddShowWhat();
$formWhen = new Application_Form_AddShowWhen(); $formWhen = new Application_Form_AddShowWhen();
$formRepeats = new Application_Form_AddShowRepeats(); $formRepeats = new Application_Form_AddShowRepeats();
@ -955,7 +949,6 @@ SQL;
$formStyle->removeDecorator('DtDdWrapper'); $formStyle->removeDecorator('DtDdWrapper');
$formLive->removeDecorator('DtDdWrapper'); $formLive->removeDecorator('DtDdWrapper');
if (!$isSaas) {
$formRecord = new Application_Form_AddShowRR(); $formRecord = new Application_Form_AddShowRR();
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
$formRebroadcast = new Application_Form_AddShowRebroadcastDates(); $formRebroadcast = new Application_Form_AddShowRebroadcastDates();
@ -963,7 +956,6 @@ SQL;
$formRecord->removeDecorator('DtDdWrapper'); $formRecord->removeDecorator('DtDdWrapper');
$formAbsoluteRebroadcast->removeDecorator('DtDdWrapper'); $formAbsoluteRebroadcast->removeDecorator('DtDdWrapper');
$formRebroadcast->removeDecorator('DtDdWrapper'); $formRebroadcast->removeDecorator('DtDdWrapper');
}
$when = $formWhen->isValid($data); $when = $formWhen->isValid($data);
if ($when && $formWhen->checkReliantFields($data, true, null, true)) { if ($when && $formWhen->checkReliantFields($data, true, null, true)) {
@ -997,7 +989,6 @@ SQL;
$controller->view->who = $formWho; $controller->view->who = $formWho;
$controller->view->style = $formStyle; $controller->view->style = $formStyle;
$controller->view->live = $formLive; $controller->view->live = $formLive;
if (!$isSaas) {
$controller->view->rr = $formRecord; $controller->view->rr = $formRecord;
$controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
$controller->view->rebroadcast = $formRebroadcast; $controller->view->rebroadcast = $formRebroadcast;
@ -1005,7 +996,6 @@ SQL;
//$formRecord->disable(); //$formRecord->disable();
//$formAbsoluteRebroadcast->disable(); //$formAbsoluteRebroadcast->disable();
//$formRebroadcast->disable(); //$formRebroadcast->disable();
}
return false; return false;
} }
@ -1026,7 +1016,6 @@ SQL;
$user = new Application_Model_User($userInfo->id); $user = new Application_Model_User($userInfo->id);
$isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER)); $isAdminOrPM = $user->isUserType(array(UTYPE_ADMIN, UTYPE_PROGRAM_MANAGER));
$isSaas = (Application_Model_Preference::GetPlanLevel() != 'disabled');
$record = false; $record = false;
$formWhat = new Application_Form_AddShowWhat(); $formWhat = new Application_Form_AddShowWhat();
@ -1072,7 +1061,6 @@ SQL;
$data["add_show_duration"] = $hValue.":".$mValue; $data["add_show_duration"] = $hValue.":".$mValue;
if (!$isSaas) {
$formRecord = new Application_Form_AddShowRR(); $formRecord = new Application_Form_AddShowRR();
$formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates(); $formAbsoluteRebroadcast = new Application_Form_AddShowAbsoluteRebroadcastDates();
$formRebroadcast = new Application_Form_AddShowRebroadcastDates(); $formRebroadcast = new Application_Form_AddShowRebroadcastDates();
@ -1083,14 +1071,12 @@ SQL;
$record = $formRecord->isValid($data); $record = $formRecord->isValid($data);
}
if ($data["add_show_repeats"]) { if ($data["add_show_repeats"]) {
$repeats = $formRepeats->isValid($data); $repeats = $formRepeats->isValid($data);
if ($repeats) { if ($repeats) {
$repeats = $formRepeats->checkReliantFields($data); $repeats = $formRepeats->checkReliantFields($data);
} }
if (!$isSaas) {
$formAbsoluteRebroadcast->reset(); $formAbsoluteRebroadcast->reset();
//make it valid, results don't matter anyways. //make it valid, results don't matter anyways.
$rebroadAb = 1; $rebroadAb = 1;
@ -1103,10 +1089,8 @@ SQL;
} else { } else {
$rebroad = 1; $rebroad = 1;
} }
}
} else { } else {
$repeats = 1; $repeats = 1;
if (!$isSaas) {
$formRebroadcast->reset(); $formRebroadcast->reset();
//make it valid, results don't matter anyways. //make it valid, results don't matter anyways.
$rebroad = 1; $rebroad = 1;
@ -1119,13 +1103,11 @@ SQL;
} else { } else {
$rebroadAb = 1; $rebroadAb = 1;
} }
}
} }
$who = $formWho->isValid($data); $who = $formWho->isValid($data);
$style = $formStyle->isValid($data); $style = $formStyle->isValid($data);
if ($what && $when && $repeats && $who && $style && $live) { if ($what && $when && $repeats && $who && $style && $live) {
if (!$isSaas) {
if ($record && $rebroadAb && $rebroad) { if ($record && $rebroadAb && $rebroad) {
if ($isAdminOrPM) { if ($isAdminOrPM) {
Application_Model_Show::create($data); Application_Model_Show::create($data);
@ -1152,17 +1134,6 @@ SQL;
return false; 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;
}
} else { } else {
$controller->view->what = $formWhat; $controller->view->what = $formWhat;
$controller->view->when = $formWhen; $controller->view->when = $formWhen;
@ -1171,11 +1142,9 @@ SQL;
$controller->view->style = $formStyle; $controller->view->style = $formStyle;
$controller->view->live = $formLive; $controller->view->live = $formLive;
if (!$isSaas) {
$controller->view->rr = $formRecord; $controller->view->rr = $formRecord;
$controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast; $controller->view->absoluteRebroadcast = $formAbsoluteRebroadcast;
$controller->view->rebroadcast = $formRebroadcast; $controller->view->rebroadcast = $formRebroadcast;
}
//$controller->view->addNewShow = !$editShow; //$controller->view->addNewShow = !$editShow;
//$controller->view->form = $controller->view->render('schedule/add-show-form.phtml'); //$controller->view->form = $controller->view->render('schedule/add-show-form.phtml');
return false; return false;

View file

@ -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;
}
}
}

View file

@ -2,12 +2,10 @@
<?php echo $this->element->getSubform('preferences_general') ?> <?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>
<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">
<div class="collapsible-content" id="email-server-settings"> <?php echo $this->element->getSubform('preferences_email_server') ?>
<?php echo $this->element->getSubform('preferences_email_server') ?> </div>
</div>
<?php } ?>
<h3 class="collapsible-header" id="soundcloud-heading"><span class="arrow-icon"></span>SoundCloud Settings</h3> <h3 class="collapsible-header" id="soundcloud-heading"><span class="arrow-icon"></span>SoundCloud Settings</h3>

View file

@ -1,7 +1,6 @@
<fieldset class="padded"> <fieldset class="padded">
<dl class="zend_form"> <dl class="zend_form">
<!-- Enable System Email option --> <!-- Enable System Email option -->
<?php if( !$this->isSaas ){?>
<dd id="enableSystemEmail-element" class="block-display"> <dd id="enableSystemEmail-element" class="block-display">
<label class="required" for="timezone"> <label class="required" for="timezone">
@ -103,6 +102,5 @@
</dd> </dd>
<?php } ?>
</dl> </dl>
</fieldset> </fieldset>

View file

@ -76,7 +76,6 @@
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<?php if( !$this->isSaas ){?>
<dt id="master_harbor_input_port-label"> <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 class="optional" for="master_harbor_input_port"><?php echo $this->element->getElement('master_harbor_input_port')->getLabel() ?> :
</label> </label>
@ -105,14 +104,13 @@
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<?php } ?>
<dt id="master_dj_connection_url-label"> <dt id="master_dj_connection_url-label">
<label class="optional" for="master_dj_connection_url" style="white-space: nowrap">Master Source Connection URL: <label class="optional" for="master_dj_connection_url" style="white-space: nowrap">Master Source Connection URL:
</label> </label>
</dt> </dt>
<dd id="master_dj_connection_url-element"> <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> <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){?> <?php if(!$this->isDemo){?>
<a href=# id="connection_url_override" style="font-size: 12px;">Override</a>&nbsp;&nbsp; <a href=# id="connection_url_override" style="font-size: 12px;">Override</a>&nbsp;&nbsp;
<span class="override_help_icon"> <span class="override_help_icon">
</span><br> </span><br>
@ -121,7 +119,6 @@
<a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a> <a href=# id="ok" style="font-size: 12px;">OK</a> <a href=# id="reset" style="font-size: 12px;">RESET</a>
</div> </div>
</dd> </dd>
<?php if( !$this->isSaas ){?>
<dt id="dj_harbor_input_port-label"> <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 class="optional" for="dj_harbor_input_port"><?php echo $this->element->getElement('dj_harbor_input_port')->getLabel() ?> :
</label> </label>
@ -150,14 +147,13 @@
</ul> </ul>
<?php endif; ?> <?php endif; ?>
</dd> </dd>
<?php } ?>
<dt id="live_dj_connection_url-label"> <dt id="live_dj_connection_url-label">
<label class="optional" for="live_dj_connection_url" style="white-space: nowrap">Show Source Connection URL: <label class="optional" for="live_dj_connection_url" style="white-space: nowrap">Show Source Connection URL:
</label> </label>
</dt> </dt>
<dd id="live_dj_connection_url-element"> <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> <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 ){?> <?php if( !$this->isDemo ){?>
<a href=# id="connection_url_override" style="font-size: 12px;">Override</a>&nbsp;&nbsp; <a href=# id="connection_url_override" style="font-size: 12px;">Override</a>&nbsp;&nbsp;
<span class="override_help_icon"> <span class="override_help_icon">
</span><br> </span><br>

View file

@ -1,5 +1,4 @@
<fieldset class="padded"> <fieldset class="padded">
<?php if( !$this->isSaas ){?>
<dl class="zend_form"> <dl class="zend_form">
<dd id="SupportFeedback-element" style="width:90%;"> <dd id="SupportFeedback-element" style="width:90%;">
<div class="info-text"> <div class="info-text">
@ -38,8 +37,7 @@
</dd> </dd>
</dl> </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> <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 "none"?>;">
<dl id="public-info" style="display:<?php echo !$this->isSaas?"none":"block"?>;">
<dt id="stationName-label" class="block-display"> <dt id="stationName-label" class="block-display">
<label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?> <label class="required" for="stationName"><?php echo $this->element->getElement('stationName')->getLabel() ?>
<span class="info-text-small">(Required)</span>: <span class="info-text-small">(Required)</span>:
@ -154,7 +152,6 @@
<?php endif; ?> <?php endif; ?>
</dd> </dd>
</dl> </dl>
<?php if( !$this->isSaas ){?>
<div id="show_what_sending" style="display: block;"> <div id="show_what_sending" style="display: block;">
<fieldset class="display_field toggle closed"> <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> <legend style="cursor: pointer;"><span class="ui-icon ui-icon-triangle-2-n-s"></span>Show me what I am sending </legend>
@ -182,5 +179,4 @@
<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> <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 }?> <?php }?>
</div> </div>
<?php } ?>
</fieldset> </fieldset>

View file

@ -1,9 +1,3 @@
<?php
$isSaas = true;
if(Application_Model_Preference::GetPlanLevel() == "disabled"){
$isSaas = false;
}
?>
<ul id="nav"> <ul id="nav">
<?php foreach ($this->container as $page) : ?> <?php foreach ($this->container as $page) : ?>
<?php if($this->navigation()->accept($page)) : ?> <?php if($this->navigation()->accept($page)) : ?>
@ -13,10 +7,7 @@
<span class="down"><?php echo $page->getLabel(); ?></span> <span class="down"><?php echo $page->getLabel(); ?></span>
</a> </a>
<ul class="sub"> <ul class="sub">
<?php foreach ($page->getPages() as $sub) : <?php foreach ($page->getPages() as $sub) : ?>
if($isSaas && $sub->getId() == "manage_folder"){
continue;
} ?>
<li> <li>
<a href="<?php echo $sub->getHref(); ?>" <?php echo ($sub->getTarget() != "")?"target=\"".$sub->getTarget()."\"":""; ?>><?php echo $sub->getLabel(); ?></a> <a href="<?php echo $sub->getHref(); ?>" <?php echo ($sub->getTarget() != "")?"target=\"".$sub->getTarget()."\"":""; ?>><?php echo $sub->getLabel(); ?></a>
</li> </li>

View file

@ -20,14 +20,12 @@
<div id="live-stream-override" class="collapsible-content"> <div id="live-stream-override" class="collapsible-content">
<?php echo $this->live; ?> <?php echo $this->live; ?>
</div> </div>
<?php if(!$this->isSaas()){?>
<h3 class="collapsible-header"><span class="arrow-icon"></span>Record & Rebroadcast</h3> <h3 class="collapsible-header"><span class="arrow-icon"></span>Record & Rebroadcast</h3>
<div id="schedule-record-rebroadcast" class="collapsible-content"> <div id="schedule-record-rebroadcast" class="collapsible-content">
<?php echo $this->rr; ?> <?php echo $this->rr; ?>
<?php echo $this->absoluteRebroadcast; ?> <?php echo $this->absoluteRebroadcast; ?>
<?php echo $this->rebroadcast; ?> <?php echo $this->rebroadcast; ?>
</div> </div>
<?php }?>
<h3 class="collapsible-header"><span class="arrow-icon"></span>Who</h3> <h3 class="collapsible-header"><span class="arrow-icon"></span>Who</h3>
<div id="schedule-show-who" class="collapsible-content"> <div id="schedule-show-who" class="collapsible-content">
<?php echo $this->who; ?> <?php echo $this->who; ?>

View file

@ -10,10 +10,10 @@
</ul> </ul>
</div> </div>
<?php if (isset($this->obj)) : ?>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button class="btn btn-inverse" type="submit" id="webstream_save" name="submit">Save</button> <button class="btn btn-inverse" type="submit" id="webstream_save" name="submit">Save</button>
</div> </div>
<?php if (isset($this->obj)) : ?>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button id="ws_delete" class="btn" <?php if ($this->action == "new"): ?>style="display:none;"<?php endif; ?>aria-disabled="false">Delete</button> <button id="ws_delete" class="btn" <?php if ($this->action == "new"): ?>style="display:none;"<?php endif; ?>aria-disabled="false">Delete</button>
</div> </div>

View file

@ -102,6 +102,10 @@ var AIRTIME = (function(AIRTIME) {
return container; return container;
}, },
cursor : 'pointer', cursor : 'pointer',
cursorAt: {
top: 30,
left: 100
},
connectToSortable : '#spl_sortable' connectToSortable : '#spl_sortable'
}); });
}; };

View file

@ -1,6 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os import os
import abc import abc
import re
import media.monitor.pure as mmp import media.monitor.pure as mmp
import media.monitor.owners as owners import media.monitor.owners as owners
from media.monitor.pure import LazyProperty from media.monitor.pure import LazyProperty
@ -101,6 +102,12 @@ class BaseEvent(Loggable):
self.path = os.path.normpath(raw_event.pathname) self.path = os.path.normpath(raw_event.pathname)
else: self.path = raw_event else: self.path = raw_event
self.owner = owners.get_owner(self.path) self.owner = owners.get_owner(self.path)
owner_re = re.search('stor/imported/(?P<owner>\d+)/', self.path)
if owner_re:
self.logger.info("matched path: %s" % self.path)
self.owner = owner_re.group('owner')
else:
self.logger.info("did not match path: %s" % self.path)
self._pack_hook = lambda: None # no op self._pack_hook = lambda: None # no op
# into another event # into another event

View file

@ -5,26 +5,22 @@ log = get_logger()
owners = {} owners = {}
def reset_owners(): def reset_owners():
""" """ Wipes out all file => owner associations """
Wipes out all file => owner associations
"""
global owners global owners
owners = {} owners = {}
def get_owner(f): def get_owner(f):
""" """ Get the owner id of the file 'f' """
Get the owner id of the file 'f' o = owners[f] if f in owners else -1
""" log.info("Received owner for %s. Owner: %s" % (f, o))
return owners[f] if f in owners else -1 return o
def add_file_owner(f,owner): def add_file_owner(f,owner):
""" """ Associate file f with owner. If owner is -1 then do we will not record
Associate file f with owner. If owner is -1 then do we will not record it it because -1 means there is no owner. Returns True if f is being stored
because -1 means there is no owner. Returns True if f is being stored after after the function. False otherwise. """
the function. False otherwise.
"""
if owner == -1: return False if owner == -1: return False
if f in owners: if f in owners:
if owner != owners[f]: # check for fishiness if owner != owners[f]: # check for fishiness
@ -35,16 +31,12 @@ def add_file_owner(f,owner):
return True return True
def has_owner(f): def has_owner(f):
""" """ True if f is owned by somebody. False otherwise. """
True if f is owned by somebody. False otherwise.
"""
return f in owners return f in owners
def remove_file_owner(f): def remove_file_owner(f):
""" """ Try and delete any association made with file f. Returns true if
Try and delete any association made with file f. Returns true if the the the the association was actually deleted. False otherwise. """
association was actually deleted. False otherwise.
"""
if f in owners: if f in owners:
del owners[f] del owners[f]
return True return True

View file

@ -52,8 +52,6 @@ class RequestSync(Loggable):
self.logger.info("ApiController.php probably crashed, we \ self.logger.info("ApiController.php probably crashed, we \
diagnose this from the fact that it did not return \ diagnose this from the fact that it did not return \
valid json") valid json")
self.logger.info("Trying again after %f seconds" %
self.request_wait)
except Exception as e: self.unexpected_exception(e) except Exception as e: self.unexpected_exception(e)
else: self.logger.info("Request was successful") else: self.logger.info("Request was successful")
self.watcher.flag_done() # poor man's condition variable self.watcher.flag_done() # poor man's condition variable

View file

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import unittest import unittest
import media.monitor.owners as owners from media.monitor import owners
class TestMMP(unittest.TestCase): class TestMMP(unittest.TestCase):
def setUp(self): def setUp(self):