Adding a mandatory check before allowing activation

More
3 months 2 weeks ago #190693 by Jmantysalo
I want to force users to set up some expiration date for every survey. I am able to make a plugin that makes use of beforeSurveyActivate-hook and can get the ID of the survey by $this->getEvent()->get('surveyId'). But how to get the expiration date from that?

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
3 months 2 weeks ago #190694 by gabrieljenik
Given that surveyId, you should fetch the survey model and get the expiration date attribute from it.

Something like this:
>>>
$S = Survey::model()->findByPk($iSurveyID);
$expirationDate = $S->expires
>>>

Cheers,
Gabriel - www.Encuesta.Biz - Authorized Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?)....[img]
The following user(s) said Thank You: Jmantysalo

Please Log in or Create an account to join the conversation.

More
3 months 2 weeks ago #190696 by Jmantysalo
Thanks, this works.

Somewhat hard to find instructions for developing plugins. LimeSurvey itself is great!

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!