-cleanup parsing for form elements that weren't provided by the client in our SaaS implementation
This commit is contained in:
parent
fc09e8cd74
commit
3086bde17e
2 changed files with 12 additions and 39 deletions
|
@ -70,19 +70,10 @@ class PreferenceController extends Zend_Controller_Action
|
|||
if ($request->isPost()) {
|
||||
$values = $request->getPost();
|
||||
if ($form->isValid($values)) {
|
||||
if ($values["Publicise"] != 1) {
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
} else {
|
||||
Application_Model_Preference::SetHeadTitle($values["stationName"], $this->view);
|
||||
Application_Model_Preference::SetPhone($values["Phone"]);
|
||||
Application_Model_Preference::SetEmail($values["Email"]);
|
||||
Application_Model_Preference::SetStationWebSite($values["StationWebSite"]);
|
||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||
Application_Model_Preference::SetPublicise($values["Publicise"]);
|
||||
|
||||
$form->Logo->receive();
|
||||
$imagePath = $form->Logo->getFileName();
|
||||
|
@ -94,7 +85,6 @@ class PreferenceController extends Zend_Controller_Action
|
|||
if (isset($values["Privacy"])) {
|
||||
Application_Model_Preference::SetPrivacyPolicyCheck($values["Privacy"]);
|
||||
}
|
||||
}
|
||||
$this->view->statusMsg = "<div class='success'>Support setting updated.</div>";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,20 +126,6 @@ class Application_Form_SupportSettings extends Zend_Form
|
|||
}
|
||||
$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(false, true),
|
||||
'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>.")
|
||||
|
@ -159,9 +145,6 @@ class Application_Form_SupportSettings extends Zend_Form
|
|||
public function isValid ($data)
|
||||
{
|
||||
$isValid = parent::isValid($data);
|
||||
if ($data['Publicise'] != 1) {
|
||||
$isValid = true;
|
||||
}
|
||||
if (isset($data["Privacy"])) {
|
||||
$checkPrivacy = $this->getElement('Privacy');
|
||||
if ($data["SupportFeedback"] == "1" && $data["Privacy"] != "1") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue