Adding a mandatory check before allowing activation

More
10 months 3 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 to join the conversation.

LimeSurvey Partners
More
10 months 3 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
>>>

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Checkout our Reporting Solutions and our plugin shop at www.encuesta.biz .

The following user(s) said Thank You: Jmantysalo

Please Log in to join the conversation.

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

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

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now