CC-4731: Cannot save support feedback settings
This commit is contained in:
parent
844246df3a
commit
1846f17bbc
3 changed files with 6 additions and 28 deletions
|
@ -91,12 +91,7 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
|
|
||||||
$form = new Application_Form_SupportSettings();
|
$form = new Application_Form_SupportSettings();
|
||||||
if ($request->isPost()) {
|
if ($request->isPost()) {
|
||||||
$postData = $request->getPost();
|
$values = $request->getPost();
|
||||||
$values = array();
|
|
||||||
//put postData in array format isValid() expects it to be in
|
|
||||||
foreach ($postData["data"] as $field) {
|
|
||||||
$values[$field["name"]] = $field["value"];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($values["Publicise"] != 1) {
|
if ($values["Publicise"] != 1) {
|
||||||
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
Application_Model_Preference::SetSupportFeedback($values["SupportFeedback"]);
|
||||||
|
@ -137,9 +132,6 @@ class PreferenceController extends Zend_Controller_Action
|
||||||
$this->view->privacyChecked = $privacyChecked;
|
$this->view->privacyChecked = $privacyChecked;
|
||||||
$this->view->section_title = _('Support Feedback');
|
$this->view->section_title = _('Support Feedback');
|
||||||
$this->view->form = $form;
|
$this->view->form = $form;
|
||||||
if ($request->isPost()) {
|
|
||||||
die(json_encode(array("html"=>$this->view->render('preference/support-setting.phtml'))));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function directoryConfigAction()
|
public function directoryConfigAction()
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences" id="support-feedback-view">
|
<div class="ui-widget ui-widget-content block-shadow simple-formblock clearfix padded-strong preferences" id="support-feedback-view">
|
||||||
<h2><?php echo $this->section_title?></h2>
|
<h2><?php echo $this->section_title?></h2>
|
||||||
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
<?php $baseUrl = Application_Common_OsPath::getBaseDir(); ?>
|
||||||
<form method="post" id="support-feedback-form" action="enctype="multipart/form-data">
|
<form method="post" action=<?php echo $baseUrl."/Preference/support-setting"?> enctype="multipart/form-data" id="support-feedback-form">
|
||||||
<div id="support-settings">
|
<div id="support-settings">
|
||||||
<?php echo $this->statusMsg ?>
|
<?php echo $this->statusMsg ?>
|
||||||
<?php echo $this->form ?>
|
<?php echo $this->form ?>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<div class="button-bar bottom" id="submit-element">
|
||||||
<button name="support_save" id="support_save" type="button" class="btn right-floated"><? echo _("Save") ?></button>
|
<?php echo $this->form->getElement('submit')?>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,23 +11,8 @@ function showErrorSections() {
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
setUpEventListeners();
|
|
||||||
});
|
|
||||||
|
|
||||||
function setUpEventListeners() {
|
|
||||||
var form = $("form");
|
var form = $("form");
|
||||||
|
|
||||||
$("#support_save").click( function() {
|
|
||||||
var data = $("#support-feedback-form").serializeArray();
|
|
||||||
var url = baseUrl+'/Preference/support-setting';
|
|
||||||
|
|
||||||
$.post(url, {format:"json", data: data}, function(data){
|
|
||||||
var json = $.parseJSON(data);
|
|
||||||
$("#support-feedback-view").parent().empty().append(json.html);
|
|
||||||
setUpEventListeners();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
$("#SupportFeedback").click( function(){
|
$("#SupportFeedback").click( function(){
|
||||||
var pub = $("#Publicise");
|
var pub = $("#Publicise");
|
||||||
if( !$(this).is(':checked') ){
|
if( !$(this).is(':checked') ){
|
||||||
|
@ -96,4 +81,4 @@ function setUpEventListeners() {
|
||||||
logoEl.find(".errors").remove();
|
logoEl.find(".errors").remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue