Skip to content

Commit

Permalink
Dev: Generate link for survey (CintLink)
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jul 15, 2016
1 parent d40c323 commit 7216e8a
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion application/core/plugins/CintLink/CintLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,30 @@ public function getSurvey(LSHttpRequest $request)
$surveyId = $request->getParam('surveyId');
$survey = Survey::model()->findByPk($surveyId);
$data = $survey->getAttributes();

$surveyLanguage = SurveyLanguageSetting::model()->findByPk(array(
'surveyls_survey_id' => $surveyId,
'surveyls_language' => $survey->language
));
$data = array_merge($data, $surveyLanguage->getAttributes());

$user = $this->api->getCurrentUser();

$link = Yii::app()->createUrl(
'survey/index',
array(
'sid' => 'sidebody',
'plugin' => 'MassAction',
'method' => 'actionIndex',
'surveyId' => $surveyId
)
);

return json_encode(array(
'result' => json_encode($data),
'name' => $user->full_name,
'email' => $user->email
'email' => $user->email,
'link' => $this->createAbsoluteUrl("survey/index",array("sid"=>$surveyinfo['sid'],"lang"=>$surveyinfo['language']))
));
}

Expand Down

0 comments on commit 7216e8a

Please sign in to comment.