SAAS-69: Support Settings: Change/hide some sections for SaaS
- Some sections are hidden when saas is enabeld as described in the ticket.
This commit is contained in:
parent
00f37296e8
commit
a723430462
|
@ -1,6 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
require_once __DIR__."/configs/navigation.php";
|
|
||||||
require_once __DIR__."/configs/ACL.php";
|
require_once __DIR__."/configs/ACL.php";
|
||||||
|
|
||||||
require_once 'propel/runtime/lib/Propel.php';
|
require_once 'propel/runtime/lib/Propel.php';
|
||||||
|
@ -24,6 +23,8 @@ if (PEAR::isError($CC_DBC)) {
|
||||||
}
|
}
|
||||||
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
$CC_DBC->setFetchMode(DB_FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
require_once __DIR__."/configs/navigation.php";
|
||||||
|
|
||||||
//DateTime in PHP 5.3.0+ need a default timezone set.
|
//DateTime in PHP 5.3.0+ need a default timezone set.
|
||||||
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
date_default_timezone_set(Application_Model_Preference::GetTimezone());
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,8 @@ $pages = array(
|
||||||
'action' => 'stream-setting'
|
'action' => 'stream-setting'
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'label' => 'Support Settings',
|
'label' =>
|
||||||
|
Application_Model_Preference::GetPlanLevel() == 'disabled'?'Support Settings':'Station Information Settings',
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
'controller' => 'Preference',
|
'controller' => 'Preference',
|
||||||
'action' => 'support-setting'
|
'action' => 'support-setting'
|
||||||
|
|
|
@ -63,12 +63,14 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js','text/javascript');
|
$this->view->headScript()->appendFile($baseUrl.'/js/airtime/preferences/support-setting.js','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 ($values["Publicise"] != 1){
|
if (!$isSass && $values["Publicise"] != 1){
|
||||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
if(isset($values["Privacy"])){
|
if(isset($values["Privacy"])){
|
||||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||||
|
@ -78,8 +80,10 @@ 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"]);
|
||||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
if(!$isSass){
|
||||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
|
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||||
|
}
|
||||||
|
|
||||||
$form->Logo->receive();
|
$form->Logo->receive();
|
||||||
$imagePath = $form->Logo->getFileName();
|
$imagePath = $form->Logo->getFileName();
|
||||||
|
@ -88,7 +92,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(isset($values["Privacy"])){
|
if(!$isSass && isset($values["Privacy"])){
|
||||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -104,6 +108,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$privacyChecked = true;
|
$privacyChecked = true;
|
||||||
}
|
}
|
||||||
$this->view->privacyChecked = $privacyChecked;
|
$this->view->privacyChecked = $privacyChecked;
|
||||||
|
$this->view->section_title = Application_Model_Preference::GetPlanLevel() == 'disabled'?'Support Settings':'Station Information Settings';
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
//$form->render($this->view);
|
//$form->render($this->view);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,16 @@ 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')),
|
array('ViewScript', array('viewScript' => 'form/support-setting.phtml', "isSaas" => $isSass)),
|
||||||
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
|
array('File', array('viewScript' => 'form/support-setting.phtml', 'placement' => false)))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -106,46 +109,48 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
$upload->setAttrib('accept', 'image/jpeg,image/gif,image/png,image/jpg');
|
$upload->setAttrib('accept', 'image/jpeg,image/gif,image/png,image/jpg');
|
||||||
$this->addElement($upload);
|
$this->addElement($upload);
|
||||||
|
|
||||||
//enable support feedback
|
if(!$isSass){
|
||||||
$this->addElement('checkbox', 'SupportFeedback', array(
|
//enable support feedback
|
||||||
'label' => 'Send support feedback',
|
$this->addElement('checkbox', 'SupportFeedback', array(
|
||||||
'required' => false,
|
'label' => 'Send support feedback',
|
||||||
'value' => Application_Model_Preference::GetSupportFeedback(),
|
'required' => false,
|
||||||
'decorators' => array(
|
'value' => Application_Model_Preference::GetSupportFeedback(),
|
||||||
'ViewHelper'
|
'decorators' => array(
|
||||||
)
|
'ViewHelper'
|
||||||
));
|
)
|
||||||
|
));
|
||||||
// checkbox for publicise
|
|
||||||
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
|
// checkbox for publicise
|
||||||
$checkboxPublicise->setLabel('Promote my station on Sourcefabric.org')
|
$checkboxPublicise = new Zend_Form_Element_Checkbox("Publicise");
|
||||||
->setRequired(false)
|
$checkboxPublicise->setLabel('Promote my station on Sourcefabric.org')
|
||||||
->setDecorators(array('ViewHelper'))
|
->setRequired(false)
|
||||||
->setValue(Application_Model_Preference::GetPublicise());
|
->setDecorators(array('ViewHelper'))
|
||||||
if(Application_Model_Preference::GetSupportFeedback() == '0'){
|
->setValue(Application_Model_Preference::GetPublicise());
|
||||||
$checkboxPublicise->setAttrib("disabled", "disabled");
|
if(Application_Model_Preference::GetSupportFeedback() == '0'){
|
||||||
|
$checkboxPublicise->setAttrib("disabled", "disabled");
|
||||||
|
}
|
||||||
|
$this->addElement($checkboxPublicise);
|
||||||
|
|
||||||
|
// text area for sending detail
|
||||||
|
$this->addElement('textarea', 'SendInfo', array(
|
||||||
|
'class' => 'sending_textarea',
|
||||||
|
'required' => false,
|
||||||
|
'filters' => array('StringTrim'),
|
||||||
|
'readonly' => true,
|
||||||
|
'cols' => 61,
|
||||||
|
'rows' => 5,
|
||||||
|
'value' => Application_Model_Preference::GetSystemInfo(),
|
||||||
|
'decorators' => array(
|
||||||
|
'ViewHelper'
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
// checkbox for privacy policy
|
||||||
|
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
||||||
|
$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'));
|
||||||
|
$this->addElement($checkboxPrivacy);
|
||||||
}
|
}
|
||||||
$this->addElement($checkboxPublicise);
|
|
||||||
|
|
||||||
// text area for sending detail
|
|
||||||
$this->addElement('textarea', 'SendInfo', array(
|
|
||||||
'class' => 'sending_textarea',
|
|
||||||
'required' => false,
|
|
||||||
'filters' => array('StringTrim'),
|
|
||||||
'readonly' => true,
|
|
||||||
'cols' => 61,
|
|
||||||
'rows' => 5,
|
|
||||||
'value' => Application_Model_Preference::GetSystemInfo(),
|
|
||||||
'decorators' => array(
|
|
||||||
'ViewHelper'
|
|
||||||
)
|
|
||||||
));
|
|
||||||
|
|
||||||
// checkbox for privacy policy
|
|
||||||
$checkboxPrivacy = new Zend_Form_Element_Checkbox("Privacy");
|
|
||||||
$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'));
|
|
||||||
$this->addElement($checkboxPrivacy);
|
|
||||||
|
|
||||||
// submit button
|
// submit button
|
||||||
$submit = new Zend_Form_Element_Submit("submit");
|
$submit = new Zend_Form_Element_Submit("submit");
|
||||||
|
@ -160,14 +165,16 @@ class Application_Form_SupportSettings extends Zend_Form
|
||||||
public function isValid ($data)
|
public function isValid ($data)
|
||||||
{
|
{
|
||||||
$isValid = parent::isValid($data);
|
$isValid = parent::isValid($data);
|
||||||
if($data['Publicise'] != 1){
|
if(!$this->isSass){
|
||||||
$isValid = true;
|
if($data['Publicise'] != 1){
|
||||||
}
|
$isValid = true;
|
||||||
if(isset($data["Privacy"])){
|
}
|
||||||
$checkPrivacy = $this->getElement('Privacy');
|
if(isset($data["Privacy"])){
|
||||||
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
|
$checkPrivacy = $this->getElement('Privacy');
|
||||||
$checkPrivacy->addError("You have to agree to privacy policy.");
|
if($data["SupportFeedback"] == "1" && $data["Privacy"] != "1"){
|
||||||
$isValid = false;
|
$checkPrivacy->addError("You have to agree to privacy policy.");
|
||||||
|
$isValid = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $isValid;
|
return $isValid;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<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">Help Airtime improve by letting us know you are using it. This info
|
<div class="info-text">Help Airtime improve by letting us know you are using it. This info
|
||||||
|
@ -32,8 +33,9 @@
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<div class="info-text" style="clear: both;padding: 4px 0 4px 15px;"><p> Note: In order to promote your station, "Send support feedback" must be enabled</p></div>
|
<div class="info-text" style="clear: both;padding: 4px 0 4px 15px;"><p> Note: In order to promote your station, "Send support feedback" must be enabled</p></div>
|
||||||
<dl id="public-info" style="display:none;">
|
<?php }?>
|
||||||
|
<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>:
|
||||||
|
@ -148,7 +150,7 @@
|
||||||
<?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>
|
||||||
|
@ -157,6 +159,7 @@
|
||||||
</dl>
|
</dl>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<br>
|
<br>
|
||||||
<?php if(!$this->element->getView()->privacyChecked){?>
|
<?php if(!$this->element->getView()->privacyChecked){?>
|
||||||
|
@ -175,4 +178,5 @@
|
||||||
<a id="link_to_terms_and_condition" href="http://www.sourcefabric.org/en/about/policy/" onclick="window.open(this.href); return false;">Terms and Conditions</a>
|
<a id="link_to_terms_and_condition" href="http://www.sourcefabric.org/en/about/policy/" onclick="window.open(this.href); return false;">Terms and Conditions</a>
|
||||||
<?php }?>
|
<?php }?>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
|
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences">
|
||||||
<h2>Support Settings</h2>
|
<h2><?php echo $this->section_title?></h2>
|
||||||
<form method="post" action="/Preference/support-setting" enctype="multipart/form-data">
|
<form method="post" action="/Preference/support-setting" enctype="multipart/form-data">
|
||||||
<div id="support-settings">
|
<div id="support-settings">
|
||||||
<?php echo $this->statusMsg ?>
|
<?php echo $this->statusMsg ?>
|
||||||
|
|
Loading…
Reference in New Issue