Skip to content

Commit

Permalink
Dev: Redirect to Cint after survey is completed
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Aug 18, 2016
1 parent 2ea9a48 commit db35be7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions application/core/plugins/CintLink/CintLink.php
Expand Up @@ -52,14 +52,15 @@ class CintLink extends \ls\pluginmanager\PluginBase

public function init()
{
$this->subscribe('afterQuickMenuLoad');
$this->subscribe('afterSurveyComplete');
$this->subscribe('beforeActivate'); // Create db
$this->subscribe('beforeAdminMenuRender');
$this->subscribe('beforeToolsMenuRender');
$this->subscribe('afterQuickMenuLoad');
$this->subscribe('newDirectRequest'); // Ajax calls
$this->subscribe('beforeControllerAction'); // To load Cint icon
$this->subscribe('beforeSurveyDeactivate');
$this->subscribe('beforeSurveyActivate');
$this->subscribe('newDirectRequest'); // Ajax calls

// Login session key from com_api at limesurvey.org
$limesurveyOrgKey = Yii::app()->user->getState('limesurveyOrgKey');
Expand Down Expand Up @@ -259,6 +260,17 @@ public function afterQuickMenuLoad()
$event->append('quickMenuItems', array($button));
}

/**
* After survey is completed, user MUST be redirected to
* Cint.
* @return void
*/
public function afterSurveyComplete()
{
header('Location: http://cds.cintworks.net/survey/complete');
die();
}

/**
* Register Cint icon css
* Also check if user tried to pay Cint order and if survey is
Expand Down

0 comments on commit db35be7

Please sign in to comment.