replacing the email-templates of a survey?

Plus d'informations
il y a 5 jours 14 heures - il y a 5 jours 13 heures #183382 par bewi
COM_KUNENA_MESSAGE_CREATED_NEW
I want to replace the emailtemplates of a survey. as only superadmins should be able to change the default texts I wanted to get the texts in the plugin configuration.

later on on every save of the survey it's mail-templates should be replaced.

I got the fields to enter the value in the plugin configuration and it's content is saved in the table lime_plugin_settings.

as the mail templates are stored in lime_surveys_languagesettings I tried to hook into the save event.

$this->subscribe('beforeSave');
$this->subscribe('beforeSurveyLanguagesettingSave');


but those functions got not triggered :(



on the other side I noticed:
every time I save the survey, the mail templates are wrapped in a HTML page:
<html>
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
:
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
<head>
	<title></title>
</head>
<body>my template text</body>
</html>

and with each save another line
<script type="text/javascript">window["_gaUserPrefs"] = { ioo : function() { return true; } }</script>
is inserted. (my text stays in the body-tag).



hooking into beforeSurveySave works without problems, but I can't hook into the other ones to modify the mail templates.
Last edit: il y a 5 jours 13 heures by bewi. Raison: clarification

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 4 jours 15 heures #183421 par bewi
COM_KUNENA_MESSAGE_REPLIED_NEW
Although it is a weird behaviour to wrap text in a full html structur, the insertion of the Google analytics calls appears only with our 'old' firefox. In our company we have not the newest version, but an version with special extended LTS: 60.6.1esr (64-Bit)
Here I have some Javascript errors, I don't get with newest chrome (73.0.3683.103 (64-Bit))
I don't know wether this is the cause of misbehaviour, in chrome I only get a HTML/BODY-wrap with no GA-javascript. but that also seems strange.

At last I found my error:
the event no longer is named 'beforeSave' but 'beforeModelSave'

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 11 heures - il y a 4 jours 11 heures #183439 par DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
beforeModelSave is for all models : beforeSurveyLanguageSettingSave must work for SurveyLanguageSetting model only.

(see the Capitalize)

else beforeSave is the event LimeSurvey use fro Yii : it never work for LimeSurvey plugin

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Last edit: il y a 4 jours 11 heures by DenisChenu.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 jours 10 heures #183440 par DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
Else about _gaUserPrefs : did you try deactivate all FireFox plugin ?

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!