Skip to content

Commit

Permalink
Dev: fixed database setting
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Jul 19, 2017
1 parent e4bf6d0 commit 33feda5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions application/controllers/admin/database.php
Expand Up @@ -944,11 +944,6 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID)
$dateformat = Yii::app()->request->getPost('dateformat_'.$langname);
$numberformat = Yii::app()->request->getPost('numberformat_'.$langname);


var_dump([
$short_title,$description,$welcome,$endtext
]);

if(!empty($short_title))
$data['surveyls_title'] = $short_title;
if(!empty($description))
Expand All @@ -969,7 +964,7 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID)
$oSurveyLanguageSetting= SurveyLanguageSetting::model()->findByPk(array('surveyls_survey_id'=>$iSurveyID, 'surveyls_language'=>$langname));
$oSurveyLanguageSetting->setAttributes($data);
$save = false;
$save = $SurveyLanguageSetting->save(); // save the change to database
$save = $oSurveyLanguageSetting->save(); // save the change to database
if((!empty($short_title)) || (!empty($description)) || (!empty($welcome)) || (!empty($endtext)) || (!empty($sURL)) || (!empty($sURLDescription)) || (!empty($dateformat)) || (!empty($numberformat)))
{

Expand Down Expand Up @@ -1093,7 +1088,6 @@ private function actionUpdateSurveyLocaleSettings($iSurveyID)

$oSurvey->adminemail = $this->_filterEmptyFields($oSurvey,'adminemail');
$oSurvey->bounce_email = $this->_filterEmptyFields($oSurvey,'bounce_email');

$event = new PluginEvent('beforeSurveySettingsSave');
$event->set('modifiedSurvey', $oSurvey);
App()->getPluginManager()->dispatchEvent($event);
Expand Down Expand Up @@ -1238,7 +1232,7 @@ private function _filterEmptyFields(&$oSurvey, $fieldArrayName, $newValue=null){
switch($options['type']){
case 'yesno':
if($newValue != 'Y' || $newValue != 'N')
$newValue = $newValue=='1' ? 'Y' : 'N';
$newValue = ($newValue=='1' || $newValue==true ) ? 'Y' : 'N';
break;
case 'Int' :
$newValue = (int) $newValue;
Expand Down

0 comments on commit 33feda5

Please sign in to comment.