Skip to content
Snippets Groups Projects
Commit 50ad58bd authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Jan-Hendrik Willms
Browse files

switch language before sending personal notifications after a questionnaire is...

switch language before sending personal notifications after a questionnaire is answered, fixes #4385

Closes #4385

Merge request studip/studip!3194
parent 466cb94e
No related branches found
No related tags found
No related merge requests found
...@@ -941,15 +941,18 @@ class QuestionnaireController extends AuthenticatedController ...@@ -941,15 +941,18 @@ class QuestionnaireController extends AuthenticatedController
$anonymous_answer->store(); $anonymous_answer->store();
} }
if (!$answered_before && !$this->questionnaire['anonymous'] && ($this->questionnaire['user_id'] !== $GLOBALS['user']->id)) { if (!$answered_before && !$this->questionnaire['anonymous'] && ($this->questionnaire['user_id'] !== $GLOBALS['user']->id)) {
$url = URLHelper::getURL("dispatch.php/questionnaire/evaluate/" . $this->questionnaire->getId(), [], true); setTempLanguage($this->questionnaire->user_id);
PersonalNotifications::add( PersonalNotifications::add(
$this->questionnaire['user_id'], $this->questionnaire->user_id,
$url, URLHelper::getURL('dispatch.php/questionnaire/evaluate/' . $this->questionnaire->id, [], true),
sprintf(_("%s hat an der Befragung '%s' teilgenommen."), $GLOBALS['user']->getFullName(), $this->questionnaire['title']), sprintf(_("%s hat an der Befragung '%s' teilgenommen."), $GLOBALS['user']->getFullName(), $this->questionnaire->title),
"questionnaire_" . $this->questionnaire->getId(), "questionnaire_" . $this->questionnaire->id,
Icon::create('vote'), Icon::create('vote'),
true true
); );
restoreLanguage();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment