Skip to content

Commit

Permalink
Fixed issue #10140 : replaced SettingsWidget by plain HTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisGac committed Dec 15, 2015
1 parent f95a01f commit 5420847
Show file tree
Hide file tree
Showing 6 changed files with 251 additions and 123 deletions.
8 changes: 0 additions & 8 deletions application/config/third_party.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,6 @@
)
),

// displayParticipants
'display-participants' => array(
'baseUrl' => 'styles/limebootstrap/assets/',
'css' => array(
'css/displayParticipants.css',
),
),

// select2
'select2' => array(
'baseUrl' => 'styles/limebootstrap/assets/',
Expand Down
1 change: 0 additions & 1 deletion application/controllers/admin/participantsaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ function displayParticipants()
'aAttributes' => ParticipantAttributeName::model()->getAllAttributes()
);
App()->getClientScript()->registerPackage('jqgrid');
App()->getClientScript()->registerPackage('display-participants');

// loads the participant panel view and display participant view

Expand Down
25 changes: 16 additions & 9 deletions application/controllers/admin/tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -2433,18 +2433,20 @@ function kill($iSurveyId)

function bouncesettings($iSurveyId)
{
$iSurveyId = sanitize_int($iSurveyId);
$iSurveyId = $iSurveyID = sanitize_int($iSurveyId);
if (!Permission::model()->hasSurveyPermission($iSurveyId, 'tokens', 'update'))
{
Yii::app()->session['flashmessage'] = gT("You do not have sufficient rights to access this page.");
$this->getController()->redirect(array("/admin/survey/sa/view/surveyid/{$iSurveyId}"));
}

// CHECK TO SEE IF A TOKEN TABLE EXISTS FOR THIS SURVEY
$bTokenExists = tableExists('{{tokens_' . $iSurveyId . '}}');
if (!$bTokenExists) //If no tokens table exists
{
self::_newtokentable($iSurveyId);
}

$aData['thissurvey'] = $aData['settings'] = getSurveyInfo($iSurveyId);
$aData['surveyid'] = $iSurveyId;

Expand All @@ -2468,14 +2470,20 @@ function bouncesettings($iSurveyId)
foreach ($fieldvalue as $k => $v)
$survey->$k = $v;
$test=$survey->save();

App()->user->setFlash('bouncesettings', gT("Bounce settings have been saved."));

//~ $this->_renderWrappedTemplate('token', array( 'message' => array(
//~ 'title' => gT("Bounce settings"),
//~ 'message' => gT("Bounce settings have been saved."),
//~ 'class' => 'successheader'
//~ )), $aData);
$this->getController()->redirect(array("admin/tokens/sa/bouncesettings/surveyid/{$iSurveyId}"));
}

$aData['sidebar']["token_menu"]=TRUE;
$aData['token_bar']['closebutton']['url'] = 'admin/tokens/sa/index/surveyid/'.$iSurveyId;
$aData['token_bar']['savebutton']['form'] = true;

$aData['sidebar']['state'] = "close";
$surveyinfo = Survey::model()->findByPk($iSurveyID)->surveyinfo;
$aData['title_bar']['title'] = $surveyinfo['surveyls_title']."(".gT("ID").":".$iSurveyId.")";

$this->_renderWrappedTemplate('token', array( 'bounce'), $aData);
}

Expand Down Expand Up @@ -2639,9 +2647,10 @@ function _newtokentable($iSurveyId)
$aData['title_bar']['title'] = $surveyinfo['surveyls_title']."(".gT("ID").":".$iSurveyId.")";
$aData['sidebar']["token_menu"]=TRUE;

$aData['token_bar']['closebutton']['url'] = 'admin/tokens/sa/index/surveyid/'.$surveyid;
$aData['token_bar']['savebutton']['form'] = true;
$aData['token_bar']['returnbutton']['url'] = $this->getController()->createUrl("admin/survey/sa/view/", array('surveyid'=>$iSurveyId));
$aData['token_bar']['returnbutton']['text'] = gT('return to survey summary');

$this->_renderWrappedTemplate('token', 'tokenwarning', $aData);
}
Yii::app()->end();
Expand All @@ -2656,8 +2665,6 @@ function _newtokentable($iSurveyId)
*/
protected function _renderWrappedTemplate($sAction = 'token', $aViewUrls = array(), $aData = array())
{
App()->getClientScript()->registerPackage('display-participants');

$aData['imageurl'] = Yii::app()->getConfig('adminimageurl');
$aData['display']['menu_bars'] = false;
parent::_renderWrappedTemplate($sAction, $aViewUrls, $aData);
Expand Down
1 change: 1 addition & 0 deletions application/core/Survey_Common_Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ function _titlebar($aData)

function _tokenbar($aData)
{
//var_dump($aData['token_bar']);
if( isset($aData['token_bar']) ) {
$this->getController()->renderPartial("/admin/token/token_bar", $aData);
}
Expand Down

0 comments on commit 5420847

Please sign in to comment.