Skip to content

Commit

Permalink
Fixed issue #6493: Bounce settings are not saved
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Aug 20, 2012
1 parent 3fdc243 commit d4cb01f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
3 changes: 2 additions & 1 deletion application/controllers/admin/tokens.php
Expand Up @@ -2232,7 +2232,7 @@ function bouncesettings($iSurveyId)
$survey = Survey::model()->findByAttributes(array('sid' => $iSurveyId));
foreach ($fieldvalue as $k => $v)
$survey->$k = $v;
$survey->save();
$test=$survey->save();

$this->_renderWrappedTemplate('token', array('tokenbar', 'message' => array(
'title' => $clang->gT("Bounce settings"),
Expand All @@ -2242,6 +2242,7 @@ function bouncesettings($iSurveyId)
}
else
{
$this->getController()->_js_admin_includes(Yii::app()->getConfig('adminscripts') . "tokenbounce.js");
$this->_renderWrappedTemplate('token', array('tokenbar', 'bounce'), $aData);
}
}
Expand Down
4 changes: 2 additions & 2 deletions application/models/Survey.php
Expand Up @@ -97,7 +97,7 @@ public function rules()
array('bounce_email', 'xssfilter'),
array('faxto', 'xssfilter'),
array('active', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('anonymized', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('anonymized', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('savetimings', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('datestamp', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('usecookie', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
Expand All @@ -123,7 +123,7 @@ public function rules()
array('allowjumps', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('nokeyboard', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('alloweditaftercompletion', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('bounceprocessing', 'in','range'=>array('Y','N'), 'allowEmpty'=>true),
array('bounceprocessing', 'in','range'=>array('L','N','G'), 'allowEmpty'=>true),
array('usecaptcha', 'in','range'=>array('A','B','C','D','X','R','S','N'), 'allowEmpty'=>true),
array('showgroupinfo', 'in','range'=>array('B','N','D','X'), 'allowEmpty'=>true),
array('showqnumcode', 'in','range'=>array('B','N','C','X'), 'allowEmpty'=>true),
Expand Down
22 changes: 22 additions & 0 deletions scripts/admin/tokenbounce.js
@@ -0,0 +1,22 @@
// $Id: tokens.js 8633 2010-04-25 12:57:33Z c_schmitz


$(document).ready(function() {
$("#bounceprocessing").change(turnoff);
turnoff();
});



function turnoff(ui,evt) {
bounce_disabled=($("#bounceprocessing").val()=='N' || $("#bounceprocessing").val()=='G');
if (bounce_disabled==true) {bounce_disabled='disabled';}
else {bounce_disabled='';}
$("#bounceaccounttype").attr('disabled',bounce_disabled);
$("#bounceaccounthost").attr('disabled',bounce_disabled);
$("#bounceaccountuser").attr('disabled',bounce_disabled);
$("#bounceaccountpass").attr('disabled',bounce_disabled);
$("#bounceencryption").attr('disabled',bounce_disabled);
$("#bounceaccountencryption").attr('disabled',bounce_disabled);
};

16 changes: 2 additions & 14 deletions scripts/admin/tokens.js
Expand Up @@ -25,9 +25,9 @@ function addcondition()
$('#searchtable > tbody > tr').eq(idexternal).after(html2);
idexternal++;
}
$(document).ready(function() {

turnoff();

$(document).ready(function() {

$("#filterduplicatetoken").change(function(){
if ($("#filterduplicatetoken").attr('checked')==true) {
Expand All @@ -38,18 +38,6 @@ $(document).ready(function() {
})


function turnoff(ui,evt) {
bounce_disabled=($("#bounceprocessing").val()=='N' || $("#bounceprocessing").val()=='G');
if (bounce_disabled==true) {bounce_disabled='disabled';}
else {bounce_disabled='';}
$("#bounceaccounttype").attr('disabled',bounce_disabled);
$("#bounceaccounthost").attr('disabled',bounce_disabled);
$("#bounceaccountuser").attr('disabled',bounce_disabled);
$("#bounceaccountpass").attr('disabled',bounce_disabled);
$("#bounceencryption").attr('disabled',bounce_disabled);
$("#bounceaccountencryption").attr('disabled',bounce_disabled);
}

// Code for AJAX download
jQuery.download = function(url, data, method){
//url and data options required
Expand Down

0 comments on commit d4cb01f

Please sign in to comment.